Enum ParserErrorDetails

Source
pub enum ParserErrorDetails {
Show 17 variants InvalidFile, ZeroLengthInput, EndOfInput, StreamFailure, NonUtf8InputDetected, UnexpectedToken(String), ValueExpected, PairExpected, InvalidRootObject, InvalidObject, InvalidArray, InvalidCharacter(char), MatchFailed(String, String), InvalidNumericRepresentation(String), InvalidEscapeSequence(String), InvalidUnicodeEscapeSequence(String), LexerError(String),
}
Expand description

A global enumeration of error codes

Variants§

§

InvalidFile

An invalid file has been specified. It might not exist, or might not be accessible

§

ZeroLengthInput

We can’t parse nothing.

§

EndOfInput

End of input has been reached. This is used as a stopping condition at various points.

§

StreamFailure

If pulling bytes from an underlying stream (or [BufRead]) of some description, and an error occurs, this will be returned.

§

NonUtf8InputDetected

Dodgy UTF8 has been found in the input.

§

UnexpectedToken(String)

Edge case error condition. This means that something has gone horribly wrong with the parse.

§

ValueExpected

An array value is expected but not detected

§

PairExpected

KV pair is expected but not detected.

§

InvalidRootObject

Supplied JSON doesn’t have an object or array as a root object.

§

InvalidObject

The parse of an object has failed.

§

InvalidArray

The parse of an array has failed.

§

InvalidCharacter(char)

An invalid character has been detected within the input.

§

MatchFailed(String, String)

Whilst looking for a literal string token (null, true, false) a match couldn’t be found

§

InvalidNumericRepresentation(String)

A number has been found with an incorrect string representation.

§

InvalidEscapeSequence(String)

An invalid escape sequence has been found within the input.

§

InvalidUnicodeEscapeSequence(String)

An invalid unicode escape sequence (\uXXX) has been found within the input.

§

LexerError(String)

A bubbled error from the lexical analysis backend

Trait Implementations§

Source§

impl Clone for ParserErrorDetails

Source§

fn clone(&self) -> ParserErrorDetails

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParserErrorDetails

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for ParserErrorDetails

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ParserErrorDetails

Source§

fn eq(&self, other: &ParserErrorDetails) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ParserErrorDetails

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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>,

Source§

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.