pub enum Error {
CorruptSegmentHeader,
CorruptMsgHeader,
InsufficientLength(usize),
IoError(ErrorKind),
}Expand description
represents errors that can be encountered during the usage of of reader and writer.
Variants§
CorruptSegmentHeader
indicates corruption when initializing the reader. This can only happens in a file.
CorruptMsgHeader
indicates corruption when reading a message. This can only happens in a file.
InsufficientLength(usize)
indicates possibily a curruption. usize means the number of bytes it need in addition to
what is already in there. This can only happens in a file.
IoError(ErrorKind)
indicates there is an IO error happening during reading or writing. This can happen in all transport types.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
impl Copy for Error
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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