Struct Receiver
struct Receiver<T> { ... }
A future for a value that will be provided by another asynchronous task.
This is created by the channel function.
Implementations
impl<T> Receiver<T>
fn close(self: &mut Self)Gracefully close this receiver, preventing any subsequent attempts to send to it.
Any
sendoperation which happens after this method returns is guaranteed to fail. After calling this method, you can useReceiver::pollto determine whether a message had previously been sent.fn try_recv(self: &mut Self) -> Result<Option<T>, Canceled>Attempts to receive a message outside of the context of a task.
Does not schedule a task wakeup or have any other side effects.
A return value of
Nonemust be considered immediately stale (out of date) unlessclosehas been called first.Returns an error if the sender was dropped.
impl<F> IntoFuture for Receiver<T>
fn into_future(self: Self) -> <F as IntoFuture>::IntoFuture
impl<F, T, E> TryFuture for Receiver<T>
fn try_poll(self: Pin<&mut F>, cx: &mut Context<'_>) -> Poll<<F as Future>::Output>
impl<T> Any for Receiver<T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Receiver<T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Receiver<T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> Debug for Receiver<T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T> Drop for Receiver<T>
fn drop(self: &mut Self)
impl<T> Freeze for Receiver<T>
impl<T> From for Receiver<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> FusedFuture for Receiver<T>
fn is_terminated(self: &Self) -> bool
impl<T> Future for Receiver<T>
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<T, Canceled>>
impl<T> RefUnwindSafe for Receiver<T>
impl<T> Send for Receiver<T>
impl<T> Sync for Receiver<T>
impl<T> Unpin for Receiver<T>
impl<T> UnsafeUnpin for Receiver<T>
impl<T> UnwindSafe for Receiver<T>
impl<T, U> Into for Receiver<T>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Receiver<T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Receiver<T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>