Skip to main content

SyntaxKind

Enum SyntaxKind 

Source
#[repr(u8)]
pub enum SyntaxKind {
Show 115 variants Tombstone = 0, SourceFile = 1, Error = 2, Attr = 3, Visibility = 4, Name = 5, TokenTree = 6, Abi = 7, Fn = 8, ParamList = 9, Param = 10, SelfParam = 11, RetType = 12, WhereClause = 13, WherePred = 14, GenericParamList = 15, LifetimeParam = 16, TypeParam = 17, ConstParam = 18, Impl = 19, Trait = 20, Struct = 21, Enum = 22, Union = 23, TypeAlias = 24, Const = 25, Static = 26, Module = 27, Use = 28, ExternCrate = 29, ExternBlock = 30, MacroRules = 31, MacroCall = 32, ItemList = 33, PathType = 34, RefType = 35, PtrType = 36, TupleType = 37, ArrayType = 38, SliceType = 39, FnPtrType = 40, ImplTraitType = 41, DynTraitType = 42, NeverType = 43, InferType = 44, ParenType = 45, TypeBoundList = 46, TypeBound = 47, ForBinder = 48, Path = 49, PathSegment = 50, GenericArgList = 51, TypeArg = 52, LifetimeArg = 53, ConstArg = 54, AssocTypeArg = 55, Lifetime = 56, IdentPat = 57, WildcardPat = 58, RefPat = 59, TuplePat = 60, TupleStructPat = 61, RecordPat = 62, RecordPatField = 63, PathPat = 64, LiteralPat = 65, RangePat = 66, OrPat = 67, SlicePat = 68, RestPat = 69, BoxPat = 70, MacroPat = 71, ParenPat = 72, ConstBlockPat = 73, Literal = 74, PathExpr = 75, CallExpr = 76, ArgList = 77, MethodCallExpr = 78, FieldExpr = 79, IndexExpr = 80, TryExpr = 81, AwaitExpr = 82, PrefixExpr = 83, RefExpr = 84, BinExpr = 85, CastExpr = 86, RangeExpr = 87, ParenExpr = 88, TupleExpr = 89, ArrayExpr = 90, BlockExpr = 91, IfExpr = 92, MatchExpr = 93, MatchArmList = 94, MatchArm = 95, MatchGuard = 96, LoopExpr = 97, WhileExpr = 98, ForExpr = 99, ReturnExpr = 100, BreakExpr = 101, ContinueExpr = 102, ClosureExpr = 103, RecordExpr = 104, RecordExprFieldList = 105, RecordExprField = 106, LetExpr = 107, Label = 108, UnderscoreExpr = 109, YieldExpr = 110, BecomeExpr = 111, LetStmt = 112, LetElse = 113, ExprStmt = 114,
}
Expand description

Kind of a crate::tree::SyntaxTree node.

Variants§

§

Tombstone = 0

Placeholder of an abandoned or not yet completed marker; never in a built tree.

§

SourceFile = 1

§

Error = 2

§

Attr = 3

§

Visibility = 4

§

Name = 5

§

TokenTree = 6

§

Abi = 7

§

Fn = 8

§

ParamList = 9

§

Param = 10

§

SelfParam = 11

§

RetType = 12

§

WhereClause = 13

§

WherePred = 14

§

GenericParamList = 15

§

LifetimeParam = 16

§

TypeParam = 17

§

ConstParam = 18

§

Impl = 19

§

Trait = 20

§

Struct = 21

§

Enum = 22

§

Union = 23

§

TypeAlias = 24

§

Const = 25

§

Static = 26

§

Module = 27

§

Use = 28

§

ExternCrate = 29

§

ExternBlock = 30

§

MacroRules = 31

§

MacroCall = 32

§

ItemList = 33

§

PathType = 34

§

RefType = 35

§

PtrType = 36

§

TupleType = 37

§

ArrayType = 38

§

SliceType = 39

§

FnPtrType = 40

§

ImplTraitType = 41

§

DynTraitType = 42

§

NeverType = 43

§

InferType = 44

§

ParenType = 45

§

TypeBoundList = 46

§

TypeBound = 47

§

ForBinder = 48

§

Path = 49

§

PathSegment = 50

§

GenericArgList = 51

§

TypeArg = 52

§

LifetimeArg = 53

§

ConstArg = 54

§

AssocTypeArg = 55

§

Lifetime = 56

§

IdentPat = 57

§

WildcardPat = 58

§

RefPat = 59

§

TuplePat = 60

§

TupleStructPat = 61

§

RecordPat = 62

§

RecordPatField = 63

§

PathPat = 64

§

LiteralPat = 65

§

RangePat = 66

§

OrPat = 67

§

SlicePat = 68

§

RestPat = 69

§

BoxPat = 70

§

MacroPat = 71

§

ParenPat = 72

§

ConstBlockPat = 73

§

Literal = 74

§

PathExpr = 75

§

CallExpr = 76

§

ArgList = 77

§

MethodCallExpr = 78

§

FieldExpr = 79

§

IndexExpr = 80

§

TryExpr = 81

§

AwaitExpr = 82

§

PrefixExpr = 83

§

RefExpr = 84

§

BinExpr = 85

§

CastExpr = 86

§

RangeExpr = 87

§

ParenExpr = 88

§

TupleExpr = 89

§

ArrayExpr = 90

§

BlockExpr = 91

§

IfExpr = 92

§

MatchExpr = 93

§

MatchArmList = 94

§

MatchArm = 95

§

MatchGuard = 96

§

LoopExpr = 97

§

WhileExpr = 98

§

ForExpr = 99

§

ReturnExpr = 100

§

BreakExpr = 101

§

ContinueExpr = 102

§

ClosureExpr = 103

§

RecordExpr = 104

§

RecordExprFieldList = 105

§

RecordExprField = 106

§

LetExpr = 107

§

Label = 108

§

UnderscoreExpr = 109

§

YieldExpr = 110

§

BecomeExpr = 111

§

LetStmt = 112

§

LetElse = 113

§

ExprStmt = 114

Implementations§

Source§

impl SyntaxKind

Source

pub const fn is_expr(self) -> bool

Whether a node of this kind is an expression.

Source

pub const fn is_pat(self) -> bool

Whether a node of this kind is a pattern.

Source

pub const fn is_type(self) -> bool

Whether a node of this kind is a type.

Source

pub const fn is_item(self) -> bool

Whether a node of this kind is an item.

Source

pub const fn is_block_like(self) -> bool

Whether an expression of this kind ends a statement without a ; (if, match, loops, blocks).

Trait Implementations§

Source§

impl Clone for SyntaxKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SyntaxKind

Source§

impl Debug for SyntaxKind

Source§

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

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

impl Eq for SyntaxKind

Source§

impl Hash for SyntaxKind

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 SyntaxKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SyntaxKind

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.