pub enum NodeKind {
Show 37 variants
Expr,
Literal,
Path,
MethodCall,
FunctionCall,
MacroCall,
BinaryOp,
UnaryOp,
If,
Match,
Loop,
Block,
Closure,
Await,
Try,
Return,
Index,
Function,
Struct,
Enum,
Trait,
Impl,
Mod,
Use,
Const,
Static,
TypeAlias,
Field,
Variant,
Param,
Arg,
GenericArg,
Lifetime,
Attribute,
LetExpr,
Wildcard,
Unit,
}Expand description
AST node type to match
Variants§
Expr
Any expression.
Literal
Literal (number / string / bool / etc.).
Path
Path expression (foo::bar).
MethodCall
Method call (x.foo()).
FunctionCall
Free function call (foo()).
MacroCall
Macro invocation (println!()).
BinaryOp
Binary operator expression.
UnaryOp
Unary operator expression.
If
if / if let expression.
Match
match expression.
Loop
loop / while / for expression.
Block
Block expression { ... }.
Closure
Closure expression (|x| ...).
Await
await expression.
Try
? (try) expression.
Return
return expression.
Index
Index expression (a[i]).
Function
fn item.
Struct
struct item.
Enum
enum item.
Trait
trait item.
Impl
impl block.
Mod
mod item.
Use
use declaration.
Const
const item.
Static
static item.
TypeAlias
type alias.
Field
Struct / enum field.
Variant
Enum variant.
Param
Function parameter.
Arg
Call site argument.
GenericArg
Generic type / lifetime argument.
Lifetime
Lifetime token.
Attribute
Attribute (#[...]).
LetExpr
let expression (if let / while let).
Wildcard
Wildcard (matches any node).
Unit
Unit ().
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeKind
impl<'de> Deserialize<'de> for NodeKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for NodeKind
impl JsonSchema for NodeKind
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl Copy for NodeKind
impl Eq for NodeKind
impl StructuralPartialEq for NodeKind
Auto Trait Implementations§
impl Freeze for NodeKind
impl RefUnwindSafe for NodeKind
impl Send for NodeKind
impl Sync for NodeKind
impl Unpin for NodeKind
impl UnsafeUnpin for NodeKind
impl UnwindSafe for NodeKind
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> 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.