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_KW,
NOSTACK_KW,
OFFSET_OF_KW,
OPTIONS_KW,
OUT_KW,
PRESERVES_FLAGS_KW,
PURE_KW,
RAW_KW,
READONLY_KW,
SAFE_KW,
SYM_KW,
TRY_KW,
UNION_KW,
YEET_KW,
BYTE,
BYTE_STRING,
CHAR,
C_STRING,
FLOAT_NUMBER,
INT_NUMBER,
RAW_BYTE_STRING,
RAW_C_STRING,
RAW_STRING,
STRING,
COMMENT,
ERROR,
IDENT,
LIFETIME_IDENT,
NEWLINE,
SHEBANG,
WHITESPACE,
ABI,
ADT,
ARG_LIST,
ARRAY_EXPR,
ARRAY_TYPE,
ASM_CLOBBER_ABI,
ASM_CONST,
ASM_DIR_SPEC,
ASM_EXPR,
ASM_LABEL,
ASM_OPERAND,
ASM_OPERAND_EXPR,
ASM_OPERAND_NAMED,
ASM_OPTION,
ASM_OPTIONS,
ASM_PIECE,
ASM_REG_OPERAND,
ASM_REG_SPEC,
ASM_SYM,
ASSOC_ITEM,
ASSOC_ITEM_LIST,
ASSOC_TYPE_ARG,
ATTR,
AWAIT_EXPR,
BECOME_EXPR,
BIN_EXPR,
BLOCK_EXPR,
BOX_PAT,
BREAK_EXPR,
CALL_EXPR,
CAST_EXPR,
CLOSURE_BINDER,
CLOSURE_EXPR,
CONST,
CONST_ARG,
CONST_BLOCK_PAT,
CONST_PARAM,
CONTINUE_EXPR,
DYN_TRAIT_TYPE,
ENUM,
EXPR,
EXPR_STMT,
EXTERN_BLOCK,
EXTERN_CRATE,
EXTERN_ITEM,
EXTERN_ITEM_LIST,
FIELD_EXPR,
FIELD_LIST,
FN,
FN_PTR_TYPE,
FORMAT_ARGS_ARG,
FORMAT_ARGS_EXPR,
FOR_EXPR,
FOR_TYPE,
GENERIC_ARG,
GENERIC_ARG_LIST,
GENERIC_PARAM,
GENERIC_PARAM_LIST,
IDENT_PAT,
IF_EXPR,
IMPL,
IMPL_TRAIT_TYPE,
INDEX_EXPR,
INFER_TYPE,
ITEM,
ITEM_LIST,
LABEL,
LET_ELSE,
LET_EXPR,
LET_STMT,
LIFETIME,
LIFETIME_ARG,
LIFETIME_PARAM,
LITERAL,
LITERAL_PAT,
LOOP_EXPR,
MACRO_CALL,
MACRO_DEF,
MACRO_EXPR,
MACRO_ITEMS,
MACRO_PAT,
MACRO_RULES,
MACRO_STMTS,
MACRO_TYPE,
MATCH_ARM,
MATCH_ARM_LIST,
MATCH_EXPR,
MATCH_GUARD,
META,
METHOD_CALL_EXPR,
MODULE,
NAME,
NAME_REF,
NEVER_TYPE,
OFFSET_OF_EXPR,
OR_PAT,
PARAM,
PARAM_LIST,
PARENTHESIZED_ARG_LIST,
PAREN_EXPR,
PAREN_PAT,
PAREN_TYPE,
PAT,
PATH,
PATH_EXPR,
PATH_PAT,
PATH_SEGMENT,
PATH_TYPE,
PREFIX_EXPR,
PTR_TYPE,
RANGE_EXPR,
RANGE_PAT,
RECORD_EXPR,
RECORD_EXPR_FIELD,
RECORD_EXPR_FIELD_LIST,
RECORD_FIELD,
RECORD_FIELD_LIST,
RECORD_PAT,
RECORD_PAT_FIELD,
RECORD_PAT_FIELD_LIST,
REF_EXPR,
REF_PAT,
REF_TYPE,
RENAME,
REST_PAT,
RETURN_EXPR,
RETURN_TYPE_SYNTAX,
RET_TYPE,
SELF_PARAM,
SLICE_PAT,
SLICE_TYPE,
SOURCE_FILE,
STATIC,
STMT,
STMT_LIST,
STRUCT,
TOKEN_TREE,
TRAIT,
TRAIT_ALIAS,
TRY_EXPR,
TUPLE_EXPR,
TUPLE_FIELD,
TUPLE_FIELD_LIST,
TUPLE_PAT,
TUPLE_STRUCT_PAT,
TUPLE_TYPE,
TYPE,
TYPE_ALIAS,
TYPE_ARG,
TYPE_BOUND,
TYPE_BOUND_LIST,
TYPE_PARAM,
UNDERSCORE_EXPR,
UNION,
USE,
USE_BOUND_GENERIC_ARG,
USE_BOUND_GENERIC_ARGS,
USE_TREE,
USE_TREE_LIST,
VARIANT,
VARIANT_LIST,
VISIBILITY,
WHERE_CLAUSE,
WHERE_PRED,
WHILE_EXPR,
WILDCARD_PAT,
YEET_EXPR,
YIELD_EXPR,
// some variants omitted
}
Expand description
The kind of syntax node, e.g. IDENT
, USE_KW
, or STRUCT
.
Variants§
DOLLAR
SEMICOLON
COMMA
L_PAREN
R_PAREN
L_CURLY
R_CURLY
L_BRACK
R_BRACK
L_ANGLE
R_ANGLE
AT
POUND
TILDE
QUESTION
AMP
PIPE
PLUS
STAR
SLASH
CARET
PERCENT
UNDERSCORE
DOT
DOT2
DOT3
DOT2EQ
COLON
COLON2
EQ
EQ2
FAT_ARROW
BANG
NEQ
MINUS
THIN_ARROW
LTEQ
GTEQ
PLUSEQ
MINUSEQ
PIPEEQ
AMPEQ
CARETEQ
SLASHEQ
STAREQ
PERCENTEQ
AMP2
PIPE2
SHL
SHR
SHLEQ
SHREQ
SELF_TYPE_KW
ABSTRACT_KW
AS_KW
BECOME_KW
BOX_KW
BREAK_KW
CONST_KW
CONTINUE_KW
CRATE_KW
DO_KW
ELSE_KW
ENUM_KW
EXTERN_KW
FALSE_KW
FINAL_KW
FN_KW
FOR_KW
IF_KW
IMPL_KW
IN_KW
LET_KW
LOOP_KW
MACRO_KW
MATCH_KW
MOD_KW
MOVE_KW
MUT_KW
OVERRIDE_KW
PRIV_KW
PUB_KW
REF_KW
RETURN_KW
SELF_KW
STATIC_KW
STRUCT_KW
SUPER_KW
TRAIT_KW
TRUE_KW
TYPE_KW
TYPEOF_KW
UNSAFE_KW
UNSIZED_KW
USE_KW
VIRTUAL_KW
WHERE_KW
WHILE_KW
YIELD_KW
ASM_KW
ASYNC_KW
ATT_SYNTAX_KW
AUTO_KW
AWAIT_KW
BUILTIN_KW
CLOBBER_ABI_KW
DEFAULT_KW
DYN_KW
FORMAT_ARGS_KW
GEN_KW
INLATEOUT_KW
INOUT_KW
LABEL_KW
LATEOUT_KW
MACRO_RULES_KW
MAY_UNWIND_KW
NOMEM_KW
NORETURN_KW
NOSTACK_KW
OFFSET_OF_KW
OPTIONS_KW
OUT_KW
PRESERVES_FLAGS_KW
PURE_KW
RAW_KW
READONLY_KW
SAFE_KW
SYM_KW
TRY_KW
UNION_KW
YEET_KW
BYTE
BYTE_STRING
CHAR
C_STRING
FLOAT_NUMBER
INT_NUMBER
RAW_BYTE_STRING
RAW_C_STRING
RAW_STRING
STRING
COMMENT
ERROR
IDENT
LIFETIME_IDENT
NEWLINE
SHEBANG
WHITESPACE
ABI
ADT
ARG_LIST
ARRAY_EXPR
ARRAY_TYPE
ASM_CLOBBER_ABI
ASM_CONST
ASM_DIR_SPEC
ASM_EXPR
ASM_LABEL
ASM_OPERAND
ASM_OPERAND_EXPR
ASM_OPERAND_NAMED
ASM_OPTION
ASM_OPTIONS
ASM_PIECE
ASM_REG_OPERAND
ASM_REG_SPEC
ASM_SYM
ASSOC_ITEM
ASSOC_ITEM_LIST
ASSOC_TYPE_ARG
ATTR
AWAIT_EXPR
BECOME_EXPR
BIN_EXPR
BLOCK_EXPR
BOX_PAT
BREAK_EXPR
CALL_EXPR
CAST_EXPR
CLOSURE_BINDER
CLOSURE_EXPR
CONST
CONST_ARG
CONST_BLOCK_PAT
CONST_PARAM
CONTINUE_EXPR
DYN_TRAIT_TYPE
ENUM
EXPR
EXPR_STMT
EXTERN_BLOCK
EXTERN_CRATE
EXTERN_ITEM
EXTERN_ITEM_LIST
FIELD_EXPR
FIELD_LIST
FN
FN_PTR_TYPE
FORMAT_ARGS_ARG
FORMAT_ARGS_EXPR
FOR_EXPR
FOR_TYPE
GENERIC_ARG
GENERIC_ARG_LIST
GENERIC_PARAM
GENERIC_PARAM_LIST
IDENT_PAT
IF_EXPR
IMPL
IMPL_TRAIT_TYPE
INDEX_EXPR
INFER_TYPE
ITEM
ITEM_LIST
LABEL
LET_ELSE
LET_EXPR
LET_STMT
LIFETIME
LIFETIME_ARG
LIFETIME_PARAM
LITERAL
LITERAL_PAT
LOOP_EXPR
MACRO_CALL
MACRO_DEF
MACRO_EXPR
MACRO_ITEMS
MACRO_PAT
MACRO_RULES
MACRO_STMTS
MACRO_TYPE
MATCH_ARM
MATCH_ARM_LIST
MATCH_EXPR
MATCH_GUARD
META
METHOD_CALL_EXPR
MODULE
NAME
NAME_REF
NEVER_TYPE
OFFSET_OF_EXPR
OR_PAT
PARAM
PARAM_LIST
PARENTHESIZED_ARG_LIST
PAREN_EXPR
PAREN_PAT
PAREN_TYPE
PAT
PATH
PATH_EXPR
PATH_PAT
PATH_SEGMENT
PATH_TYPE
PREFIX_EXPR
PTR_TYPE
RANGE_EXPR
RANGE_PAT
RECORD_EXPR
RECORD_EXPR_FIELD
RECORD_EXPR_FIELD_LIST
RECORD_FIELD
RECORD_FIELD_LIST
RECORD_PAT
RECORD_PAT_FIELD
RECORD_PAT_FIELD_LIST
REF_EXPR
REF_PAT
REF_TYPE
RENAME
REST_PAT
RETURN_EXPR
RETURN_TYPE_SYNTAX
RET_TYPE
SELF_PARAM
SLICE_PAT
SLICE_TYPE
SOURCE_FILE
STATIC
STMT
STMT_LIST
STRUCT
TOKEN_TREE
TRAIT
TRAIT_ALIAS
TRY_EXPR
TUPLE_EXPR
TUPLE_FIELD
TUPLE_FIELD_LIST
TUPLE_PAT
TUPLE_STRUCT_PAT
TUPLE_TYPE
TYPE
TYPE_ALIAS
TYPE_ARG
TYPE_BOUND
TYPE_BOUND_LIST
TYPE_PARAM
UNDERSCORE_EXPR
UNION
USE
USE_BOUND_GENERIC_ARG
USE_BOUND_GENERIC_ARGS
USE_TREE
USE_TREE_LIST
VARIANT
VARIANT_LIST
VISIBILITY
WHERE_CLAUSE
WHERE_PRED
WHILE_EXPR
WILDCARD_PAT
YEET_EXPR
YIELD_EXPR
Implementations§
source§impl SyntaxKind
impl SyntaxKind
sourcepub fn is_strict_keyword(self, edition: Edition) -> bool
pub fn is_strict_keyword(self, edition: Edition) -> bool
Checks whether this syntax kind is a strict keyword for the given edition. Strict keywords are identifiers that are always considered keywords.
sourcepub fn is_contextual_keyword(self, edition: Edition) -> bool
pub fn is_contextual_keyword(self, edition: Edition) -> bool
Checks whether this syntax kind is a weak keyword for the given edition. Weak keywords are identifiers that are considered keywords only in certain contexts.
sourcepub fn is_keyword(self, edition: Edition) -> bool
pub fn is_keyword(self, edition: Edition) -> bool
Checks whether this syntax kind is a strict or weak keyword for the given edition.
pub fn is_punct(self) -> bool
pub fn is_literal(self) -> bool
pub fn from_keyword(ident: &str, edition: Edition) -> Option<SyntaxKind>
pub fn from_contextual_keyword( ident: &str, edition: Edition, ) -> Option<SyntaxKind>
pub fn from_char(c: char) -> Option<SyntaxKind>
source§impl SyntaxKind
impl SyntaxKind
Trait Implementations§
source§impl Clone for SyntaxKind
impl Clone for SyntaxKind
source§fn clone(&self) -> SyntaxKind
fn clone(&self) -> SyntaxKind
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SyntaxKind
impl Debug for SyntaxKind
source§impl From<u16> for SyntaxKind
impl From<u16> for SyntaxKind
source§fn from(d: u16) -> SyntaxKind
fn from(d: u16) -> SyntaxKind
Converts to this type from the input type.
source§impl Hash for SyntaxKind
impl Hash for SyntaxKind
source§impl Ord for SyntaxKind
impl Ord for SyntaxKind
source§fn cmp(&self, other: &SyntaxKind) -> Ordering
fn cmp(&self, other: &SyntaxKind) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for SyntaxKind
impl PartialEq for SyntaxKind
source§impl PartialOrd for SyntaxKind
impl PartialOrd for SyntaxKind
impl Copy for SyntaxKind
impl Eq for SyntaxKind
impl StructuralPartialEq for SyntaxKind
Auto Trait Implementations§
impl Freeze for SyntaxKind
impl RefUnwindSafe for SyntaxKind
impl Send for SyntaxKind
impl Sync for SyntaxKind
impl Unpin for SyntaxKind
impl UnwindSafe for SyntaxKind
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more