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.
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.
cancel
fn cancel(self: Self)
Ends the Shared with JoinError::Canceled, running its continuations and then waking
its awaiting futures inside this call.
shared
fn shared(self: &Self) -> Shared<T>
The Shared that this ends.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyDebug
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.