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 occured while trying to read a MessagePack marker.
InvalidDataRead(Error)
The enclosed I/O error occured while trying to read the encoded MessagePack data.
TypeMismatch(Marker)
A mismatch occured 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 occured. See the enclosed String
for
details.
Syntax(String)
A general error occured 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; not currently used.
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
Source§impl Error for Error
impl Error for Error
Source§fn custom<T>(msg: T) -> Errorwhere
T: Display,
fn custom<T>(msg: T) -> Errorwhere
T: Display,
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<'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<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
§impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
Convert
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self
to an expression for Diesel’s query builder. Read more