pub struct ParseError {
pub reason: Option<ParserErrorReason>,
pub expected: Vec<ExpectedToken>,
pub offset: usize,
}
Expand description
Error for parsing the route
Fields§
§reason: Option<ParserErrorReason>
A concrete reason why the parse failed.
expected: Vec<ExpectedToken>
Expected token sequences
offset: usize
Additional offset for failures within sub-parsers.
Eg. if {
parses, but then a bad ident is presented, some offset is needed here then.
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
Returns a copy 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 ParseError
impl Debug for ParseError
Source§impl ParseError<&str> for ParseError
impl ParseError<&str> for ParseError
Source§fn from_error_kind(_input: &str, _kind: ErrorKind) -> Self
fn from_error_kind(_input: &str, _kind: ErrorKind) -> Self
creates an error from the input position and an ErrorKind
Source§fn append(_input: &str, _kind: ErrorKind, other: Self) -> Self
fn append(_input: &str, _kind: ErrorKind, other: Self) -> Self
combines an existing error with a new one created from the input
position and an ErrorKind. This is useful when backtracking
through a parse tree, accumulating error context on the way
Source§fn or(self, other: Self) -> Self
fn or(self, other: Self) -> Self
combines two existing error. This function is used to compare errors
generated in various branches of [alt]
Source§fn from_char(input: I, _: char) -> Self
fn from_char(input: I, _: char) -> Self
creates an error from an input position and an expected character
Source§fn add_context(_input: I, _ctx: &'static str, other: Self) -> Self
fn add_context(_input: I, _ctx: &'static str, other: Self) -> Self
create a new error from an input position, a static string and an existing error.
This is used mainly in the context combinator, to add user friendly information
to errors when backtracking through a parse tree
Source§impl PartialEq for ParseError
impl PartialEq for ParseError
impl StructuralPartialEq for ParseError
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnwindSafe for ParseError
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