Struct wast::parser::Lookahead1
source · [−]pub struct Lookahead1<'a> { /* private fields */ }
Expand description
A helpful structure to perform a lookahead of one token to determine what to parse.
For more information see the Parser::lookahead1
method.
Implementations
sourceimpl Lookahead1<'_>
impl Lookahead1<'_>
sourcepub fn peek<T: Peek>(&mut self) -> bool
pub fn peek<T: Peek>(&mut self) -> bool
Attempts to see if T
is the next token in the Parser
this
Lookahead1
references.
For more information see Parser::lookahead1
and Parser::peek
sourcepub fn error(self) -> Error
pub fn error(self) -> Error
Generates an error message saying that one of the tokens passed to
Lookahead1::peek
method was expected.
Before calling this method you should call Lookahead1::peek
for all
possible tokens you’d like to parse.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Lookahead1<'a>
impl<'a> !Send for Lookahead1<'a>
impl<'a> !Sync for Lookahead1<'a>
impl<'a> Unpin for Lookahead1<'a>
impl<'a> !UnwindSafe for Lookahead1<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more