Enum TryRecvError

pub enum TryRecvError<T>

An error returned from the try_recv method.

See the documentation for try_recv for more information on how to use this error.

Variants

Empty(Receiver<T>)

The Sender has not sent a message yet, but it might in the future (as it has not yet disconnected). This variant contains the Receiver that try_recv took ownership over.

Disconnected

The corresponding Sender half of this channel has become disconnected, and there will never be any more data sent over the channel.

Trait Implementations

impl<T> Debug for TryRecvError<T>

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

impl<T> Display for TryRecvError<T>

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

impl<T> Error for TryRecvError<T>

impl<T> From<RecvError> for TryRecvError<T>

fn from(err: RecvError) -> TryRecvError<T>

Converts a RecvError into a TryRecvError.

This conversion always returns TryRecvError::Disconnected.

No data is allocated on the heap.

Auto Trait Implementations

impl<T> Freeze for TryRecvError<T> where Receiver<T>: Freeze,

impl<T> RefUnwindSafe for TryRecvError<T> where Receiver<T>: RefUnwindSafe,

impl<T> Send for TryRecvError<T> where Receiver<T>: Send,

impl<T> Sync for TryRecvError<T> where Receiver<T>: Sync,

impl<T> Unpin for TryRecvError<T> where Receiver<T>: Unpin,

impl<T> UnsafeUnpin for TryRecvError<T> where Receiver<T>: UnsafeUnpin,

impl<T> UnwindSafe for TryRecvError<T> where Receiver<T>: UnwindSafe,

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for TryRecvError<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for TryRecvError<T> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for TryRecvError<T>

impl<T> ToString for TryRecvError<T> where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for TryRecvError<T> 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 TryRecvError<T> where U: Into<T>,

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

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

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