pub struct Environment {
    pub builtin_dtables: BuiltinDispatchTables,
    /* private fields */
}
Expand description

An environment containing information about declared globals, functions, vtables.

Fields

builtin_dtables: BuiltinDispatchTables

Dispatch tables for builtin types.

Implementations

Creates a new, empty environment.

Tries to create a global. Returns the global slot number, or an error if there are too many globals.

Tries to look up a global. Returns None if the global doesn’t exist.

Creates a function and returns its ID.

Tries to look up the index of a method, based on a function signature. Creates a new method index if there isn’t one for the given signature. Returns Err if there are too many function signatures in this environment.

Returns the signature for the method with the given ID, or None if the method index is invalid.

Creates a trait and returns its ID. Use get_trait_mut afterwards to modify the trait.

Returns a reference to the trait with the given ID.

Returns a mutable reference to the trait with the given ID.

Adds a dispatch table for a user-defined type.

Returns the user-defined dispatch table, if available.

Trait Implementations

Formats the value using the given formatter. 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

Returns the argument unchanged.

Calls U::from(self).

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

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.