Struct Receiver

pub struct Receiver { /* private fields */ }

Receiver of the simplex channel.

Cancellation safety

The Receiver is cancel safe. If it is used as the event in a tokio::select! statement and some other branch completes first, it is guaranteed that no bytes were received on this channel.

You can still read the remaining data from the buffer even if the write half has been dropped. See Sender::poll_shutdown and Sender::drop for more details.

Trait Implementations

impl AsyncRead for Receiver

fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll<Result<(), Error>>

impl Debug for Receiver

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

impl Drop for Receiver

fn drop(&mut self)

This also wakes up the Sender.

Auto Trait Implementations

impl Freeze for Receiver

impl RefUnwindSafe for Receiver

impl Send for Receiver

impl Sync for Receiver

impl Unpin for Receiver

impl UnsafeUnpin for Receiver

impl UnwindSafe for Receiver

Blanket Implementations

impl<R> AsyncReadExt for Receiver where R: AsyncRead + ?Sized,

impl<T> Any for Receiver where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Receiver where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Receiver where T: ?Sized,

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

impl<T> From<T> for Receiver

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for Receiver where U: From<T>,

fn into(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<U> for Receiver where U: Into<T>,

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

impl<T, U> TryInto<U> for Receiver where U: TryFrom<T>,

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