pub enum JsonErrorKind {
Show 14 variants
Scan(ScanErrorKind),
ScanWithContext {
error: ScanErrorKind,
expected_type: &'static str,
},
UnexpectedToken {
got: String,
expected: &'static str,
},
UnexpectedEof {
expected: &'static str,
},
TypeMismatch {
expected: &'static str,
got: &'static str,
},
UnknownField {
field: String,
expected: Vec<&'static str>,
suggestion: Option<&'static str>,
},
MissingField {
field: &'static str,
object_start: Option<Span>,
object_end: Option<Span>,
},
InvalidValue {
message: String,
},
Reflect(ReflectError),
NumberOutOfRange {
value: String,
target_type: &'static str,
},
DuplicateKey {
key: String,
},
InvalidUtf8,
Solver(String),
Io(String),
}Expand description
Specific error kinds for JSON deserialization
Variants§
Scan(ScanErrorKind)
Scanner/adapter error
ScanWithContext
Scanner error with type context (what type was being parsed)
Fields
§
error: ScanErrorKindThe underlying scan error
UnexpectedToken
Unexpected token
UnexpectedEof
Unexpected end of input
TypeMismatch
Type mismatch
UnknownField
Unknown field in struct
Fields
MissingField
Missing required field
Fields
InvalidValue
Invalid value for type
Reflect(ReflectError)
Reflection error from facet-reflect
NumberOutOfRange
Number out of range
Fields
DuplicateKey
Duplicate key in object
InvalidUtf8
Invalid UTF-8 in string
Solver(String)
Solver error (for flattened types)
Io(String)
I/O error (for streaming deserialization)
Implementations§
Trait Implementations§
Source§impl Debug for JsonErrorKind
impl Debug for JsonErrorKind
Auto Trait Implementations§
impl Freeze for JsonErrorKind
impl RefUnwindSafe for JsonErrorKind
impl Send for JsonErrorKind
impl Sync for JsonErrorKind
impl Unpin for JsonErrorKind
impl UnwindSafe for JsonErrorKind
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