RustSyntaxKind

Enum RustSyntaxKind 

Source
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

Source§

fn clone(&self) -> RustSyntaxKind

Returns a duplicate 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 RustSyntaxKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RustSyntaxKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for RustSyntaxKind

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 RustSyntaxKind

Source§

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

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl SyntaxKind for RustSyntaxKind

Source§

fn is_trivia(&self) -> bool

Returns true if this kind represents trivia (whitespace, comments, etc.). Read more
Source§

fn is_comment(&self) -> bool

Returns true if this kind represents a comment. Read more
Source§

fn is_whitespace(&self) -> bool

Returns true if this kind represents whitespace.
Source§

fn is_token_type(&self) -> bool

Returns true if this kind represents a token type. Read more
Source§

fn is_element_type(&self) -> bool

Returns true if this kind represents an element type. Read more
Source§

impl Copy for RustSyntaxKind

Source§

impl Eq for RustSyntaxKind

Source§

impl StructuralPartialEq for RustSyntaxKind

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,