Struct UnboundedReceiver

struct UnboundedReceiver<T> { ... }

The receiving end of an unbounded mpsc channel.

This value is created by the unbounded function.

Implementations

impl<T> UnboundedReceiver<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 UnboundedReceiver<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 UnboundedReceiver<T>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for UnboundedReceiver<T>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for UnboundedReceiver<T>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> Debug for UnboundedReceiver<T>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<T> Drop for UnboundedReceiver<T>

fn drop(self: &mut Self)

impl<T> Freeze for UnboundedReceiver<T>

impl<T> From for UnboundedReceiver<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> FusedStream for UnboundedReceiver<T>

fn is_terminated(self: &Self) -> bool

impl<T> RefUnwindSafe for UnboundedReceiver<T>

impl<T> Send for UnboundedReceiver<T>

impl<T> Stream for UnboundedReceiver<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 UnboundedReceiver<T>

impl<T> Unpin for UnboundedReceiver<T>

impl<T> UnsafeUnpin for UnboundedReceiver<T>

impl<T> UnwindSafe for UnboundedReceiver<T>

impl<T, U> Into for UnboundedReceiver<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 UnboundedReceiver<T>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for UnboundedReceiver<T>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>