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 distinctions such as implicit whitespace versus the explicit SPACE spelling.

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 = "⊠"

Source§

impl Token for _BoxEql

Source§

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

Source§

impl Token for _BreakKeyword

Source§

const SPELLING: &'static str = "break"

Source§

impl Token for _BreakpointKeyword

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 _CatchKeyword

Source§

const SPELLING: &'static str = "catch"

Source§

impl Token for _Cdt

Source§

const SPELLING: &'static str = "·"

Source§

impl Token for _CdtEql

Source§

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

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 _ContinueKeyword

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 _DoKeyword

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 _ElapsedTimeKeyword

Source§

const SPELLING: &'static str = "elapsedTime"

Source§

impl Token for _ElapsedTimingKeyword

Source§

const SPELLING: &'static str = "elapsedTiming"

Source§

impl Token for _ElseKeyword

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 _ExceptKeyword

Source§

const SPELLING: &'static str = "except"

Source§

impl Token for _FinishKeyword

Source§

const SPELLING: &'static str = "finish"

Source§

impl Token for _ForKeyword

Source§

const SPELLING: &'static str = "for"

Source§

impl Token for _FromKeyword

Source§

const SPELLING: &'static str = "from"

Source§

impl Token for _GlobalKeyword

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 _IfKeyword

Source§

const SPELLING: &'static str = "if"

Source§

impl Token for _InKeyword

Source§

const SPELLING: &'static str = "in"

Source§

impl Token for _ListKeyword

Source§

const SPELLING: &'static str = "list"

Source§

impl Token for _LocalKeyword

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 _NewKeyword

Source§

const SPELLING: &'static str = "new"

Source§

impl Token for _Not

Source§

const SPELLING: &'static str = "not"

Source§

impl Token for _OfKeyword

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 _ProfileKeyword

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 _ReturnKeyword

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 = "⧢"

Source§

impl Token for _SfpEql

Source§

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

Source§

impl Token for _ShieldKeyword

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 _Space

Source§

const SPELLING: &'static str = "SPACE"

Source§

impl Token for _StepKeyword

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 _SymbolKeyword

Source§

const SPELLING: &'static str = "symbol"

Source§

impl Token for _TestKeyword

Source§

const SPELLING: &'static str = "TEST"

Source§

impl Token for _ThenKeyword

Source§

const SPELLING: &'static str = "then"

Source§

impl Token for _ThreadLocalKeyword

Source§

const SPELLING: &'static str = "threadLocal"

Source§

impl Token for _ThreadVariableKeyword

Source§

const SPELLING: &'static str = "threadVariable"

Source§

impl Token for _ThrowKeyword

Source§

const SPELLING: &'static str = "throw"

Source§

impl Token for _TimeKeyword

Source§

const SPELLING: &'static str = "time"

Source§

impl Token for _TimingKeyword

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 _ToKeyword

Source§

const SPELLING: &'static str = "to"

Source§

impl Token for _TrapKeyword

Source§

const SPELLING: &'static str = "trap"

Source§

impl Token for _TryKeyword

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 _WhenKeyword

Source§

const SPELLING: &'static str = "when"

Source§

impl Token for _WhileKeyword

Source§

const SPELLING: &'static str = "while"

Source§

impl Token for _Xor

Source§

const SPELLING: &'static str = "xor"