[][src]Enum jsonprima::ErrorType

pub enum ErrorType {
    E100,
    E101,
    E103,
    E104,
    E105,
    E106,
    E107,
    E108,
    E109,
    E110,
    E111,
    E112,
    E113,
    E114,
    E116,
    E117,
    E118,
    E119,
    E122,
    E123,
    E124,
    E125,
    E126,
    E127,
    E128,
    E129,
    E130,
    E131,
    E132,
    E133,
    E134,
    E135,
    E136,
    E137,
    E138,
    E139,
    E140,
    E141,
    E142,
    E143,
    E144,
}

A list of all error variants used by this module.

Variants

E100

Empty JSON document.

E101

Raw use of control characters in JSON string.

E103

Illegal character "t" after structural token. Expected comma or colon.

E104

No more graphemes to parse.

E105

Invalid character in literal name.

E106

Invalid literal.

E107

Illegal character "f" after structural token. Expected comma or colon.

E108

Illegal character "n" after structural token. Expected comma or colon.

E109

Illegal number after structural token. Expected comma or colon.

E110

Illegal non ASCII decimal digit character in number.

E111

Numbers cannot contain leading zeros.

E112

Could not parse out of range JSON number.

E113

Could not parse JSON number.

E114

Illegal string after structural token. Expected comma or colon.

E116E117E118

Invalid Unicode grapheme in JSON string.

E119

Invalid Unicode escape sequence in second surrogate pair.

E122

Unexpected comma at the start of JSON document.

E123

Unexpected comma after structural token.

E124

Invalid use of comma after document root value.

E125

Illegal begin-array after JSON value.

E126

Illegal end-array. No begin-array match.

E127

Unterminated array.

E128

Unterminated object.

E129

Illegal end-array after comma.

E130

Illegal begin-object after JSON value.

E131

Illegal end-object. No begin-object match.

E132

Illegal end-object after comma.

E133

Illegal end-array after colon.

E134

Illegal end-object after colon.

E135

Invalid object member. Member value does not exist.

E136

Invalid use of colon.

E137

Invalid use of number as object name.

E138E139

Invalid use of false as object name.

E140E141

Invalid object member

E142

Invalid use of array as object name.

E143

Invalid use of object as object name.

E144

Duplicate object name.

Methods

impl ErrorType[src]

Used to represent the various error variants in this module.

pub fn description(&self) -> &str[src]

Return the error description.

Examples

assert_eq!(jsonprima::ErrorType::E104.description(), "No more graphemes to parse.");
// Invalid `true` root value in JSON document.
let text: &str = "trua";
let errors = jsonprima::validate(&text);
let description = errors.get(0).unwrap().err.description();
assert_eq!(description, "Invalid character in literal name.");

pub fn code(&self) -> &str[src]

Return the error code.

Examples

assert_eq!(jsonprima::ErrorType::E104.code(), "E104");
// Invalid `true` root value in JSON document.
let text: &str = "trua";
let errors = jsonprima::validate(&text);
let code = errors.get(0).unwrap().err.code();
assert_eq!(code, "E105");

Trait Implementations

impl Debug for ErrorType[src]

Auto Trait Implementations

Blanket Implementations

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

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

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.

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

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

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