pub enum RustSyntaxKind {
Show 188 variants
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,
SelfValue,
SelfType,
Static,
Struct,
Super,
Trait,
True,
Type,
Unsafe,
Use,
Where,
While,
Identifier,
IntegerLiteral,
FloatLiteral,
StringLiteral,
CharLiteral,
Lifetime,
Plus,
Minus,
Star,
Slash,
Percent,
Caret,
Not,
And,
Or,
AndAnd,
OrOr,
Shl,
Shr,
PlusEq,
MinusEq,
StarEq,
SlashEq,
PercentEq,
CaretEq,
AndEq,
OrEq,
ShlEq,
ShrEq,
Eq,
EqEq,
Ne,
Gt,
Lt,
Ge,
Le,
At,
Underscore,
Dot,
DotDot,
DotDotDot,
DotDotEq,
Comma,
Semicolon,
Colon,
PathSep,
RArrow,
FatArrow,
Pound,
Dollar,
Question,
LeftParen,
RightParen,
LeftBrace,
RightBrace,
LeftBracket,
RightBracket,
Whitespace,
Comment,
SourceFile,
Function,
ParameterList,
Parameter,
BlockExpression,
LetStatement,
ExpressionStatement,
IdentifierExpression,
LiteralExpression,
BooleanLiteral,
ParenthesizedExpression,
BinaryExpression,
UnaryExpression,
CallExpression,
FieldExpression,
IndexExpression,
IfExpression,
MatchExpression,
LoopExpression,
WhileExpression,
ForExpression,
BreakExpression,
ContinueExpression,
ReturnExpression,
StructExpression,
TupleExpression,
ArrayExpression,
RangeExpression,
ClosureExpression,
AsyncBlockExpression,
UnsafeBlockExpression,
TryExpression,
AwaitExpression,
MacroCall,
Path,
PathSegment,
GenericArgs,
TypePath,
TupleType,
ArrayType,
SliceType,
ReferenceType,
PointerType,
FunctionType,
TraitObjectType,
ImplTraitType,
InferredType,
NeverType,
Pattern,
IdentifierPattern,
WildcardPattern,
TuplePattern,
StructPattern,
TupleStructPattern,
SlicePattern,
ReferencePattern,
LiteralPattern,
RangePattern,
OrPattern,
RestPattern,
StructDeclaration,
EnumDeclaration,
UnionDeclaration,
TraitDeclaration,
ImplDeclaration,
ModuleDeclaration,
UseDeclaration,
ConstDeclaration,
StaticDeclaration,
TypeAliasDeclaration,
ExternBlock,
ExternFunction,
Attribute,
Visibility,
GenericParams,
GenericParam,
TypeParam,
ConstParam,
LifetimeParam,
WhereClause,
WherePredicate,
ReturnType,
FieldList,
Field,
Variant,
VariantList,
AssociatedItem,
TraitItem,
ImplItem,
Eof,
Error,
}Expand description
Represents all possible kind kinds in the Rust language.
This enum includes both terminal tokens (keywords, identifiers, literals, operators, etc.) and non-terminal kind nodes (expressions, statements, declarations, etc.).
Variants§
As
The as keyword for type casting
Async
The async keyword for async functions or blocks
Await
The await keyword for awaiting futures
Break
The break keyword for breaking out of loops
Const
The const keyword for constant definitions
Continue
The continue keyword for continuing to the next loop iteration
Crate
The crate keyword for referring to the crate root
Dyn
The dyn keyword for dynamic trait objects
Else
The else keyword for else branches in conditionals
Enum
The enum keyword for enum definitions
Extern
The extern keyword for external function/block declarations
False
The false boolean literal
Fn
The fn keyword for function definitions
For
The for keyword for loops
If
The if keyword for conditional expressions
Impl
The impl keyword for implementation blocks
In
The in keyword for loops and patterns
Let
The let keyword for variable bindings
Loop
The loop keyword for infinite loops
Match
The match keyword for pattern matching
Mod
The mod keyword for module definitions
Move
The move keyword for closures
Mut
The mut keyword for mutable bindings/references
Pub
The pub keyword for visibility
Ref
The ref keyword for pattern bindings
Return
The return keyword for returning from functions
SelfValue
The self keyword for the current value
SelfType
The Self keyword for the implementing type
Static
The static keyword for static variables
Struct
The struct keyword for struct definitions
Super
The super keyword for parent modules
Trait
The trait keyword for trait definitions
True
The true boolean literal
Type
The type keyword for type aliases
Unsafe
The unsafe keyword for unsafe blocks/functions
Use
The use keyword for importing items
Where
The where keyword for where clauses
While
The while keyword for while loops
Identifier
An identifier (variable name, function name, etc.)
IntegerLiteral
An integer literal (e.g., 42, 0xFF, 0o755, 0b1010)
FloatLiteral
A floating-point literal (e.g., 3.14, 2.0e10)
StringLiteral
A string literal (e.g., "hello")
CharLiteral
A character literal (e.g., 'a')
Lifetime
A lifetime annotation (e.g., 'a)
Plus
Addition operator: +
Minus
Subtraction operator: -
Star
Multiplication operator: *
Slash
Division operator: /
Percent
Modulo operator: %
Caret
Bitwise XOR operator: ^
Not
Logical NOT/bitwise NOT operator: !
And
Bitwise AND operator: &
Or
Bitwise OR operator: |
AndAnd
Logical AND operator: &&
OrOr
Logical OR operator: ||
Shl
Left shift operator: <<
Shr
Right shift operator: >>
PlusEq
Addition assignment operator: +=
MinusEq
Subtraction assignment operator: -=
StarEq
Multiplication assignment operator: *=
SlashEq
Division assignment operator: /=
PercentEq
Modulo assignment operator: %=
CaretEq
Bitwise XOR assignment operator: ^=
AndEq
Bitwise AND assignment operator: &=
OrEq
Bitwise OR assignment operator: |=
ShlEq
Left shift assignment operator: <<=
ShrEq
Right shift assignment operator: >>=
Eq
Assignment operator: =
EqEq
Equality comparison operator: ==
Ne
Inequality comparison operator: !=
Gt
Greater-than operator: >
Lt
Less-than operator: <
Ge
Greater-than-or-equal operator: >=
Le
Less-than-or-equal operator: <=
At
At symbol: @
Underscore
Underscore: _
Dot
Dot: .
DotDot
Range operator: ..
DotDotDot
Inclusive range operator: ...
DotDotEq
Range-to operator: ..=
Comma
Comma: ,
Semicolon
Semicolon: ;
Colon
Colon: :
PathSep
Path separator: ::
RArrow
Right arrow: ->
FatArrow
Fat arrow: =>
Pound
Pound sign: #
Dollar
Dollar sign: $
Question
Question mark: ?
LeftParen
Left parenthesis: (
RightParen
Right parenthesis: )
LeftBrace
Left brace: {
RightBrace
Right brace: }
LeftBracket
Left bracket: [
RightBracket
Right bracket: ]
Whitespace
Whitespace characters
Comment
Comments (both line and block comments)
SourceFile
The root of a source file
Function
A function definition
ParameterList
A list of parameters in a function signature
Parameter
A single parameter in a function signature
BlockExpression
A block expression { ... }
LetStatement
A let statement let x = 5;
ExpressionStatement
An expression statement
IdentifierExpression
An identifier expression
LiteralExpression
A literal expression
BooleanLiteral
A boolean literal expression
ParenthesizedExpression
A parenthesized expression (expr)
BinaryExpression
A binary expression a + b
UnaryExpression
A unary expression !x or -x
CallExpression
A function call expression func(arg)
FieldExpression
A field access expression obj.field
IndexExpression
An index expression arr[index]
IfExpression
An if expression if cond { ... } else { ... }
MatchExpression
A match expression match value { ... }
LoopExpression
A loop expression loop { ... }
WhileExpression
A while expression while cond { ... }
ForExpression
A for expression for pat in iter { ... }
BreakExpression
A break expression break value?
ContinueExpression
A continue expression continue
ReturnExpression
A return expression return value?
StructExpression
A struct expression Struct { field: value }
TupleExpression
A tuple expression (a, b, c)
ArrayExpression
An array expression [a, b, c]
RangeExpression
A range expression start..end
ClosureExpression
A closure expression |args| body
AsyncBlockExpression
An async block expression async { ... }
UnsafeBlockExpression
An unsafe block expression unsafe { ... }
TryExpression
A try expression expr?
AwaitExpression
An await expression expr.await
MacroCall
A macro call macro!(args)
Path
A path module::item
PathSegment
A segment in a path
GenericArgs
Generic arguments <T, U>
TypePath
A type path
TupleType
A tuple type (T, U)
ArrayType
An array type [T; N]
SliceType
A slice type [T]
ReferenceType
A reference type &T or &mut T
PointerType
A raw pointer type *const T or *mut T
FunctionType
A function type fn(T) -> U
TraitObjectType
A trait object type dyn Trait
ImplTraitType
An impl trait type impl Trait
InferredType
An inferred type _
NeverType
The never type !
Pattern
A pattern in match arms or function parameters
IdentifierPattern
An identifier pattern
WildcardPattern
A wildcard pattern _
TuplePattern
A tuple pattern (a, b)
StructPattern
A struct pattern Struct { field: pattern }
TupleStructPattern
A tuple struct pattern Tuple(a, b)
SlicePattern
A slice pattern [a, b, ..]
ReferencePattern
A reference pattern &pattern
LiteralPattern
A literal pattern 42 or "hello"
RangePattern
A range pattern start..end
OrPattern
An or pattern pat1 | pat2
RestPattern
A rest pattern ..
StructDeclaration
A struct declaration
EnumDeclaration
An enum declaration
UnionDeclaration
A union declaration
TraitDeclaration
A trait declaration
ImplDeclaration
An impl declaration
ModuleDeclaration
A module declaration
UseDeclaration
A use declaration
ConstDeclaration
A const declaration
StaticDeclaration
A static declaration
TypeAliasDeclaration
A type alias declaration
ExternBlock
An extern block
ExternFunction
An extern function declaration
Attribute
An attribute #[attr] or #![attr]
Visibility
A visibility specifier pub, pub(crate), etc.
GenericParams
Generic parameters <T: Trait>
GenericParam
A single generic parameter
TypeParam
A type parameter
ConstParam
A const parameter
LifetimeParam
A lifetime parameter
WhereClause
A where clause
WherePredicate
A single where predicate
ReturnType
A return type in a function signature
FieldList
A list of fields in a struct or enum variant
Field
A single field in a struct or enum variant
Variant
An enum variant
VariantList
A list of enum variants
AssociatedItem
An associated item in a trait or impl
TraitItem
An item in a trait
ImplItem
An item in an impl
Eof
End of file marker
Error
Represents a kind error
Trait Implementations§
Source§impl Clone for RustSyntaxKind
impl Clone for RustSyntaxKind
Source§fn clone(&self) -> RustSyntaxKind
fn clone(&self) -> RustSyntaxKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more