pub enum ProtocolError {
InvalidData(InvalidData),
NotEnoughData(NotEnoughData),
CompatibilityError(CompatibilityError),
TooMuchData(usize),
CodecError(Error),
}
Expand description
Encapsulating error for the different de-/encoding problems
Variants§
InvalidData(InvalidData)
Data that could not be interpreted
NotEnoughData(NotEnoughData)
Clearly not enough data was present
CompatibilityError(CompatibilityError)
If we have a protocol compatibility issue
TooMuchData(usize)
To much data was received to make sense
CodecError(Error)
An io error from the underlying codec implementation
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
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<CompatibilityError> for ProtocolError
impl From<CompatibilityError> for ProtocolError
Source§fn from(source: CompatibilityError) -> Self
fn from(source: CompatibilityError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for ProtocolError
impl From<Error> for ProtocolError
Source§impl From<InvalidData> for ProtocolError
impl From<InvalidData> for ProtocolError
Source§fn from(source: InvalidData) -> Self
fn from(source: InvalidData) -> Self
Converts to this type from the input type.
Source§impl From<NotEnoughData> for ProtocolError
impl From<NotEnoughData> for ProtocolError
Source§fn from(source: NotEnoughData) -> Self
fn from(source: NotEnoughData) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ProtocolError
impl !RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl !UnwindSafe for ProtocolError
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more