pub struct Module { /* private fields */ }
Expand description

A container for user values, used during execution.

A module contains both a FrozenHeap and Heap on which different values are allocated. You can get references to these heaps with frozen_heap and heap. Be careful not to use these values after the Module has been released unless you obtain a reference to the frozen heap.

Implementations

Create a new module environment with no contents.

Get the heap on which values are allocated by this module.

Get the frozen heap on which frozen values are allocated by this module.

Get the value of the exported variable name. Returns None if the variable isn’t defined in the module or it is private.

Freeze the environment, all its value will become immutable afterwards.

Set the value of a variable in the environment. Modifying these variables while executing is ongoing can have surprising effects.

Import symbols from a module, similar to what is done during load().

Trait Implementations

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

Get an ARef pointing at this type.

Try and get an ARef pointing at this type. Returns an Err if the type Self is a RefCell which is already mutably borrowed. Read more

Return the underlying RefCell if Self is one, otherwise None.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert between two equal types.

Convert between references to two equal types.

Convert between mutable references to two equal types.

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.