Struct quad_compat_rhai::Expression[][src]

pub struct Expression<'a>(_);
Expand description

An expression sub-tree in an AST.

Implementations

If this expression is a variable name, return it. Otherwise None.

Get the position of this expression.

Get the value of this expression if it is a literal constant. Supports INT, FLOAT, (), char, bool and ImmutableString.

Returns None also if the constant is not of the specified type.

Methods from Deref<Target = Expr>

Get the Dynamic value of a literal constant expression.

Returns None if the expression is not a literal constant.

Get the position of the expression.

Is the expression pure?

A pure expression has no side effects.

Is the expression the unit () literal?

Is the expression a constant?

Is a particular token allowed as a postfix operator to this expression?

Recursively walk this expression. Return false from the callback to terminate the walk.

Trait Implementations

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.