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 Error + Send + Sync + 'static>),
}
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 Error + Send + Sync + 'static>)
A custom error.
Trait Implementations§
Source§impl Error for ErrorKind
impl Error for ErrorKind
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<DecodeError> for ErrorKind
impl From<DecodeError> for ErrorKind
Source§fn from(source: DecodeError) -> Self
fn from(source: 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