[−][src]Enum jsonprima::ErrorType
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.
E116
E117
E118
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.
E138
E139
Invalid use of false as object name.
E140
E141
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
Auto Trait Implementations
impl Unpin for ErrorType
impl Sync for ErrorType
impl Send for ErrorType
impl UnwindSafe for ErrorType
impl RefUnwindSafe for ErrorType
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,