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

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

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

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.