Enum ser_write_json::de::Error
source · #[non_exhaustive]pub enum Error {
Show 27 variants
UnexpectedEof,
InvalidEscapeSequence,
StringControlChar,
ExpectedColon,
ExpectedArrayCommaOrEnd,
LeadingArrayComma,
TrailingArrayComma,
ExpectedObjectCommaOrEnd,
LeadingObjectComma,
TrailingObjectComma,
ExpectedToken,
ExpectedNull,
ExpectedString,
ExpectedArrayEnd,
ExpectedArray,
ExpectedObject,
ExpectedStruct,
ExpectedEnumValue,
ExpectedEnumObjectEnd,
InvalidNumber,
InvalidType,
InvalidUnicodeCodePoint,
KeyMustBeAString,
TrailingCharacters,
UnexpectedChar,
InvalidLength,
DeserializeError(String),
}Expand description
Deserialization error
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnexpectedEof
EOF while parsing
InvalidEscapeSequence
Invalid JSON string escape sequence
StringControlChar
A control ASCII character detected in a JSON input
ExpectedColon
Expected this character to be a ':'.
ExpectedArrayCommaOrEnd
Expected this character to be either a ',' or a ']'.
LeadingArrayComma
Array content starts with a leading ,.
TrailingArrayComma
Array content ends with a trailing ,.
ExpectedObjectCommaOrEnd
Expected this character to be either a ',' or a '}'.
LeadingObjectComma
Object content starts with a leading ,.
TrailingObjectComma
Object content ends with a trailing ,.
ExpectedToken
Expected to parse either a true, false, or a null.
ExpectedNull
Expected null
ExpectedString
Expected " character
ExpectedArrayEnd
Expected ‘]’
ExpectedArray
Expected array
ExpectedObject
Expected object
ExpectedStruct
Expected object or array
ExpectedEnumValue
Expected this character to start an enum variant.
ExpectedEnumObjectEnd
Expected this character to be '}'.
InvalidNumber
Invalid number
InvalidType
Invalid type
InvalidUnicodeCodePoint
Invalid unicode code point
KeyMustBeAString
Object key is not a string
TrailingCharacters
JSON has non-whitespace trailing characters after the value
UnexpectedChar
Unexpected character
InvalidLength
Invalid length
DeserializeError(String)
std or alloc only.An error passed down from a serde::de::Deserialize implementation
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
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.