pub enum ParserError<IE, DE, T>{
MissingDriver,
BadToken(T),
ExpectedActionGoto,
UnexpectedEndOfStream,
Lexer(IE),
Driver(DE),
}
Expand description
Represents all possible errors that can occur during parsing.
The ParserError
type is generic over three type parameters:
IE
: the input error type, representing failures originating from the lexer.DE
: the driver error type, representing failures produced by theParserDriver
implementation.T
: the token type, representing the fundamental input elements consumed by the parser. Must implementToken
andDebug
.
Each variant corresponds to a distinct failure mode. Most variants can be
automatically constructed through [?
] propagation via their respective
From
implementations.
Variants§
MissingDriver
No parser driver was found.
BadToken(T)
Encountered an invalid or unexpected token.
ExpectedActionGoto
A goto
action was expected but not found.
UnexpectedEndOfStream
The parser encountered an unexpected end of input.
Lexer(IE)
The input source produced an error.
Driver(DE)
The parser driver produced an error.
Trait Implementations§
Source§impl<IE, DE, T> Display for ParserError<IE, DE, T>
impl<IE, DE, T> Display for ParserError<IE, DE, T>
Source§impl<IE, DE, T> Error for ParserError<IE, DE, T>
impl<IE, DE, T> Error for ParserError<IE, DE, T>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl<IE, DE, T> Freeze for ParserError<IE, DE, T>
impl<IE, DE, T> RefUnwindSafe for ParserError<IE, DE, T>
impl<IE, DE, T> Send for ParserError<IE, DE, T>
impl<IE, DE, T> Sync for ParserError<IE, DE, T>
impl<IE, DE, T> Unpin for ParserError<IE, DE, T>
impl<IE, DE, T> UnwindSafe for ParserError<IE, DE, T>
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