#[non_exhaustive]pub enum ChannelError {
Io(String),
Closed,
NoReceiver,
NoReply,
NotSupported(String),
}Expand description
The reason a message channel failed.
When each variant is triggered:
ChannelError::Io— underlying read/write failure (e.g. a terminal IO error);ChannelError::Closed— the channel is closed: the peer has been dropped, or input ended (e.g. Ctrl-D in a terminal); after it closes, every subsequent call on the channel returns the same error;ChannelError::NoReply—IncomingMessage::replywas called on a notification message that does not expect a reply;ChannelError::NotSupported— the current implementation does not support this operation (broadcast / watch don’t supportask).
The enum is #[non_exhaustive] (reserved for extension): matches must include a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Io(String)
Underlying IO failure (reading or writing the channel failed).
Closed
Input has been closed (e.g. user pressed Ctrl-D); no reply is available.
NoReceiver
There are currently no receivers on the channel (e.g. notify on a watch channel with no subscribers).
The channel itself is not closed: subscribing again restores operation.
NoReply
reply was called on a message (a notification) that has no reply channel.
NotSupported(String)
This channel implementation does not support the operation (e.g. broadcast / watch don’t support ask).
Trait Implementations§
Source§impl Clone for ChannelError
impl Clone for ChannelError
Source§impl Debug for ChannelError
impl Debug for ChannelError
Source§impl Display for ChannelError
impl Display for ChannelError
Source§impl Error for ChannelError
impl Error for ChannelError
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 From<Error> for ChannelError
impl From<Error> for ChannelError
Source§impl PartialEq for ChannelError
impl PartialEq for ChannelError
impl StructuralPartialEq for ChannelError
Auto Trait Implementations§
impl Freeze for ChannelError
impl RefUnwindSafe for ChannelError
impl Send for ChannelError
impl Sync for ChannelError
impl Unpin for ChannelError
impl UnsafeUnpin for ChannelError
impl UnwindSafe for ChannelError
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