Struct rhai::EvalState[][src]

pub struct EvalState {
    pub source: Option<Identifier>,
    pub always_search: bool,
    pub scope_level: usize,
    pub operations: u64,
    pub modules: usize,
    pub resolver: Option<Shared<StaticModuleResolver>>,
    // some fields omitted
}
Expand description

(INTERNALS) A type that holds all the current states of the Engine. Exported under the internals feature only.

Volatile Data Structure

This type is volatile and may change.

Fields

source: Option<Identifier>

Source of the current context.

always_search: bool

Normally, access to variables are parsed with a relative offset into the scope to avoid a lookup. In some situation, e.g. after running an eval statement, subsequent offsets become mis-aligned. When that happens, this flag is turned on to force a scope lookup by name.

scope_level: usize

Level of the current scope. The global (root) level is zero, a new block (or function call) is one level higher, and so on.

operations: u64

Number of operations performed.

modules: usize

Number of modules loaded.

resolver: Option<Shared<StaticModuleResolver>>

Embedded module resolver.

Implementations

Is the state currently at global (root) level?

Get a mutable reference to the current function resolution cache.

Push an empty function resolution cache onto the stack and make it current.

Remove the current function resolution cache from the stack and make the last one current.

Panics

Panics if there are no more function resolution cache in the stack.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

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)

recently added

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.