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.
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.
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.
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.
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.
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).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyIntoFutureToOwnedCloneFutureDropDebug
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.