pub enum Kind {
Show 197 variants
Eof,
Comment,
MultilineComment(bool),
Error,
Shebang(LitSource),
Close(Delimiter),
Open(Delimiter),
Ident(LitSource),
Label(LitSource),
Byte(CopySource<u8>),
ByteStr(StrSource),
Char(CopySource<char>),
Number(NumberSource),
Str(StrSource),
IndexedPath(ItemId),
ConstBlock(ItemId),
AsyncBlock(ItemId),
Closure(ItemId),
ExpandedMacro(NonZeroId),
Abstract,
AlignOf,
Amp,
AmpAmp,
AmpEq,
Arrow,
As,
Async,
At,
Await,
Bang,
BangEq,
Become,
Break,
Caret,
CaretEq,
Colon,
ColonColon,
Comma,
Const,
Continue,
Crate,
Dash,
DashEq,
Default,
Div,
Do,
Dollar,
Dot,
DotDot,
DotDotEq,
Else,
Enum,
Eq,
EqEq,
Extern,
False,
Final,
Fn,
For,
Gt,
GtEq,
GtGt,
GtGtEq,
If,
Impl,
In,
Is,
Let,
Loop,
Lt,
LtEq,
LtLt,
LtLtEq,
Macro,
Match,
Mod,
Move,
Mut,
Not,
OffsetOf,
Override,
Perc,
PercEq,
Pipe,
PipeEq,
PipePipe,
Plus,
PlusEq,
Pound,
Priv,
Proc,
Pub,
Pure,
QuestionMark,
Ref,
Return,
Rocket,
Select,
SelfType,
SelfValue,
SemiColon,
SizeOf,
SlashEq,
Star,
StarEq,
Static,
Struct,
Super,
Tilde,
True,
TypeOf,
Underscore,
Unsafe,
Use,
Virtual,
While,
Yield,
Whitespace,
Root,
Local,
Item,
ItemEnum,
ItemStruct,
ItemConst,
ItemFn,
ItemImpl,
ItemMod,
ItemFileMod,
ItemUse,
ItemUsePath,
ItemUseGroup,
Variant,
Field,
EmptyBody,
StructBody,
TupleBody,
FnArgs,
Block,
BlockBody,
Expr,
ExprChain,
ExprTuple,
ExprArray,
ExprUnary,
ExprBinary,
ExprGroup,
ExprEmptyGroup,
ExprTry,
ExprIndex,
ExprCall,
ExprMacroCall,
ExprObject,
ExprMatch,
ExprMatchArm,
ExprSelect,
ExprSelectArm,
ExprAwait,
ExprField,
ExprOperator,
ExprIf,
ExprElse,
ExprElseIf,
ExprWhile,
ExprLoop,
ExprBreak,
ExprContinue,
ExprReturn,
ExprYield,
ExprFor,
ExprRange,
ExprRangeInclusive,
ExprRangeTo,
ExprRangeToInclusive,
ExprRangeFrom,
ExprRangeFull,
ExprAssign,
Lit,
ExprClosure,
Pat,
PatArray,
PatTuple,
PatObject,
PatIgnore,
Path,
PathGenerics,
Condition,
ClosureArguments,
AnonymousObjectKey,
Attribute,
InnerAttribute,
Modifiers,
ModifierSuper,
ModifierSelf,
ModifierCrate,
ModifierIn,
TokenStream,
TemplateString,
}Expand description
The kind of the token.
Variants§
Eof
En end-of-file marker.
Comment
A single-line comment.
MultilineComment(bool)
A multiline comment where the boolean indicates if it’s been terminated correctly.
Error
En error marker.
Shebang(LitSource)
The special initial line of a file shebang.
Close(Delimiter)
A close delimiter: ), }, or ].
Open(Delimiter)
An open delimiter: (, {, or [.
Ident(LitSource)
An identifier.
Label(LitSource)
A label, like 'loop.
Byte(CopySource<u8>)
A byte literal.
ByteStr(StrSource)
A byte string literal, including escape sequences. Like b"hello\nworld".
Char(CopySource<char>)
A characer literal.
Number(NumberSource)
A number literal, like 42 or 3.14 or 0xff.
Str(StrSource)
A string literal, including escape sequences. Like "hello\nworld".
IndexedPath(ItemId)
A path with an associated item.
ConstBlock(ItemId)
A constant block with an associated item.
AsyncBlock(ItemId)
An asynchronous block with an associated item.
Closure(ItemId)
An indexed closure.
ExpandedMacro(NonZeroId)
An expanded macro.
Abstract
The abstract keyword.
AlignOf
The alignof keyword.
Amp
&.
AmpAmp
&&.
AmpEq
&=.
Arrow
->.
As
The as keyword.
Async
The async keyword.
At
@.
Await
The await keyword.
Bang
!.
BangEq
!=.
Become
The become keyword.
Break
The break keyword.
Caret
^.
CaretEq
^=.
Colon
:.
ColonColon
::.
Comma
,.
Const
The const keyword.
Continue
The continue keyword.
Crate
The crate keyword.
Dash
-.
DashEq
-=.
Default
The default keyword.
Div
/.
Do
The do keyword.
Dollar
$.
Dot
..
DotDot
...
DotDotEq
..=.
Else
The else keyword.
Enum
The enum keyword.
Eq
=.
EqEq
==.
Extern
The extern keyword.
False
The false keyword.
Final
The final keyword.
Fn
The fn keyword.
For
The for keyword.
Gt
>.
GtEq
>=.
GtGt
>>.
GtGtEq
>>=.
If
The if keyword.
Impl
The impl keyword.
In
The in keyword.
Is
The is keyword.
Let
The let keyword.
Loop
The loop keyword.
Lt
<.
LtEq
<=.
LtLt
<<.
LtLtEq
<<=.
Macro
The macro keyword.
Match
The match keyword.
Mod
The mod keyword.
Move
The move keyword.
Mut
The mut keyword.
Not
The not keyword.
OffsetOf
The offsetof keyword.
Override
The override keyword.
Perc
%.
PercEq
%=.
Pipe
|.
PipeEq
|=`.
PipePipe
||.
Plus
+.
PlusEq
+=.
Pound
#.
Priv
The priv keyword.
Proc
The proc keyword.
Pub
The pub keyword.
Pure
The pure keyword.
QuestionMark
?.
Ref
The ref keyword.
Return
The return keyword.
Rocket
=>.
Select
The select keyword.
SelfType
The Self keyword.
SelfValue
The self keyword.
SemiColon
;.
SizeOf
The sizeof keyword.
SlashEq
/=.
Star
*.
StarEq
*=.
Static
The static keyword.
Struct
The struct keyword.
Super
The super keyword.
Tilde
~.
True
The true keyword.
TypeOf
The typeof keyword.
Underscore
_.
Unsafe
The unsafe keyword.
Use
The use keyword.
Virtual
The virtual keyword.
While
The while keyword.
Yield
The yield keyword.
Whitespace
whitespace.
Root
a syntax root
Local
a variable declaration
Item
an item declaration
ItemEnum
an enum declaration
ItemStruct
a struct declaration
ItemConst
a constant item
ItemFn
a function declaration
ItemImpl
an impl
ItemMod
a module declaration
ItemFileMod
a file module declaration
ItemUse
a use declaration
ItemUsePath
a nested use path
ItemUseGroup
a nested use group
Variant
a variant
Field
a field declaration
EmptyBody
an empty type body
StructBody
a struct body
TupleBody
a tuple body
FnArgs
a collection of function arguments
Block
a block
BlockBody
the body of a block
Expr
an expression
ExprChain
a chain of expressions
ExprTuple
a tuple expression
ExprArray
an array expression
ExprUnary
a unary expression
ExprBinary
a binary expression
ExprGroup
a group expression
ExprEmptyGroup
an empty group expression
ExprTry
a try expression
ExprIndex
an indexing expression
ExprCall
a call expression
ExprMacroCall
a macro call expression
ExprObject
an anonymous object expression
ExprMatch
a match expression
ExprMatchArm
a match arm
ExprSelect
a select expression
ExprSelectArm
a select arm
ExprAwait
an .await expression
ExprField
a field expression
ExprOperator
the operator in an expression
ExprIf
an if expression
ExprElse
the else part of an if-expression
ExprElseIf
the else if part of an if-expression
ExprWhile
a while expression
ExprLoop
a loop expression
ExprBreak
a break expression
ExprContinue
a break expression
ExprReturn
a return expression
ExprYield
a yield expression
ExprFor
a for expression
ExprRange
a <start>..<end> expression
ExprRangeInclusive
a <start>..=<end> expression
ExprRangeTo
a ..<end> expression
ExprRangeToInclusive
a ..=<end> expression
ExprRangeFrom
a <start>.. expression
ExprRangeFull
a .. expression
ExprAssign
an assign expression
Lit
a literal value
ExprClosure
a closure expression
Pat
a pattern
PatArray
an array pattern
PatTuple
a tuple pattern
PatObject
an object pattern
PatIgnore
an ignore pattern
Path
a path
PathGenerics
the generics of a path
Condition
the let condition of a loop
ClosureArguments
closure arguments
AnonymousObjectKey
an #{ anonymous object key
Attribute
an attribute
InnerAttribute
an inner attribute
Modifiers
modifiers
ModifierSuper
the (super) modifier
ModifierSelf
the (self) modifier
ModifierCrate
the (crate) modifier
ModifierIn
the (in <path>) modifier
TokenStream
a raw token stream
TemplateString
a raw token stream
Trait Implementations§
Source§impl Ord for Kind
impl Ord for Kind
Source§impl PartialOrd for Kind
impl PartialOrd for Kind
Source§impl ToTokens for Kind
impl ToTokens for Kind
Source§fn to_tokens(
&self,
context: &mut MacroContext<'_, '_, '_>,
stream: &mut TokenStream,
) -> Result<()>
fn to_tokens( &self, context: &mut MacroContext<'_, '_, '_>, stream: &mut TokenStream, ) -> Result<()>
impl Copy for Kind
impl Eq for Kind
impl StructuralPartialEq for Kind
Auto Trait Implementations§
impl Freeze for Kind
impl RefUnwindSafe for Kind
impl Send for Kind
impl Sync for Kind
impl Unpin for Kind
impl UnwindSafe for Kind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.