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 StructuralPartialEq for Lookahead
Auto Trait Implementations§
impl Freeze for Lookahead
impl RefUnwindSafe for Lookahead
impl Send for Lookahead
impl Sync for Lookahead
impl Unpin for Lookahead
impl UnwindSafe for Lookahead
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)