#[non_exhaustive]pub enum JsonErrorKind {
Show 13 variants
UnexpectedEof,
UnexpectedByte,
InvalidUtf8,
InvalidEscape,
InvalidUnicodeEscape,
LoneSurrogate,
UnescapedControlCharacter,
InvalidNumber,
DuplicateKey,
TrailingData,
LimitExceeded(JsonLimitKind),
WriteFailure,
NonFiniteNumber,
}Expand description
The category of a parse or serialization failure.
This is a stable, machine-readable classification: match on it for
programmatic handling rather than on Display text.
#[non_exhaustive]: new kinds may be added in a future release, so match
with a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnexpectedEof
Input ended before a complete value was parsed.
UnexpectedByte
A byte was found that is not valid at this position.
InvalidUtf8
The input was not valid UTF-8 (including a leading byte-order mark).
InvalidEscape
An invalid string escape such as \x.
InvalidUnicodeEscape
A malformed \uXXXX escape.
LoneSurrogate
An unpaired UTF-16 surrogate escape.
UnescapedControlCharacter
A raw control character (U+0000..=U+001F) inside a string.
InvalidNumber
A number that does not match the strict JSON grammar.
DuplicateKey
A duplicate object member name.
TrailingData
Non-whitespace bytes after the top-level value.
LimitExceeded(JsonLimitKind)
A configured JsonLimits value was exceeded.
WriteFailure
The output sink failed to accept bytes (serialization).
NonFiniteNumber
A number could not be represented as a finite IEEE-754 f64 during
canonical serialization (e.g. a magnitude that overflows to infinity).
Trait Implementations§
Source§impl Clone for JsonErrorKind
impl Clone for JsonErrorKind
Source§fn clone(&self) -> JsonErrorKind
fn clone(&self) -> JsonErrorKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JsonErrorKind
impl Debug for JsonErrorKind
impl Eq for JsonErrorKind
Source§impl PartialEq for JsonErrorKind
impl PartialEq for JsonErrorKind
Source§fn eq(&self, other: &JsonErrorKind) -> bool
fn eq(&self, other: &JsonErrorKind) -> bool
self and other values to be equal, and is used by ==.