FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SharedSender

    struct · ferroui-system · v0.5.0

    struct SharedSender<T>
    

    The end of a Shared that code ends by hand (Shared::channel): once, on the thread of the Shared (the role of TaskCompletionSource<T>: SetResult is send, SetCanceled is cancel, and SetException is send(Err(error)) on a Shared of a Result).

    Dropping it without sending leaves the Shared pending, as a TaskCompletionSource that is dropped leaves its task, and as the reactive libraries need (ToTask of a sequence that lets go of its observer without ending, Never, gives a task that never ends). This differs from oneshot, whose dropped sender cancels the receiver.

    View source

    Members

    send

    fn send(self: Self, value: T)
    

    Ends the Shared with value, running its continuations and then waking its awaiting futures inside this call.

    Source

    cancel

    fn cancel(self: Self)
    

    Ends the Shared with JoinError::Canceled, running its continuations and then waking its awaiting futures inside this call.

    Source

    shared

    fn shared(self: &Self) -> Shared<T>
    

    The Shared that this ends.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • Debug

    Availability

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