pub enum ParseError<L, T, E> {
InvalidToken {
location: L,
},
UnrecognizedEOF {
location: L,
expected: Vec<String>,
},
UnrecognizedToken {
token: (L, T, L),
expected: Vec<String>,
},
ExtraToken {
token: (L, T, L),
},
User {
error: E,
},
}
Variants§
InvalidToken
Generated by the parser when it encounters a token (or EOF) it did not expect.
Fields
§
location: L
UnrecognizedEOF
Generated by the parser when it encounters an EOF it did not expect.
Fields
§
location: L
The end of the final token
UnrecognizedToken
Generated by the parser when it encounters a token it did not expect.
Fields
ExtraToken
Generated by the parser when it encounters additional, unexpected tokens.
User
Custom error type.
Fields
§
error: E
Implementations§
Source§impl<L, T, E> ParseError<L, T, E>
impl<L, T, E> ParseError<L, T, E>
pub fn map_location<LL>(self, op: impl FnMut(L) -> LL) -> ParseError<LL, T, E>
pub fn map_token<TT>(self, op: impl FnOnce(T) -> TT) -> ParseError<L, TT, E>
pub fn map_error<EE>(self, op: impl FnOnce(E) -> EE) -> ParseError<L, T, EE>
Trait Implementations§
Source§impl<L, T, E> Clone for ParseError<L, T, E>
impl<L, T, E> Clone for ParseError<L, T, E>
Source§fn clone(&self) -> ParseError<L, T, E>
fn clone(&self) -> ParseError<L, T, E>
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<L, T, E> Debug for ParseError<L, T, E>
impl<L, T, E> Debug for ParseError<L, T, E>
Source§impl<L, T, E> Display for ParseError<L, T, E>
impl<L, T, E> Display for ParseError<L, T, E>
Source§impl<L, T, E> Error for ParseError<L, T, E>
impl<L, T, E> Error for ParseError<L, T, E>
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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
Source§impl<L, T, E> From<E> for ParseError<L, T, E>
impl<L, T, E> From<E> for ParseError<L, T, E>
Source§fn from(error: E) -> ParseError<L, T, E>
fn from(error: E) -> ParseError<L, T, E>
Converts to this type from the input type.
Source§impl<L, T, E> Ord for ParseError<L, T, E>
impl<L, T, E> Ord for ParseError<L, T, E>
Source§fn cmp(&self, other: &ParseError<L, T, E>) -> Ordering
fn cmp(&self, other: &ParseError<L, T, E>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<L, T, E> PartialEq for ParseError<L, T, E>
impl<L, T, E> PartialEq for ParseError<L, T, E>
Source§impl<L, T, E> PartialOrd for ParseError<L, T, E>
impl<L, T, E> PartialOrd for ParseError<L, T, E>
impl<L, T, E> Eq for ParseError<L, T, E>
impl<L, T, E> StructuralPartialEq for ParseError<L, T, E>
Auto Trait Implementations§
impl<L, T, E> Freeze for ParseError<L, T, E>
impl<L, T, E> RefUnwindSafe for ParseError<L, T, E>
impl<L, T, E> Send for ParseError<L, T, E>
impl<L, T, E> Sync for ParseError<L, T, E>
impl<L, T, E> Unpin for ParseError<L, T, E>
impl<L, T, E> UnwindSafe for ParseError<L, T, E>
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