#[non_exhaustive]pub enum ErrorKind<DelegateError = Infallible> {
Show 25 variants
Utf8,
UnexpectedEof,
ExpectedObjectKey,
ExpectedColon,
ExpectedValue,
ExpectedCommaOrEndOfObject,
ExpectedCommaOrEndOfArray,
IllegalTrailingComma,
Unexpected(u8),
TrailingNonWhitespace,
ObjectKeysMustBeStrings,
ExpectedExponent,
ExpectedDecimalDigit,
ExpectedDigit,
InvalidHexadecimal,
InvalidEscape,
UnclosedObject,
UnclosedArray,
UnclosedString,
ExpectedString,
ExpectedNumber,
RecursionLimitReached,
PayloadsShouldBeObjectOrArray,
PaylodTooLarge,
ErrorFromDelegate(DelegateError),
}
Expand description
An error from parsing JSON.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Utf8
An invalid UTF-8 sequence was encountered.
UnexpectedEof
An end-of-file was encountered when it wasn’t expected.
ExpectedObjectKey
While parsing an object, something was encountered that was not a valid object key.
ExpectedColon
While parsing an object, a colon was expected after an object’s key.
ExpectedValue
A Value
was expected.
ExpectedCommaOrEndOfObject
While parsing an object, either the end of an object (}
) or a comma
was expected.
ExpectedCommaOrEndOfArray
While parsing an array, either the end of an array (]
) or a comma was
expected.
IllegalTrailingComma
When parsing an object or an array, a trailing comma was detected. The JSON specification disallows trailing commas.
Unexpected(u8)
An unexpected character was encountered while parsing a
Value
.
TrailingNonWhitespace
The source being parsed contained additional non-whitespace data after a
Value
was parsed.
ObjectKeysMustBeStrings
A non-string was encountered for an object key. The JSON standard requires all keys to be strings.
ExpectedExponent
An exponent was expected on a floating point number.
ExpectedDecimalDigit
At least one decimal digit was expected on a floating point number.
ExpectedDigit
At least one integer digit was expected on a floating point number.
InvalidHexadecimal
An invalid hexadecimal character was encountered in a unicode escape sequence in a string.
InvalidEscape
An invalid character was escaped.
UnclosedObject
An object is missing its end (}
).
UnclosedArray
An array is missing its end (]
).
UnclosedString
A string is missing its end ("
).
ExpectedString
A string was expected, but another type was found.
ExpectedNumber
A number was expected, but another type was found.
RecursionLimitReached
The JSON being parsed has more depth than the parser was configured to allow.
PayloadsShouldBeObjectOrArray
A value that wasn’t an object or array was contained in a JSON payload.
This error is only returned when the allow_all_types_at_root
configuration is set to false
.
PaylodTooLarge
A GenericDocument
being parsed was too
large to fit in the collection provided.
ErrorFromDelegate(DelegateError)
An error was returned from a
ParseDelegate
.
Trait Implementations§
source§impl<DelegateError> Error for ErrorKind<DelegateError>
Available on crate feature std
only.
impl<DelegateError> Error for ErrorKind<DelegateError>
std
only.