FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SharedReceiver

    struct · ferroui-system · v0.5.0

    struct SharedReceiver<T>
    

    A receiver for several waiters (Receiver::shared): each clone is a future of a copy of the value, or of Canceled; the value stays in the channel for every clone, the ones made later included. The awaiting clones are woken in the order they first waited, and a task that awaits several of them is woken once.

    The sender is closed (Sender::is_closed) when every clone is gone.

    View source

    Members

    try_recv

    fn try_recv(self: &Self) -> Result<Option<T>, Canceled>
    

    A copy of the value when it was sent (Ok(Some)), Ok(None) while it was not, and Canceled when the sender was dropped without sending.

    Source

    blocking_recv

    fn blocking_recv(self: &Self) -> Result<T, Canceled>
    

    Blocks the thread until the value is sent, or the sender is dropped.

    Never returns when the value is to be sent by work of this same thread.

    Source

    recv_timeout

    fn recv_timeout(self: &Self, timeout: Duration) -> Result<Option<T>, Canceled>
    

    Blocks the thread until the value is sent, the sender is dropped, or timeout has passed; Ok(None) is the timeout.

    Source

    is_finished

    fn is_finished(self: &Self) -> bool
    

    Whether the channel has completed: the value was sent or the sender is gone, so that a poll is ready.

    Source

    flatten

    fn flatten(self: Self) -> impl Future<Output = Result<T, crate::ObservableError>>
    

    A future of the result that the channel carries, for this waiter: what was sent, or the error Canceled when the sender was dropped without sending (SetCanceled).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • IntoFuture
    • ToOwned
    • Clone
    • Future
    • Drop
    • Debug

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.