Struct Receiver

struct Receiver<T> { ... }

The receiving end of a bounded mpsc channel.

This value is created by the channel function.

Implementations

impl<T> Receiver<T>

fn close(self: &mut Self)

Closes the receiving half of a channel, without dropping it.

This prevents any further messages from being sent on the channel while still enabling the receiver to drain messages that are buffered.

fn try_next(self: &mut Self) -> Result<Option<T>, TryRecvError>

Tries to receive the next message without notifying a context if empty.

It is not recommended to call this function from inside of a future, only when you've otherwise arranged to be notified when the channel is no longer empty.

This function returns:

  • Ok(Some(t)) when message is fetched
  • Ok(None) when channel is closed and no messages left in the queue
  • Err(e) when there are no messages available, but channel is not yet closed

impl<S, T, E> TryStream for Receiver<T>

fn try_poll_next(self: Pin<&mut S>, cx: &mut Context<'_>) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>

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) -> T

Returns the argument unchanged.

impl<T> FusedStream for Receiver<T>

fn is_terminated(self: &Self) -> bool

impl<T> RefUnwindSafe for Receiver<T>

impl<T> Send for Receiver<T>

impl<T> Stream for Receiver<T>

fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<T>>
fn size_hint(self: &Self) -> (usize, Option<usize>)

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) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses 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>