pub enum TrySendError<T> {
Closed(T),
Full(T),
RemoteSend(SendErrorKind),
RemoteConnect(ConnectError),
RemoteListen(ListenerError),
RemoteForward,
}Expand description
An error occurred during trying to send over an mpsc channel.
Variants§
Closed(T)
The remote end closed the channel.
Full(T)
The data could not be sent on the channel because the channel is currently full and sending would require blocking.
RemoteSend(SendErrorKind)
Sending to a remote endpoint failed.
RemoteConnect(ConnectError)
Connecting a sent channel failed.
RemoteListen(ListenerError)
Listening for a received channel failed.
RemoteForward
Forwarding at a remote endpoint to another remote endpoint failed.
Implementations§
Source§impl<T> TrySendError<T>
impl<T> TrySendError<T>
Sourcepub fn is_disconnected(&self) -> bool
pub fn is_disconnected(&self) -> bool
True, if the remote endpoint closed the channel, was dropped or the connection failed.
Sourcepub fn is_final(&self) -> bool
pub fn is_final(&self) -> bool
Returns whether the error is final, i.e. no further send operation can succeed.
Sourcepub fn is_item_specific(&self) -> bool
pub fn is_item_specific(&self) -> bool
Whether the error is caused by the item to be sent.
Trait Implementations§
Source§impl<T> Clone for TrySendError<T>where
T: Clone,
impl<T> Clone for TrySendError<T>where
T: Clone,
Source§fn clone(&self) -> TrySendError<T>
fn clone(&self) -> TrySendError<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for TrySendError<T>where
T: Debug,
impl<T> Debug for TrySendError<T>where
T: Debug,
Source§impl<'de, T> Deserialize<'de> for TrySendError<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for TrySendError<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TrySendError<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TrySendError<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> Display for TrySendError<T>
impl<T> Display for TrySendError<T>
Source§impl<T> Error for TrySendError<T>where
T: Debug,
impl<T> Error for TrySendError<T>where
T: Debug,
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl<T> From<SendError<T>> for TrySendError<T>
impl<T> From<SendError<T>> for TrySendError<T>
Source§fn from(err: SendError<T>) -> TrySendError<T>
fn from(err: SendError<T>) -> TrySendError<T>
Converts to this type from the input type.
Source§impl<T> From<TrySendError<T>> for SendError<T>
impl<T> From<TrySendError<T>> for SendError<T>
Source§fn from(err: TrySendError<T>) -> SendError<T>
fn from(err: TrySendError<T>) -> SendError<T>
Converts to this type from the input type.
Source§impl<T> SendErrorExt for TrySendError<T>
impl<T> SendErrorExt for TrySendError<T>
Source§fn is_disconnected(&self) -> bool
fn is_disconnected(&self) -> bool
Whether the remote endpoint closed the channel, was dropped or the connection failed.
Source§fn is_final(&self) -> bool
fn is_final(&self) -> bool
Whether the error is final, i.e. no further send operation can succeed.
Source§fn is_item_specific(&self) -> bool
fn is_item_specific(&self) -> bool
Whether the error is caused by the item to be sent.
Source§impl<T> Serialize for TrySendError<T>where
T: Serialize,
impl<T> Serialize for TrySendError<T>where
T: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<T, R> TryFrom<TrySendError<T>> for SendError<R>
impl<T, R> TryFrom<TrySendError<T>> for SendError<R>
Source§type Error = TrySendError<T>
type Error = TrySendError<T>
The type returned in the event of a conversion error.
Source§fn try_from(
err: TrySendError<T>,
) -> Result<SendError<R>, <SendError<R> as TryFrom<TrySendError<T>>>::Error>
fn try_from( err: TrySendError<T>, ) -> Result<SendError<R>, <SendError<R> as TryFrom<TrySendError<T>>>::Error>
Performs the conversion.
Source§impl<T> TryFrom<TrySendError<T>> for SendError<T>
impl<T> TryFrom<TrySendError<T>> for SendError<T>
Source§type Error = TrySendError<T>
type Error = TrySendError<T>
The type returned in the event of a conversion error.
Source§fn try_from(
err: TrySendError<T>,
) -> Result<SendError<T>, <SendError<T> as TryFrom<TrySendError<T>>>::Error>
fn try_from( err: TrySendError<T>, ) -> Result<SendError<T>, <SendError<T> as TryFrom<TrySendError<T>>>::Error>
Performs the conversion.
Auto Trait Implementations§
impl<T> Freeze for TrySendError<T>where
T: Freeze,
impl<T> !RefUnwindSafe for TrySendError<T>
impl<T> Send for TrySendError<T>where
T: Send,
impl<T> Sync for TrySendError<T>where
T: Sync,
impl<T> Unpin for TrySendError<T>where
T: Unpin,
impl<T> !UnwindSafe for TrySendError<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more