Struct umbra_lang::Env[][src]

pub struct Env<'a> { /* fields omitted */ }
Expand description

The environment that scripts use to store and access variables.

This contains a reference to a parent Env whose variables are accessible but immutable.

Implementations

Clones the Core Env which contains only the variables necessary to bootstrap the language.

Clones the Prelude Env which contains the usual variables for writing programs.

Constructs an Env with no parent and no variables.

Constructs an Env with the given parent and no variables.

Creates a recursive Iterator over all variables in the given Env and its parents. Parent variables will come first.

Constructs an Env with no parent and all the variables of the given Env and its parents. Duplicate variables will be overwritten by the one in the child.

Returns the value of the variable with the given name if it exists. This Env will be checked first, followed by the parents recursively.

Returns whether the given name corresponds to a variable.

Inserts the given value with the given name as a variable.

Removes the given name from this Env.

Adds all of the variables in the given map to this Env.

Computes the changed vars in the new env nenv that exist in the outside env self.

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

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.