pub enum JSONParsingError {
CannotParseArray,
CannotParseFloat,
CannotParseInteger,
CannotParseObject,
CannotParseString,
CannotParseBoolean,
KeyNotFound,
UnexpectedToken,
EndOfStream,
TooShortEscapeSequence,
InvalidUnicodeEscapeSequence,
InvalidEscapeSequence(char),
}
Expand description
Errors while parsing JSON
Due to the “scan once” philosophy of this crate, errors can either be returned when first
constructing a [JSONValue
] or when trying to read it using one of the accessors.
Variants§
CannotParseArray
Attempt to parse an object that is not an array as an array
CannotParseFloat
Attempt to parse an object that is not a float as a float
CannotParseInteger
Attempt to parse an object that is not an integer as an integer
CannotParseObject
Attempt to parse an object that is not an object as an object
CannotParseString
Attempt to parse an object that is not a string as an string
CannotParseBoolean
Attempt to parse an object that is not a boolean as a boolean
KeyNotFound
The key is not present in the object
UnexpectedToken
There was an unexpected token in the input stream
EndOfStream
The input stream terminated while scanning a type
TooShortEscapeSequence
Escape sequence too short (all escape sequences must be four hex digits long)
InvalidUnicodeEscapeSequence
Escape sequence doesn’t map to a character
InvalidEscapeSequence(char)
Escape pattern (\x) doesn’t make sense
Trait Implementations§
Source§impl Clone for JSONParsingError
impl Clone for JSONParsingError
Source§fn clone(&self) -> JSONParsingError
fn clone(&self) -> JSONParsingError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more