pub enum DecodeError {
UnknownVersion,
UnknownRequiredFeature,
InvalidValue,
ShortRead,
BadLengthDescriptor,
Io(ErrorKind),
UnsupportedCompression,
}
Expand description
An error in decoding a message or struct.
Variants
UnknownVersion
A version byte specified something we don’t know how to handle. Includes unknown realm byte in an OnionHopData packet
UnknownRequiredFeature
Unknown feature mandating we fail to parse message (eg TLV with an even, unknown type)
InvalidValue
Value was invalid, eg a byte which was supposed to be a bool was something other than a 0 or 1, a public key/private key/signature was invalid, text wasn’t UTF-8, TLV was syntactically incorrect, etc
ShortRead
Buffer too short
BadLengthDescriptor
A length descriptor in the packet didn’t describe the later data correctly
Io(ErrorKind)
Tuple Fields
0: ErrorKind
(C-not exported) as ErrorKind doesn’t have a reasonable mapping
Error from std::io
UnsupportedCompression
The message included zlib-compressed values, which we don’t support.
Trait Implementations
sourceimpl Clone for DecodeError
impl Clone for DecodeError
sourcefn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for DecodeError
impl Debug for DecodeError
sourceimpl Display for DecodeError
impl Display for DecodeError
sourceimpl From<Error> for DecodeError
impl From<Error> for DecodeError
sourceimpl PartialEq<DecodeError> for DecodeError
impl PartialEq<DecodeError> for DecodeError
sourcefn eq(&self, other: &DecodeError) -> bool
fn eq(&self, other: &DecodeError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &DecodeError) -> bool
fn ne(&self, other: &DecodeError) -> bool
This method tests for !=
.
impl StructuralPartialEq for DecodeError
Auto Trait Implementations
impl RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl UnwindSafe for DecodeError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more