pub struct SendError<T>(pub T);
Expand description
An error returned from the Sender::send
or SyncSender::send
function on channels.
A send operation can only fail if the receiving end of a channel is disconnected, implying that the data could never be received. The error contains the data being sent as a payload so it can be recovered.
Tuple Fields
0: T
Trait Implementations
sourceimpl<T> Error for SendError<T> where
T: Send,
impl<T> Error for SendError<T> where
T: Send,
sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
use the Display impl or to_string()
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.24.0 · sourceimpl<T> From<SendError<T>> for TrySendError<T>
impl<T> From<SendError<T>> for TrySendError<T>
sourcepub fn from(err: SendError<T>) -> TrySendError<T>
pub fn from(err: SendError<T>) -> TrySendError<T>
Converts a SendError<T>
into a TrySendError<T>
.
This conversion always returns a TrySendError::Disconnected
containing the data in the SendError<T>
.
No data is allocated on the heap.
impl<T> Copy for SendError<T> where
T: Copy,
impl<T> Eq for SendError<T> where
T: Eq,
impl<T> StructuralEq for SendError<T>
impl<T> StructuralPartialEq for SendError<T>
Auto Trait Implementations
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> UnwindSafe for SendError<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more