[−][src]Enum jsonprima::ErrorType
A list of all error variants used by this module.
Variants
E100Empty JSON document.
E101Raw use of control characters in JSON string.
E103Illegal character "t" after structural token. Expected comma or colon.
E104No more graphemes to parse.
E105Invalid character in literal name.
E106Invalid literal.
E107Illegal character "f" after structural token. Expected comma or colon.
E108Illegal character "n" after structural token. Expected comma or colon.
E109Illegal number after structural token. Expected comma or colon.
E110Illegal non ASCII decimal digit character in number.
E111Numbers cannot contain leading zeros.
E112Could not parse out of range JSON number.
E113Could not parse JSON number.
E114Illegal string after structural token. Expected comma or colon.
E116E117E118Invalid Unicode grapheme in JSON string.
E119Invalid Unicode escape sequence in second surrogate pair.
E122Unexpected comma at the start of JSON document.
E123Unexpected comma after structural token.
E124Invalid use of comma after document root value.
E125Illegal begin-array after JSON value.
E126Illegal end-array. No begin-array match.
E127Unterminated array.
E128Unterminated object.
E129Illegal end-array after comma.
E130Illegal begin-object after JSON value.
E131Illegal end-object. No begin-object match.
E132Illegal end-object after comma.
E133Illegal end-array after colon.
E134Illegal end-object after colon.
E135Invalid object member. Member value does not exist.
E136Invalid use of colon.
E137Invalid use of number as object name.
E138E139Invalid use of false as object name.
E140E141Invalid object member
E142Invalid use of array as object name.
E143Invalid use of object as 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 Sync for ErrorType
impl Unpin for ErrorType
impl Send for ErrorType
impl UnwindSafe for ErrorType
impl RefUnwindSafe for ErrorType
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
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,