pub enum Token {
Show 37 variants Ident(Name), Lit(Literal), OpenDelim(DelimToken), CloseDelim(DelimToken), Keyword(Kw), Period, Comma, Colon, Semicolon, Apostrophe, Ampersand, Arrow, Condition, LtGt, VarAssign, Lshift, Rshift, Eq, Neq, Lt, Leq, Gt, Geq, MatchEq, MatchNeq, MatchLt, MatchLeq, MatchGt, MatchGeq, Add, Sub, Mul, Div, Pow, Pipe, Qmark, Eof,
}
Expand description

A primary token as emitted by the lexer.

Variants

Ident(Name)

A basic or extended identifier.

Lit(Literal)

A literal.

OpenDelim(DelimToken)

An opening delimiter.

CloseDelim(DelimToken)

A closing delimiter.

Keyword(Kw)

A keyword.

Period

Comma

Colon

Semicolon

Apostrophe

Ampersand

Arrow

Condition

LtGt

VarAssign

Lshift

Rshift

Eq

Neq

Lt

Leq

Gt

Geq

MatchEq

MatchNeq

MatchLt

MatchLeq

MatchGt

MatchGeq

Add

Sub

Mul

Div

Pow

Pipe

Qmark

Eof

The end of the input file.

Implementations

Checks if this token is a identifier.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Look ahead at a token in the stream.

Consume the current token.

Get the number of tokens consumed. Excludes tokens skipped with skip.

Get the span of the last token consumed token (bumped or skipped).

Emit a diagnostic.

Get the severity of the worst diagnostic emitted so far.

Skip the current token. Usually the same as bump, but may be used to keep skipped tokens out of the consumed tokens count by some parsers. Read more

Get the tail location of the last consumed token (bumped or skipped).

Check whether a fatal diagnostic has been emitted.

Check whether an error diagnostic has been emitted.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

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.