Skip to main content

Token

Trait Token 

Source
pub trait Token: Spanned + Sized {
    const SPELLING: &'static str;

    // Required methods
    fn matches_token_tree(token: &TokenTree) -> bool;
    fn from_token_tree(token: TokenTree) -> Option<Self>;
}
Expand description

A generated closed token atom backed by one matching raw TokenTree.

Parsing validates the raw category and spelling, then retains the raw atom so emission preserves its source text and span.

Required Associated Constants§

Source

const SPELLING: &'static str

Canonical spelling used in diagnostics and freshly constructed atoms.

Required Methods§

Source

fn matches_token_tree(token: &TokenTree) -> bool

Tests whether a raw atom belongs to this closed token type.

Source

fn from_token_tree(token: TokenTree) -> Option<Self>

Validates and retains a raw atom as this typed token.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Token for _Add

Source§

const SPELLING: &'static str = "+"

Source§

impl Token for _AddAdd

Source§

const SPELLING: &'static str = "++"

Source§

impl Token for _AddAddEql

Source§

const SPELLING: &'static str = "++="

Source§

impl Token for _AddEql

Source§

const SPELLING: &'static str = "+="

Source§

impl Token for _Amp

Source§

const SPELLING: &'static str = "&"

Source§

impl Token for _AmpEql

Source§

const SPELLING: &'static str = "&="

Source§

impl Token for _And

Source§

const SPELLING: &'static str = "and"

Source§

impl Token for _Att

Source§

const SPELLING: &'static str = "@"

Source§

impl Token for _AttAtt

Source§

const SPELLING: &'static str = "@@"

Source§

impl Token for _AttAttEql

Source§

const SPELLING: &'static str = "@@="

Source§

impl Token for _AttAttQsm

Source§

const SPELLING: &'static str = "@@?"

Source§

impl Token for _AttAttQsmEql

Source§

const SPELLING: &'static str = "@@?="

Source§

impl Token for _AttEql

Source§

const SPELLING: &'static str = "@="

Source§

impl Token for _Bng

Source§

const SPELLING: &'static str = "!"

Source§

impl Token for _BngEql

Source§

const SPELLING: &'static str = "!="

Source§

impl Token for _Box

Source§

const SPELLING: &'static str = "\u{22a0}"

Source§

impl Token for _BoxEql

Source§

const SPELLING: &'static str = "\u{22a0}="

Source§

impl Token for _Break

Source§

const SPELLING: &'static str = "break"

Source§

impl Token for _Breakpoint

Source§

const SPELLING: &'static str = "breakpoint"

Source§

impl Token for _Bsl

Source§

const SPELLING: &'static str = "\\"

Source§

impl Token for _BslBsl

Source§

const SPELLING: &'static str = "\\\\"

Source§

impl Token for _BslBslEql

Source§

const SPELLING: &'static str = "\\\\="

Source§

impl Token for _BslEql

Source§

const SPELLING: &'static str = "\\="

Source§

impl Token for _Catch

Source§

const SPELLING: &'static str = "catch"

Source§

impl Token for _Cdt

Source§

const SPELLING: &'static str = "\u{b7}"

Source§

impl Token for _CdtEql

Source§

const SPELLING: &'static str = "\u{b7}="

Source§

impl Token for _Cma

Source§

const SPELLING: &'static str = ","

Source§

impl Token for _Col

Source§

const SPELLING: &'static str = ":"

Source§

impl Token for _ColEql

Source§

const SPELLING: &'static str = ":="

Source§

impl Token for _Continue

Source§

const SPELLING: &'static str = "continue"

Source§

impl Token for _Crt

Source§

const SPELLING: &'static str = "^"

Source§

impl Token for _CrtBng

Source§

const SPELLING: &'static str = "^!"

Source§

impl Token for _CrtCrt

Source§

const SPELLING: &'static str = "^^"

Source§

impl Token for _CrtCrtEql

Source§

const SPELLING: &'static str = "^^="

Source§

impl Token for _CrtEql

Source§

const SPELLING: &'static str = "^="

Source§

impl Token for _CrtGst

Source§

const SPELLING: &'static str = "^>"

Source§

impl Token for _CrtGstEql

Source§

const SPELLING: &'static str = "^>="

Source§

impl Token for _CrtLst

Source§

const SPELLING: &'static str = "^<"

Source§

impl Token for _CrtLstEql

Source§

const SPELLING: &'static str = "^<="

Source§

impl Token for _CrtMul

Source§

const SPELLING: &'static str = "^*"

Source§

impl Token for _CrtMulMul

Source§

const SPELLING: &'static str = "^**"

Source§

impl Token for _CrtMulMulEql

Source§

const SPELLING: &'static str = "^**="

Source§

impl Token for _CrtTld

Source§

const SPELLING: &'static str = "^~"

Source§

impl Token for _Do

Source§

const SPELLING: &'static str = "do"

Source§

impl Token for _Dot

Source§

const SPELLING: &'static str = "."

Source§

impl Token for _DotDot

Source§

const SPELLING: &'static str = ".."

Source§

impl Token for _DotDotEql

Source§

const SPELLING: &'static str = "..="

Source§

impl Token for _DotDotLst

Source§

const SPELLING: &'static str = "..<"

Source§

impl Token for _DotDotLstEql

Source§

const SPELLING: &'static str = "..<="

Source§

impl Token for _DotQsm

Source§

const SPELLING: &'static str = ".?"

Source§

impl Token for _ElapsedTime

Source§

const SPELLING: &'static str = "elapsedTime"

Source§

impl Token for _ElapsedTiming

Source§

const SPELLING: &'static str = "elapsedTiming"

Source§

impl Token for _Else

Source§

const SPELLING: &'static str = "else"

Source§

impl Token for _Eql

Source§

const SPELLING: &'static str = "="

Source§

impl Token for _EqlBngEql

Source§

const SPELLING: &'static str = "=!="

Source§

impl Token for _EqlEql

Source§

const SPELLING: &'static str = "=="

Source§

impl Token for _EqlEqlEql

Source§

const SPELLING: &'static str = "==="

Source§

impl Token for _EqlEqlEqlGst

Source§

const SPELLING: &'static str = "===>"

Source§

impl Token for _EqlEqlEqlGstEql

Source§

const SPELLING: &'static str = "===>="

Source§

impl Token for _EqlEqlGst

Source§

const SPELLING: &'static str = "==>"

Source§

impl Token for _EqlEqlGstEql

Source§

const SPELLING: &'static str = "==>="

Source§

impl Token for _EqlGst

Source§

const SPELLING: &'static str = "=>"

Source§

impl Token for _Except

Source§

const SPELLING: &'static str = "except"

Source§

impl Token for _Finish

Source§

const SPELLING: &'static str = "finish"

Source§

impl Token for _For

Source§

const SPELLING: &'static str = "for"

Source§

impl Token for _From

Source§

const SPELLING: &'static str = "from"

Source§

impl Token for _Global

Source§

const SPELLING: &'static str = "global"

Source§

impl Token for _Graded

Source§

const SPELLING: &'static str = "(*)"

Source§

impl Token for _Gst

Source§

const SPELLING: &'static str = ">"

Source§

impl Token for _GstEql

Source§

const SPELLING: &'static str = ">="

Source§

impl Token for _GstGst

Source§

const SPELLING: &'static str = ">>"

Source§

impl Token for _GstGstEql

Source§

const SPELLING: &'static str = ">>="

Source§

impl Token for _Hsh

Source§

const SPELLING: &'static str = "#"

Source§

impl Token for _HshQsm

Source§

const SPELLING: &'static str = "#?"

Source§

impl Token for _If

Source§

const SPELLING: &'static str = "if"

Source§

impl Token for _In

Source§

const SPELLING: &'static str = "in"

Source§

impl Token for _List

Source§

const SPELLING: &'static str = "list"

Source§

impl Token for _Local

Source§

const SPELLING: &'static str = "local"

Source§

impl Token for _Lst

Source§

const SPELLING: &'static str = "<"

Source§

impl Token for _LstEql

Source§

const SPELLING: &'static str = "<="

Source§

impl Token for _LstEqlEql

Source§

const SPELLING: &'static str = "<=="

Source§

impl Token for _LstEqlEqlEql

Source§

const SPELLING: &'static str = "<==="

Source§

impl Token for _LstEqlEqlGst

Source§

const SPELLING: &'static str = "<==>"

Source§

impl Token for _LstEqlEqlGstEql

Source§

const SPELLING: &'static str = "<==>="

Source§

impl Token for _LstLst

Source§

const SPELLING: &'static str = "<<"

Source§

impl Token for _LstLstEql

Source§

const SPELLING: &'static str = "<<="

Source§

impl Token for _LstSub

Source§

const SPELLING: &'static str = "<-"

Source§

impl Token for _Mod

Source§

const SPELLING: &'static str = "%"

Source§

impl Token for _ModEql

Source§

const SPELLING: &'static str = "%="

Source§

impl Token for _Mul

Source§

const SPELLING: &'static str = "*"

Source§

impl Token for _MulEql

Source§

const SPELLING: &'static str = "*="

Source§

impl Token for _MulMul

Source§

const SPELLING: &'static str = "**"

Source§

impl Token for _MulMulEql

Source§

const SPELLING: &'static str = "**="

Source§

impl Token for _New

Source§

const SPELLING: &'static str = "new"

Source§

impl Token for _Not

Source§

const SPELLING: &'static str = "not"

Source§

impl Token for _Of

Source§

const SPELLING: &'static str = "of"

Source§

impl Token for _Or

Source§

const SPELLING: &'static str = "or"

Source§

impl Token for _Pip

Source§

const SPELLING: &'static str = "|"

Source§

impl Token for _PipEql

Source§

const SPELLING: &'static str = "|="

Source§

impl Token for _PipPip

Source§

const SPELLING: &'static str = "||"

Source§

impl Token for _PipPipEql

Source§

const SPELLING: &'static str = "||="

Source§

impl Token for _PipSub

Source§

const SPELLING: &'static str = "|-"

Source§

impl Token for _PipSubEql

Source§

const SPELLING: &'static str = "|-="

Source§

impl Token for _PipUbs

Source§

const SPELLING: &'static str = "|_"

Source§

impl Token for _PipUbsEql

Source§

const SPELLING: &'static str = "|_="

Source§

impl Token for _Profile

Source§

const SPELLING: &'static str = "profile"

Source§

impl Token for _Qsm

Source§

const SPELLING: &'static str = "?"

Source§

impl Token for _QsmQsm

Source§

const SPELLING: &'static str = "??"

Source§

impl Token for _QsmQsmEql

Source§

const SPELLING: &'static str = "??="

Source§

impl Token for _Return

Source§

const SPELLING: &'static str = "return"

Source§

impl Token for _Scl

Source§

const SPELLING: &'static str = ";"

Source§

impl Token for _Sfp

Source§

const SPELLING: &'static str = "\u{29e2}"

Source§

impl Token for _SfpEql

Source§

const SPELLING: &'static str = "\u{29e2}="

Source§

impl Token for _Shield

Source§

const SPELLING: &'static str = "shield"

Source§

impl Token for _Slh

Source§

const SPELLING: &'static str = "/"

Source§

impl Token for _SlhEql

Source§

const SPELLING: &'static str = "/="

Source§

impl Token for _SlhSlh

Source§

const SPELLING: &'static str = "//"

Source§

impl Token for _SlhSlhEql

Source§

const SPELLING: &'static str = "//="

Source§

impl Token for _Step

Source§

const SPELLING: &'static str = "step"

Source§

impl Token for _Sub

Source§

const SPELLING: &'static str = "-"

Source§

impl Token for _SubEql

Source§

const SPELLING: &'static str = "-="

Source§

impl Token for _SubGst

Source§

const SPELLING: &'static str = "->"

Source§

impl Token for _Symbol

Source§

const SPELLING: &'static str = "symbol"

Source§

impl Token for _Test

Source§

const SPELLING: &'static str = "TEST"

Source§

impl Token for _Then

Source§

const SPELLING: &'static str = "then"

Source§

impl Token for _ThreadLocal

Source§

const SPELLING: &'static str = "threadLocal"

Source§

impl Token for _ThreadVariable

Source§

const SPELLING: &'static str = "threadVariable"

Source§

impl Token for _Throw

Source§

const SPELLING: &'static str = "throw"

Source§

impl Token for _Time

Source§

const SPELLING: &'static str = "time"

Source§

impl Token for _Timing

Source§

const SPELLING: &'static str = "timing"

Source§

impl Token for _Tld

Source§

const SPELLING: &'static str = "~"

Source§

impl Token for _TldEql

Source§

const SPELLING: &'static str = "~="

Source§

impl Token for _To

Source§

const SPELLING: &'static str = "to"

Source§

impl Token for _Trap

Source§

const SPELLING: &'static str = "trap"

Source§

impl Token for _Try

Source§

const SPELLING: &'static str = "try"

Source§

impl Token for _Ubs

Source§

const SPELLING: &'static str = "_"

Source§

impl Token for _UbsBng

Source§

const SPELLING: &'static str = "_!"

Source§

impl Token for _UbsEql

Source§

const SPELLING: &'static str = "_="

Source§

impl Token for _UbsGst

Source§

const SPELLING: &'static str = "_>"

Source§

impl Token for _UbsGstEql

Source§

const SPELLING: &'static str = "_>="

Source§

impl Token for _UbsLst

Source§

const SPELLING: &'static str = "_<"

Source§

impl Token for _UbsLstEql

Source§

const SPELLING: &'static str = "_<="

Source§

impl Token for _UbsMul

Source§

const SPELLING: &'static str = "_*"

Source§

impl Token for _UbsTld

Source§

const SPELLING: &'static str = "_~"

Source§

impl Token for _When

Source§

const SPELLING: &'static str = "when"

Source§

impl Token for _While

Source§

const SPELLING: &'static str = "while"

Source§

impl Token for _Xor

Source§

const SPELLING: &'static str = "xor"