Enum jiter::JsonErrorType
source · pub enum JsonErrorType {
Show 22 variants
FloatExpectingInt,
DuplicateKey(String),
EofWhileParsingList,
EofWhileParsingObject,
EofWhileParsingString,
EofWhileParsingValue,
ExpectedColon,
ExpectedListCommaOrEnd,
ExpectedObjectCommaOrEnd,
ExpectedSomeIdent,
ExpectedSomeValue,
InvalidEscape,
InvalidNumber,
NumberOutOfRange,
InvalidUnicodeCodePoint,
ControlCharacterWhileParsingString,
KeyMustBeAString,
LoneLeadingSurrogateInHexEscape,
TrailingComma,
TrailingCharacters,
UnexpectedEndOfHexEscape,
RecursionLimitExceeded,
}
Expand description
Enum representing all possible errors in JSON syntax.
Almost all of JsonErrorType
is copied from serde_json so errors match
those expected from serde_json
.
Variants§
FloatExpectingInt
float value was found where an int was expected
DuplicateKey(String)
duplicate keys in an object
EofWhileParsingList
NOTE: all errors from here on are copied from serde_json
src/error.rs
with Io
and Message
removed
EOF while parsing a list.
EofWhileParsingObject
EOF while parsing an object.
EofWhileParsingString
EOF while parsing a string.
EofWhileParsingValue
EOF while parsing a JSON value.
ExpectedColon
Expected this character to be a ':'
.
ExpectedListCommaOrEnd
Expected this character to be either a ','
or a ']'
.
ExpectedObjectCommaOrEnd
Expected this character to be either a ','
or a '}'
.
ExpectedSomeIdent
Expected to parse either a true
, false
, or a null
.
ExpectedSomeValue
Expected this character to start a JSON value.
InvalidEscape
Invalid hex escape code.
InvalidNumber
Invalid number.
NumberOutOfRange
Number is bigger than the maximum value of its type.
InvalidUnicodeCodePoint
Invalid unicode code point.
ControlCharacterWhileParsingString
Control character found while parsing a string.
KeyMustBeAString
Object key is not a string.
LoneLeadingSurrogateInHexEscape
Lone leading surrogate in hex escape.
TrailingComma
JSON has a comma after the last value in an array or map.
TrailingCharacters
JSON has non-whitespace trailing characters after the value.
UnexpectedEndOfHexEscape
Unexpected end of hex escape.
RecursionLimitExceeded
Encountered nesting of JSON maps and arrays more than 128 layers deep.
Trait Implementations§
source§impl Clone for JsonErrorType
impl Clone for JsonErrorType
source§fn clone(&self) -> JsonErrorType
fn clone(&self) -> JsonErrorType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for JsonErrorType
impl Debug for JsonErrorType
source§impl Display for JsonErrorType
impl Display for JsonErrorType
source§impl PartialEq for JsonErrorType
impl PartialEq for JsonErrorType
source§fn eq(&self, other: &JsonErrorType) -> bool
fn eq(&self, other: &JsonErrorType) -> bool
self
and other
values to be equal, and is used
by ==
.