Enum Terminal

Source
#[non_exhaustive]
pub enum Terminal {
Show 99 variants Ident(String), 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, Abstract, Become, Box, Do, Final, Macro, Override, Priv, Try, Typeof, Unsized, Virtual, Yield, Literal(String), 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

A terminal symbol.

§Multi-character operators

Multi-character operators (+=, ->, …) must not be split in multiple Terminal. Any use of the check_macro function that does not respect this invariant will is subject to unexpected results.

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.
§

Ident(String)

An identifier (foo, bar).

§

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.

§

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.

§

Yield

The yield keyword.

§

Literal(String)

A literal (42, "foo").

We use textual representation of literals because we don’t want to deal with the parsing of literals.

§

Plus

A plus (+).

§

Minus

A minus (-).

§

Star

A star (*).

§

Slash

A slash (/).

§

Percent

A percent (%).

§

Caret

A caret (^).

§

Not

A not (!).

§

And

An and (&).

§

Or

An or (|).

§

AndAnd

Lazy boolean and (&&).

§

OrOr

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-equal (^=).

§

AndEquals

An and-equals (&=).

§

OrEquals

An or-equals (|=).

§

ShlEquals

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

§

ShrEquals

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

§

Equals

An equal (=).

§

EqualsEquals

An equals equals (==).

§

NotEquals

A not-equal (!=).

§

GreaterThan

A greater than (>).

§

LessThan

A less than (<).

§

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

A right arrow (->).

§

FatArrow

A fat arrow (=>).

§

Pound

A pound (#).

§

Dollar

A dollar sign ($).

§

QuestionMark

A question mark (?).

Trait Implementations§

Source§

impl Clone for Terminal

Source§

fn clone(&self) -> Terminal

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 Terminal

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<Span> From<Terminal> for TokenTreeKind<Span>

Source§

fn from(value: Terminal) -> TokenTreeKind<Span>

Converts to this type from the input type.
Source§

impl Hash for Terminal

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

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

impl PartialEq for Terminal

Source§

fn eq(&self, other: &Terminal) -> 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 Eq for Terminal

Source§

impl StructuralPartialEq for Terminal

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.