pub enum JsonParseError {
UnexpectedToken(Option<JsonToken>, String),
ExpectedColon(Option<JsonToken>, String),
ExpectedMoreInput(JsonInputType),
ParserStackTooSmall,
SerdeJsonError,
ParserDidNotConverge,
CommandExpectedMoreInput,
}Expand description
Errors that can occur while parsing JSON
Variants§
UnexpectedToken(Option<JsonToken>, String)
The lookahead wasn’t expected at this point
ExpectedColon(Option<JsonToken>, String)
Expected a ‘:’ character, but got something else
ExpectedMoreInput(JsonInputType)
The parser succeded in matching the input, but more was expected
ParserStackTooSmall
Usually an error in the parser, we tried to ‘reduce’ a token when we hadn’t previously accepted enough input
SerdeJsonError
A value that the parser thought was valid JSON was rejected by serde (usually indicating an error in this parser)
ParserDidNotConverge
Usually indicates an error with the parser, we failed to ‘converge’ to a single value
CommandExpectedMoreInput
Expected more input while parsing a substituted command
Implementations§
Trait Implementations§
Source§impl Clone for JsonParseError
impl Clone for JsonParseError
Source§fn clone(&self) -> JsonParseError
fn clone(&self) -> JsonParseError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JsonParseError
impl Debug for JsonParseError
Source§impl<'a, TToken> From<&'a TokenMatch<TToken>> for JsonParseError
impl<'a, TToken> From<&'a TokenMatch<TToken>> for JsonParseError
Source§fn from(err_lookahead: &'a TokenMatch<TToken>) -> JsonParseError
fn from(err_lookahead: &'a TokenMatch<TToken>) -> JsonParseError
Converts to this type from the input type.
Source§impl From<Error> for JsonParseError
impl From<Error> for JsonParseError
Source§fn from(_err: Error) -> JsonParseError
fn from(_err: Error) -> JsonParseError
Converts to this type from the input type.
Source§impl<'a, TToken> From<ExpectedTokenError<'a, TokenMatch<TToken>>> for JsonParseError
impl<'a, TToken> From<ExpectedTokenError<'a, TokenMatch<TToken>>> for JsonParseError
Source§fn from(
err_expected_token: ExpectedTokenError<'a, TokenMatch<TToken>>,
) -> JsonParseError
fn from( err_expected_token: ExpectedTokenError<'a, TokenMatch<TToken>>, ) -> JsonParseError
Converts to this type from the input type.
Source§impl From<ParserDidNotConverge> for JsonParseError
impl From<ParserDidNotConverge> for JsonParseError
Source§fn from(_err: ParserDidNotConverge) -> JsonParseError
fn from(_err: ParserDidNotConverge) -> JsonParseError
Converts to this type from the input type.
Source§impl From<ParserLookaheadEmpty> for JsonParseError
impl From<ParserLookaheadEmpty> for JsonParseError
Source§fn from(_err: ParserLookaheadEmpty) -> JsonParseError
fn from(_err: ParserLookaheadEmpty) -> JsonParseError
Converts to this type from the input type.
Source§impl From<ParserStackTooSmall> for JsonParseError
impl From<ParserStackTooSmall> for JsonParseError
Source§fn from(_err: ParserStackTooSmall) -> JsonParseError
fn from(_err: ParserStackTooSmall) -> JsonParseError
Converts to this type from the input type.
Source§impl PartialEq for JsonParseError
impl PartialEq for JsonParseError
impl Eq for JsonParseError
impl StructuralPartialEq for JsonParseError
Auto Trait Implementations§
impl Freeze for JsonParseError
impl RefUnwindSafe for JsonParseError
impl Send for JsonParseError
impl Sync for JsonParseError
impl Unpin for JsonParseError
impl UnwindSafe for JsonParseError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more