pub enum Error {
InvalidMarkerRead(Error),
InvalidDataRead(Error),
TypeMismatch(Marker),
OutOfRange,
LengthMismatch(u32),
Uncategorized(String),
Syntax(String),
Utf8Error(Utf8Error),
DepthLimitExceeded,
}
Expand description
Enum representing errors that can occur while decoding MessagePack data.
Variants§
InvalidMarkerRead(Error)
The enclosed I/O error occurred while trying to read a MessagePack marker.
InvalidDataRead(Error)
The enclosed I/O error occurred while trying to read the encoded MessagePack data.
TypeMismatch(Marker)
A mismatch occurred between the decoded and expected value types.
OutOfRange
A numeric cast failed due to an out-of-range error.
LengthMismatch(u32)
A decoded array did not have the enclosed expected length.
Uncategorized(String)
An otherwise uncategorized error occurred. See the enclosed String
for
details.
Syntax(String)
A general error occurred while deserializing the expected type. See the
enclosed String
for details.
Utf8Error(Utf8Error)
An encoded string could not be parsed as UTF-8.
DepthLimitExceeded
The depth limit was exceeded.
Trait Implementations§
source§impl Error for Error
impl Error for Error
source§fn custom<T: Display>(msg: T) -> Self
fn custom<T: Display>(msg: T) -> Self
Raised when there is general error when deserializing a type. Read more
source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Raised when a
Deserialize
receives a type different from what it was
expecting. Read moresource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Raised when a
Deserialize
receives a value of the right type but that
is wrong for some other reason. Read moresource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
Raised when deserializing a sequence or map and the input data contains
too many or too few elements. Read more
source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Raised when a
Deserialize
enum type received a variant with an
unrecognized name.source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Raised when a
Deserialize
struct type received a field with an
unrecognized name.source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
Raised when a
Deserialize
struct type expected to receive a required
field with a particular name but that field was not present in the
input.source§fn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Raised when a
Deserialize
struct type received more than one of the
same field.source§impl Error for Error
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<'a> From<DecodeStringError<'a>> for Error
impl<'a> From<DecodeStringError<'a>> for Error
source§fn from(err: DecodeStringError<'_>) -> Error
fn from(err: DecodeStringError<'_>) -> Error
Converts to this type from the input type.
source§impl From<MarkerReadError> for Error
impl From<MarkerReadError> for Error
source§fn from(err: MarkerReadError) -> Error
fn from(err: MarkerReadError) -> Error
Converts to this type from the input type.
source§impl From<NumValueReadError> for Error
impl From<NumValueReadError> for Error
source§fn from(err: NumValueReadError) -> Error
fn from(err: NumValueReadError) -> Error
Converts to this type from the input type.
source§impl From<TryFromIntError> for Error
impl From<TryFromIntError> for Error
source§fn from(_: TryFromIntError) -> Self
fn from(_: TryFromIntError) -> Self
Converts to this type from the input type.
source§impl From<ValueReadError> for Error
impl From<ValueReadError> for Error
source§fn from(err: ValueReadError) -> Error
fn from(err: ValueReadError) -> Error
Converts to this type from the input type.
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