Enum adventjson::JsonError [−][src]
pub enum JsonError { Empty, InvalidChar(char, usize), UnterminatedString, EndedOnEscape, UnknownEscapeSequence(char), NonStringAsKey, InvalidCodepoint, InvalidNumber, }
Expand description
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
The input was empty (or only whitespace)
At the given position the given character was read invalidly
A string with no closing quote
The input ended on a backslash
UnknownEscapeSequence(char)
An unknown escape sequence was encountered
A not string was used as key in an JsonObject::Obj
Per ‘\uXXXX’ was an invalid code point specified
A number that is invalid in json, but is a perfectly fine floating-point number.
Trait Implementations
impl Error for JsonError
[src]
impl Error for JsonError
[src]fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]The lower-level source of this error, if any. Read more
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
fn description(&self) -> &str
1.0.0[src]
fn description(&self) -> &str
1.0.0[src]use the Display impl or to_string()
impl Copy for JsonError
[src]
impl Eq for JsonError
[src]
impl StructuralEq for JsonError
[src]
impl StructuralPartialEq for JsonError
[src]
Auto Trait Implementations
impl RefUnwindSafe for JsonError
impl Send for JsonError
impl Sync for JsonError
impl Unpin for JsonError
impl UnwindSafe for JsonError
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more