pub enum Lookahead {
Positive,
Negative,
None,
}
Expand description
The current lookahead status of a ParserState
.
Variants
Positive
The positive predicate, written as an ampersand &, attempts to match its inner expression. If the inner expression succeeds, parsing continues, but at the same position as the predicate — &foo ~ bar is thus a kind of “AND” statement: “the input string must match foo AND bar”. If the inner expression fails, the whole expression fails too.
Negative
The negative predicate, written as an exclamation mark !, attempts to match its inner expression. If the inner expression fails, the predicate succeeds and parsing continues at the same position as the predicate. If the inner expression succeeds, the predicate fails — !foo ~ bar is thus a kind of “NOT” statement: “the input string must match bar but NOT foo”.
None
No lookahead (i.e. it will consume input).
Trait Implementations
impl Copy for Lookahead
impl Eq for Lookahead
impl StructuralEq for Lookahead
impl StructuralPartialEq for Lookahead
Auto Trait Implementations
impl RefUnwindSafe for Lookahead
impl Send for Lookahead
impl Sync for Lookahead
impl Unpin for Lookahead
impl UnwindSafe for Lookahead
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more