Enum TokenDescription

Source
#[non_exhaustive]
pub enum TokenDescription {
Show 107 variants LParen, RParen, LBracket, RBracket, LBrace, RBrace, Fragment(FragmentKind), Invalid, Ident, As, Async, Await, Break, Const, Continue, Crate, Dyn, Else, Enum, Extern, False, Fn, For, If, Impl, In, Let, Loop, Match, Mod, Move, Mut, Pub, Ref, Return, Self_, SelfUpper, Static, Struct, Super, Trait, True, Type, Union, Unsafe, Use, Where, While, Yield, Abstract, Become, Box, Do, Final, Macro, Override, Priv, Try, Typeof, Unsized, Virtual, Literal, Plus, Minus, Star, Slash, Percent, Caret, Not, And, Or, AndAnd, OrOr, Shl, Shr, PlusEquals, MinusEquals, StarEquals, SlashEquals, PercentEquals, CaretEquals, AndEquals, OrEquals, ShlEquals, ShrEquals, Equals, EqualsEquals, NotEquals, GreaterThan, LessThan, GreaterThanEquals, LessThanEquals, At, Underscore, Dot, DotDot, DotDotDot, DotDotEquals, Comma, Semicolon, Colon, ColonColon, RightArrow, FatArrow, Pound, Dollar, QuestionMark,
}
Expand description

Describes a Terminal.

This allows library user to accurately report what kind of token is expected.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

LParen

An opening parenthesis.

§

RParen

A closing parenthesis.

§

LBracket

An opening bracket.

§

RBracket

A closing bracket.

§

LBrace

An opening brace.

§

RBrace

A closing brace.

§

Fragment(FragmentKind)

A fragment.

§

Invalid

An invalid token.

§

Ident

An identifier. Does not include keywords.

§

As

The as keyword.

§

Async

The async keyword.

§

Await

The await keyword.

§

Break

The break keyword.

§

Const

The const keyword.

§

Continue

The continue keyword.

§

Crate

The crate keyword.

§

Dyn

The dyn keyword.

§

Else

The else keyword.

§

Enum

The enum keyword.

§

Extern

The extern keyword.

§

False

The false keyword.

§

Fn

The fn keyword.

§

For

The for keyword.

§

If

The if keyword.

§

Impl

The impl keyword.

§

In

The in keyword.

§

Let

The let keyword.

§

Loop

The loop keyword.

§

Match

The match keyword.

§

Mod

The mod keyword.

§

Move

The move keyword.

§

Mut

The mut keyword.

§

Pub

The pub keyword.

§

Ref

The ref keyword.

§

Return

The return keyword.

§

Self_

The self keyword.

§

SelfUpper

The Self keyword.

§

Static

The static keyword.

§

Struct

The struct keyword.

§

Super

The super keyword.

§

Trait

The trait keyword.

§

True

The true keyword.

§

Type

The type keyword.

§

Union

The union keyword.

§

Unsafe

The unsafe keyword.

§

Use

The use keyword.

§

Where

The where keyword.

§

While

The while keyword.

§

Yield

The async keyword.

§

Abstract

The abstract keyword.

§

Become

The become keyword.

§

Box

The box keyword.

§

Do

The do keyword.

§

Final

The final keyword.

§

Macro

The macro keyword.

§

Override

The override keyword.

§

Priv

The priv keyword.

§

Try

The try keyword.

§

Typeof

The typeof keyword.

§

Unsized

The unsized keyword.

§

Virtual

The virtual keyword.

§

Literal

A literal

§

Plus

A plus (+).

§

Minus

A minus (-).

§

Star

A star (*).

§

Slash

A slash (/).

§

Percent

A percent sign (%).

§

Caret

A caret (^).

§

Not

A not (!).

§

And

An ampersand (&).

§

Or

An or (|).

§

AndAnd

A lazy boolean and (&&).

§

OrOr

A lazy boolean or (||).

§

Shl

A shift left (<<).

§

Shr

A shift right (>>).

§

PlusEquals

A plus-equals (+=).

§

MinusEquals

A minus-equals (-=).

§

StarEquals

A star-equals (*=).

§

SlashEquals

A slash-equals (/=).

§

PercentEquals

A percent-equals (%=).

§

CaretEquals

A caret-equals (^=).

§

AndEquals

An and-equals (&=).

§

OrEquals

An or-equals (|=).

§

ShlEquals

A shift-left-equals (<<=).

§

ShrEquals

A shift-right-equals (>>=).

§

Equals

An equals (=).

§

EqualsEquals

An equals equals (==).

§

NotEquals

A not equals (!=).

§

GreaterThan

A greater than (>).

§

LessThan

A left chevron (<).

§

GreaterThanEquals

A greater than equals (>=).

§

LessThanEquals

A less than equals (<=).

§

At

An at (@).

§

Underscore

An underscore (_).

§

Dot

A dot (.).

§

DotDot

A dot dot (..).

§

DotDotDot

A dot dot dot (...).

§

DotDotEquals

A dot dot equals (..=).

§

Comma

A comma (,).

§

Semicolon

A semicolon (;).

§

Colon

A colon (:).

§

ColonColon

A colon colon (::).

§

RightArrow

An arrow (->).

§

FatArrow

A fat arrow (=>).

§

Pound

The pound sign (#).

§

Dollar

The dollar sign ($).

§

QuestionMark

A question mark (?).

Trait Implementations§

Source§

impl Clone for TokenDescription

Source§

fn clone(&self) -> TokenDescription

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TokenDescription

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Terminal> for TokenDescription

Source§

fn from(value: &Terminal) -> TokenDescription

Converts to this type from the input type.
Source§

impl From<TokenDescription> for TokenDescription

Source§

fn from(descr: TokenDescription) -> TokenDescription

Converts to this type from the input type.
Source§

impl PartialEq for TokenDescription

Source§

fn eq(&self, other: &TokenDescription) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<TokenDescription> for TokenDescription

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(descr: TokenDescription) -> Result<TokenDescription, ()>

Performs the conversion.
Source§

impl Copy for TokenDescription

Source§

impl StructuralPartialEq for TokenDescription

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.