pub enum JsonError {
Show 13 variants
UnexpectedEnd,
UnexpectedChar(char, usize),
ExpectedChar(char, usize),
ExpectedToken(&'static str, usize),
InvalidNumber(usize),
InvalidEscape(usize),
InvalidUnicode(usize),
InvalidUtf8,
MissingField(String),
UnknownVariant(String),
TypeMismatch {
expected: &'static str,
found: &'static str,
position: usize,
},
NestingTooDeep(usize),
Custom(String),
}Expand description
Errors that can occur during JSON parsing or serialization
Variants§
UnexpectedEnd
Unexpected end of input
UnexpectedChar(char, usize)
Unexpected character encountered
ExpectedChar(char, usize)
Expected a specific character
ExpectedToken(&'static str, usize)
Expected a specific token
InvalidNumber(usize)
Invalid number format
InvalidEscape(usize)
Invalid escape sequence
InvalidUnicode(usize)
Invalid Unicode escape
InvalidUtf8
Invalid UTF-8 encoding
MissingField(String)
Missing required field during deserialization
UnknownVariant(String)
Unknown enum variant
TypeMismatch
Type mismatch during deserialization
NestingTooDeep(usize)
Nesting too deep
Custom(String)
Custom error message
Trait Implementations§
Source§impl Error for JsonError
impl Error for JsonError
1.30.0 · 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()
impl StructuralPartialEq for JsonError
Auto Trait Implementations§
impl Freeze for JsonError
impl RefUnwindSafe for JsonError
impl Send for JsonError
impl Sync for JsonError
impl Unpin for JsonError
impl UnsafeUnpin for JsonError
impl UnwindSafe for JsonError
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