pub enum ErrorKind {
VisitorDecodeError(DecodeError),
NumberOutOfRange {
value: String,
},
CannotFindVariant {
got: String,
expected: Vec<&'static str>,
},
WrongLength {
actual_len: usize,
expected_len: usize,
},
CannotFindField {
name: String,
},
Custom(Box<dyn CustomError>),
}
Expand description
The underlying nature of the error.
Variants§
VisitorDecodeError(DecodeError)
Something went wrong decoding the bytes based on the type and type registry provided.
NumberOutOfRange
We cannot decode the number seen into the target type; it’s out of range.
CannotFindVariant
We cannot find the variant we’re trying to decode from in the target type.
Fields
WrongLength
The types line up, but the expected length of the target type is different from the length of the input value.
Fields
CannotFindField
Cannot find a field that we need to decode to our target type
Custom(Box<dyn CustomError>)
A custom error.
Trait Implementations§
source§impl From<Box<dyn CustomError>> for ErrorKind
impl From<Box<dyn CustomError>> for ErrorKind
source§fn from(value: Box<dyn CustomError>) -> Self
fn from(value: Box<dyn CustomError>) -> Self
Converts to this type from the input type.
source§impl From<DecodeError> for ErrorKind
impl From<DecodeError> for ErrorKind
source§fn from(value: DecodeError) -> Self
fn from(value: DecodeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ErrorKind
impl !RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl !UnwindSafe for ErrorKind
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