pub enum ParseFailureKind {
Lex,
Syntax,
GaveUp,
}Expand description
What kind of failure a ParseFileError reports.
The distinction that earns this type is Self::GaveUp: a parse stopped
by crate::stream::Budget has established nothing about the source, and
must not be presented as though it had.
Variants§
Lex
The lexer rejected the characters. These already carry a hand-written message and a tight span, and are passed through untouched.
Syntax
The grammar rejected the token stream. ParseFileError::span is the
token the parse could not get past.
GaveUp
The parse ran out of backtracking budget before reaching any verdict.
ParseFileError::span is the furthest token it reached, which is
where an unfinished construct usually is — but the file may well be
valid, and this is not a claim that it is not.
Trait Implementations§
Source§impl Clone for ParseFailureKind
impl Clone for ParseFailureKind
Source§fn clone(&self) -> ParseFailureKind
fn clone(&self) -> ParseFailureKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ParseFailureKind
Source§impl Debug for ParseFailureKind
impl Debug for ParseFailureKind
impl Eq for ParseFailureKind
Source§impl PartialEq for ParseFailureKind
impl PartialEq for ParseFailureKind
impl StructuralPartialEq for ParseFailureKind
Auto Trait Implementations§
impl Freeze for ParseFailureKind
impl RefUnwindSafe for ParseFailureKind
impl Send for ParseFailureKind
impl Sync for ParseFailureKind
impl Unpin for ParseFailureKind
impl UnsafeUnpin for ParseFailureKind
impl UnwindSafe for ParseFailureKind
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