pub enum PeerError {
Send,
Read(Error),
Parse(Error),
UnexpectedMessage,
MessageTooBig,
MagicBitsMismatch,
TooManyMessages,
PingTimeout,
Channel,
Transport(TransportError),
}Expand description
Enum for diverse variants of errors when dealing with a Peer
Variants§
Send
Error while sending data to a peer
Read(Error)
Error while reading data from a peer
Parse(Error)
Error while parsing message
UnexpectedMessage
Peer sent us a message that we aren’t expecting
MessageTooBig
Peer sent us a message that is too big
MagicBitsMismatch
Peer sent us a message with the wrong magic bits
TooManyMessages
Peer sent us too many messages in a short period of time
PingTimeout
Peer timed out a ping message
Channel
Channel error
Transport(TransportError)
Transport error
Trait Implementations§
Source§impl From<SendError<ReaderMessage>> for PeerError
impl From<SendError<ReaderMessage>> for PeerError
Source§fn from(_: SendError<ReaderMessage>) -> Self
fn from(_: SendError<ReaderMessage>) -> Self
Converts to this type from the input type.
Source§impl From<TransportError> for PeerError
impl From<TransportError> for PeerError
Source§fn from(e: TransportError) -> Self
fn from(e: TransportError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PeerError
impl !RefUnwindSafe for PeerError
impl Send for PeerError
impl Sync for PeerError
impl Unpin for PeerError
impl !UnwindSafe for PeerError
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