Enum Node

Source
pub enum Node {
Show 39 variants ArrayDecl(ArrayDecl), ArrowFunctionDecl(ArrowFunctionDecl), Assign(Assign), AsyncFunctionDecl(AsyncFunctionDecl), AsyncFunctionExpr(AsyncFunctionExpr), AwaitExpr(AwaitExpr), BinOp(BinOp), Block(Block), Break(Break), Call(Call), ConditionalOp(ConditionalOp), Const(Const), ConstDeclList(DeclarationList), Continue(Continue), DoWhileLoop(DoWhileLoop), FunctionDecl(FunctionDecl), FunctionExpr(FunctionExpr), GetConstField(GetConstField), GetField(GetField), ForLoop(ForLoop), ForInLoop(ForInLoop), ForOfLoop(ForOfLoop), If(If), LetDeclList(DeclarationList), Identifier(Identifier), New(New), Object(Object), Return(Return), Switch(Switch), Spread(Spread), TaggedTemplate(TaggedTemplate), TemplateLit(TemplateLit), Throw(Throw), Try(Try), This, UnaryOp(UnaryOp), VarDeclList(DeclarationList), WhileLoop(WhileLoop), Empty,
}

Variants§

§

ArrayDecl(ArrayDecl)

Array declaration node. More information.

§

ArrowFunctionDecl(ArrowFunctionDecl)

An arrow function expression node. More information.

§

Assign(Assign)

An assignment operator node. More information.

§

AsyncFunctionDecl(AsyncFunctionDecl)

An async function declaration node. More information.

§

AsyncFunctionExpr(AsyncFunctionExpr)

An async function expression node. More information.

§

AwaitExpr(AwaitExpr)

An await expression node. More information.

§

BinOp(BinOp)

A binary operator node. More information.

§

Block(Block)

A Block node. More information.

§

Break(Break)

A break node. More information.

§

Call(Call)

A function call. More information.

§

ConditionalOp(ConditionalOp)

A javascript conditional operand ( x ? y : z ). More information.

§

Const(Const)

Literals represent values in JavaScript.

These are fixed values not variables that you literally provide in your script.

More information:

§

ConstDeclList(DeclarationList)

A constant declaration list. More information.

§

Continue(Continue)

A continue statement. More information.

§

DoWhileLoop(DoWhileLoop)

A do … while statement. More information.

§

FunctionDecl(FunctionDecl)

A function declaration node. More information.

§

FunctionExpr(FunctionExpr)

A function expression node. More information.

§

GetConstField(GetConstField)

Provides access to an object types’ constant properties. More information.

§

GetField(GetField)

Provides access to object fields. More information.

§

ForLoop(ForLoop)

A for statement. More information.

§

ForInLoop(ForInLoop)

A for...of or for..in statement. More information.

§

ForOfLoop(ForOfLoop)

A for...of statement. More information.

§

If(If)

An ‘if’ statement. More information.

§

LetDeclList(DeclarationList)

A let declaration list. More information.

§

Identifier(Identifier)

A local identifier node. More information.

§

New(New)

A new expression. More information.

§

Object(Object)

An object. More information.

§

Return(Return)

A return statement. More information.

§

Switch(Switch)

A switch {case} statement. More information.

§

Spread(Spread)

A spread (…x) statement. More information.

§

TaggedTemplate(TaggedTemplate)

A tagged template. More information.

§

TemplateLit(TemplateLit)

A template literal. More information.

§

Throw(Throw)

A throw statement. More information.

§

Try(Try)

A try...catch node. More information.

§

This

The JavaScript this keyword refers to the object it belongs to.

A property of an execution context (global, function or eval) that, in non–strict mode, is always a reference to an object and in strict mode can be any value.

More information:

§

UnaryOp(UnaryOp)

Unary operation node. More information

§

VarDeclList(DeclarationList)

Array declaration node. More information.

§

WhileLoop(WhileLoop)

A ‘while {…}’ node. More information.

§

Empty

A empty node.

Empty statement do nothing, just return undefined.

More information:

Implementations§

Source§

impl Node

Source

pub fn this() -> Self

Creates a This AST node.

Trait Implementations§

Source§

impl Clone for Node

Source§

fn clone(&self) -> Node

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 Node

Source§

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

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

impl Display for Node

Source§

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

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

impl Drop for Node

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Executable for Node

Source§

fn run(&self, context: &mut Context) -> JsResult<JsValue>

Runs this executable in the given context.
Source§

impl Finalize for Node

Source§

impl From<ArrayDecl> for Node

Source§

fn from(arr: ArrayDecl) -> Self

Converts to this type from the input type.
Source§

impl From<ArrowFunctionDecl> for Node

Source§

fn from(decl: ArrowFunctionDecl) -> Self

Converts to this type from the input type.
Source§

impl From<Assign> for Node

Source§

fn from(op: Assign) -> Self

Converts to this type from the input type.
Source§

impl From<AsyncFunctionDecl> for Node

Source§

fn from(decl: AsyncFunctionDecl) -> Self

Converts to this type from the input type.
Source§

impl From<AsyncFunctionExpr> for Node

Source§

fn from(expr: AsyncFunctionExpr) -> Self

Converts to this type from the input type.
Source§

impl From<AwaitExpr> for Node

Source§

fn from(awaitexpr: AwaitExpr) -> Self

Converts to this type from the input type.
Source§

impl From<BinOp> for Node

Source§

fn from(op: BinOp) -> Self

Converts to this type from the input type.
Source§

impl From<Block> for Node

Source§

fn from(block: Block) -> Self

Converts to this type from the input type.
Source§

impl From<Break> for Node

Source§

fn from(break_smt: Break) -> Node

Converts to this type from the input type.
Source§

impl From<Call> for Node

Source§

fn from(call: Call) -> Self

Converts to this type from the input type.
Source§

impl From<ConditionalOp> for Node

Source§

fn from(cond_op: ConditionalOp) -> Node

Converts to this type from the input type.
Source§

impl From<Const> for Node

Source§

fn from(c: Const) -> Self

Converts to this type from the input type.
Source§

impl From<Continue> for Node

Source§

fn from(cont: Continue) -> Node

Converts to this type from the input type.
Source§

impl From<DeclarationList> for Node

Source§

fn from(list: DeclarationList) -> Self

Converts to this type from the input type.
Source§

impl From<DoWhileLoop> for Node

Source§

fn from(do_while: DoWhileLoop) -> Self

Converts to this type from the input type.
Source§

impl From<ForInLoop> for Node

Source§

fn from(for_in: ForInLoop) -> Node

Converts to this type from the input type.
Source§

impl From<ForLoop> for Node

Source§

fn from(for_loop: ForLoop) -> Self

Converts to this type from the input type.
Source§

impl From<ForOfLoop> for Node

Source§

fn from(for_of: ForOfLoop) -> Node

Converts to this type from the input type.
Source§

impl From<FunctionDecl> for Node

Source§

fn from(decl: FunctionDecl) -> Self

Converts to this type from the input type.
Source§

impl From<FunctionExpr> for Node

Source§

fn from(expr: FunctionExpr) -> Self

Converts to this type from the input type.
Source§

impl From<GetConstField> for Node

Source§

fn from(get_const_field: GetConstField) -> Self

Converts to this type from the input type.
Source§

impl From<GetField> for Node

Source§

fn from(get_field: GetField) -> Self

Converts to this type from the input type.
Source§

impl From<Identifier> for Node

Source§

fn from(local: Identifier) -> Self

Converts to this type from the input type.
Source§

impl From<If> for Node

Source§

fn from(if_stm: If) -> Node

Converts to this type from the input type.
Source§

impl From<New> for Node

Source§

fn from(new: New) -> Self

Converts to this type from the input type.
Source§

impl From<Node> for PropertyName

Source§

fn from(name: Node) -> Self

Converts to this type from the input type.
Source§

impl From<Object> for Node

Source§

fn from(obj: Object) -> Self

Converts to this type from the input type.
Source§

impl From<Return> for Node

Source§

fn from(return_smt: Return) -> Node

Converts to this type from the input type.
Source§

impl From<Spread> for Node

Source§

fn from(spread: Spread) -> Node

Converts to this type from the input type.
Source§

impl From<Switch> for Node

Source§

fn from(switch: Switch) -> Self

Converts to this type from the input type.
Source§

impl From<TaggedTemplate> for Node

Source§

fn from(template: TaggedTemplate) -> Self

Converts to this type from the input type.
Source§

impl From<Throw> for Node

Source§

fn from(trw: Throw) -> Node

Converts to this type from the input type.
Source§

impl From<Try> for Node

Source§

fn from(try_catch: Try) -> Self

Converts to this type from the input type.
Source§

impl From<UnaryOp> for Node

Source§

fn from(op: UnaryOp) -> Self

Converts to this type from the input type.
Source§

impl From<WhileLoop> for Node

Source§

fn from(while_loop: WhileLoop) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Node

Source§

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

Source§

unsafe fn trace(&self)

Marks all contained Gcs.
Source§

unsafe fn root(&self)

Increments the root-count of all contained Gcs.
Source§

unsafe fn unroot(&self)

Decrements the root-count of all contained Gcs.
Source§

fn finalize_glue(&self)

Runs Finalize::finalize() on this object and all contained subobjects
Source§

impl StructuralPartialEq for Node

Auto Trait Implementations§

§

impl Freeze for Node

§

impl RefUnwindSafe for Node

§

impl !Send for Node

§

impl !Sync for Node

§

impl Unpin for Node

§

impl UnwindSafe for Node

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> NativeObject for T
where T: Any + Debug + Trace,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert the Rust type which implements NativeObject to a &dyn Any.
Source§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

Convert the Rust type which implements NativeObject to a &mut dyn Any.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V