Struct artichoke_backend::state::State[][src]

pub struct State {
    pub parser: Option<State>,
    pub classes: Registry,
    pub modules: Registry,
    pub load_path_vfs: Adapter,
    pub regexp: State,
    pub symbols: SymbolTable,
    pub output: Strategy,
    pub prng: Random,
}
Expand description

Container for interpreter global state.

A Ruby interpreter requires various pieces of state to execute Ruby code. It needs an object heap, type registry, symbol table, psuedorandom number generator, and more.

This struct stores all of these components and allows them to be passed around as one bundle. This is useful in FFI contexts because this State can be Boxed and stored in a user data pointer.

Fields

parser: Option<State>classes: Registrymodules: Registryload_path_vfs: Adapterregexp: Statesymbols: SymbolTableoutput: Strategyprng: Random

Implementations

Create a new State.

The state is comprised of several components:

Errors

If the core-random feature is enabled, this function may return an error if the interpreter-global psuedorandom number generator fails to initialize using the platform source of randomness.

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

Performs the conversion.

Performs the conversion.

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.