[][src]Struct wast::parser::Lookahead1

pub struct Lookahead1<'a> { /* fields omitted */ }

A helpful structure to perform a lookahead of one token to determine what to parse.

For more information see the Parser::lookahead1 method.

Methods

impl<'_> Lookahead1<'_>[src]

pub fn peek<T: Peek>(&mut self) -> bool[src]

Attempts to see if T is the next token in the Parser this Lookahead1 references.

For more information see Parser::lookahead1 and Parser::peek

pub fn error(self) -> Error[src]

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> !Send for Lookahead1<'a>

impl<'a> !Sync for Lookahead1<'a>

impl<'a> Unpin for Lookahead1<'a>

impl<'a> !UnwindSafe for Lookahead1<'a>

impl<'a> !RefUnwindSafe for Lookahead1<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]