Struct SendError

pub struct SendError<T>(pub T);

An error returned from the send method.

The message could not be sent because the channel is disconnected.

The error contains the message so it can be recovered.

Fields

0: T

Implementations

impl<T> SendError<T>

fn into_inner(self) -> T

Unwraps the message.

Examples

use crossbeam_channel::unbounded;

let (s, r) = unbounded();
drop(r);

if let Err(err) = s.send("foo") {
    assert_eq!(err.into_inner(), "foo");
}

Trait Implementations

impl<T> Debug for SendError<T>

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

impl<T> Display for SendError<T>

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

impl<T: Clone> Clone for SendError<T>

fn clone(&self) -> SendError<T>

impl<T: Copy> Copy for SendError<T>

impl<T: Eq> Eq for SendError<T>

impl<T: PartialEq> PartialEq for SendError<T>

fn eq(&self, other: &SendError<T>) -> bool

impl<T: PartialEq> StructuralPartialEq for SendError<T>

impl<T: Send> Error for SendError<T>

Auto Trait Implementations

impl<T> Freeze for SendError<T> where T: Freeze,

impl<T> RefUnwindSafe for SendError<T> where T: RefUnwindSafe,

impl<T> Send for SendError<T> where T: Send,

impl<T> Sync for SendError<T> where T: Sync,

impl<T> Unpin for SendError<T> where T: Unpin,

impl<T> UnsafeUnpin for SendError<T> where T: UnsafeUnpin,

impl<T> UnwindSafe for SendError<T> where T: UnwindSafe,

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> CloneToUninit for SendError<T> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for SendError<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for SendError<T> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn to_string(&self) -> String

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

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

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

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