pub enum Node<'a> {
Show 21 variants
    Null,
    Bool(bool),
    Number(Decimal),
    String(&'a str),
    TemplateString(&'a [&'a Node<'a>]),
    Pointer,
    Array(&'a [&'a Node<'a>]),
    Object(&'a [(&'a Node<'a>, &'a Node<'a>)]),
    Identifier(&'a str),
    Closure(&'a Node<'a>),
    Parenthesized(&'a Node<'a>),
    Root,
    Member {
        node: &'a Node<'a>,
        property: &'a Node<'a>,
    },
    Slice {
        node: &'a Node<'a>,
        from: Option<&'a Node<'a>>,
        to: Option<&'a Node<'a>>,
    },
    Interval {
        left: &'a Node<'a>,
        right: &'a Node<'a>,
        left_bracket: Bracket,
        right_bracket: Bracket,
    },
    Conditional {
        condition: &'a Node<'a>,
        on_true: &'a Node<'a>,
        on_false: &'a Node<'a>,
    },
    Unary {
        node: &'a Node<'a>,
        operator: Operator,
    },
    Binary {
        left: &'a Node<'a>,
        operator: Operator,
        right: &'a Node<'a>,
    },
    FunctionCall {
        kind: FunctionKind,
        arguments: &'a [&'a Node<'a>],
    },
    MethodCall {
        kind: MethodKind,
        this: &'a Node<'a>,
        arguments: &'a [&'a Node<'a>],
    },
    Error {
        node: Option<&'a Node<'a>>,
        error: AstNodeError<'a>,
    },
}Expand description
抽象语法树节点枚举 定义了表达式中所有可能的节点类型
Variants§
Null
空值节点
Bool(bool)
布尔值节点
Number(Decimal)
数字节点(使用高精度十进制)
String(&'a str)
字符串节点
TemplateString(&'a [&'a Node<'a>])
模板字符串节点(包含多个子节点的数组)
Pointer
指针节点(回调引用 #)
Array(&'a [&'a Node<'a>])
数组节点
Object(&'a [(&'a Node<'a>, &'a Node<'a>)])
对象节点(键值对数组)
Identifier(&'a str)
标识符节点
Closure(&'a Node<'a>)
闭包节点
Parenthesized(&'a Node<'a>)
括号表达式节点
Root
根节点($ 引用)
Member
成员访问节点(对象.属性 或 对象[“属性”])
Slice
切片节点(数组[from:to])
Interval
区间节点([a, b] 或 (a, b) 等)
Conditional
条件表达式节点(三元操作符 condition ? true_expr : false_expr)
Unary
一元操作节点(如 -x, !x, +x)
Binary
二元操作节点(如 x + y, x == y)
FunctionCall
函数调用节点
MethodCall
方法调用节点
Error
错误节点(包含解析错误信息)
Implementations§
Trait Implementations§
impl<'a> StructuralPartialEq for Node<'a>
Auto Trait Implementations§
impl<'a> Freeze for Node<'a>
impl<'a> RefUnwindSafe for Node<'a>
impl<'a> Send for Node<'a>
impl<'a> Sync for Node<'a>
impl<'a> Unpin for Node<'a>
impl<'a> UnwindSafe for Node<'a>
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