Enum serde_json::error::ErrorCode

source ·
pub(crate) enum ErrorCode {
Show 25 variants Message(Box<str>), Io(Error), EofWhileParsingList, EofWhileParsingObject, EofWhileParsingString, EofWhileParsingValue, ExpectedColon, ExpectedListCommaOrEnd, ExpectedObjectCommaOrEnd, ExpectedSomeIdent, ExpectedSomeValue, ExpectedDoubleQuote, InvalidEscape, InvalidNumber, NumberOutOfRange, InvalidUnicodeCodePoint, ControlCharacterWhileParsingString, KeyMustBeAString, ExpectedNumericKey, FloatKeyMustBeFinite, LoneLeadingSurrogateInHexEscape, TrailingComma, TrailingCharacters, UnexpectedEndOfHexEscape, RecursionLimitExceeded,
}

Variants§

§

Message(Box<str>)

Catchall for syntax error messages

§

Io(Error)

Some I/O error occurred while serializing or deserializing.

§

EofWhileParsingList

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.

§

ExpectedDoubleQuote

Expected this character to be a ".

§

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.

§

ExpectedNumericKey

Contents of key were supposed to be a number.

§

FloatKeyMustBeFinite

Object key is a non-finite float value.

§

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 Display for ErrorCode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.