Enum adventjson::JsonError[][src]

pub enum JsonError {
    Empty,
    InvalidChar(charusize),
    UnterminatedString,
    EndedOnEscape,
    UnknownEscapeSequence(char),
    NonStringAsKey,
    InvalidCodepoint,
    InvalidNumber,
}

An error that occured while parsing a json file

The reading functions work recursive, that means major errors might end up in the wrong category, for example mismatched parantheses result in an Empty error:

 assert_eq!(JsonObject::read("[[[]]"), Err(Empty));

Variants

Empty

The input was empty (or only whitespace)

InvalidChar(charusize)

At the given position the given character was read invalidly

UnterminatedString

A string with no closing quote

EndedOnEscape

The input ended on a backslash

UnknownEscapeSequence(char)

An unknown escape sequence was encountered (currently know are ‘\’, ‘"’, and ‘'’)

NonStringAsKey

A not string was used as key in an JsonObject::Obj

InvalidCodepoint

Per ‘\uXXXX’ was an invalid code point specified

InvalidNumber

A number that is invalid in json, but is a perfectly fine floating-point number.

Trait Implementations

impl Clone for JsonError[src]

impl Copy for JsonError[src]

impl Debug for JsonError[src]

impl Eq for JsonError[src]

impl Hash for JsonError[src]

impl PartialEq<JsonError> for JsonError[src]

impl StructuralEq for JsonError[src]

impl StructuralPartialEq for JsonError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.