pub enum Error {
}
Expand description
Error when (de-)serializing.
Variants§
UnexpectedEnd
Expected more data but encountered the end of the input.
ExcessData
Excess data appeared at the end of the input.
BufferTooSmall
Buffer was too small.
Allocation
Allocation failure.
UsizeOverflow
Usize overflow.
LimitReached
Configured size limit reached.
InvalidType(u8)
Invalid data type designator encountered.
VarIntTooLarge
VarInt too large for the given expected type.
WrongType(Type, &'static [Type])
Wrong data type encountered (found, expected).
NotOneChar
String is not exactly one character.
Format(Error)
Formatting error. Happens serializing a core::fmt::Display
value and could be due to an
output writing failure.
StringNotUtf8(Utf8Error)
Parsed string is not valid UTF-8.
Io(Error)
IO error.
Custom
no-std + no-alloc: Generic error message that can be created by data structures through
the ser::Error
and de::Error
traits.
Message(String)
alloc: Generic error message that can be created by data structures through the
ser::Error
and de::Error
traits.
Trait Implementations§
source§impl Error for Error
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl Error for Error
impl Error for Error
source§fn custom<T>(msg: T) -> Selfwhere
T: Display,
fn custom<T>(msg: T) -> Selfwhere
T: Display,
source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
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
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
source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
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
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
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
Deserialize
struct type received more than one of the
same field.