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

pub struct State {
    pub parser: Option<State>,
    pub classes: Registry,
    pub modules: Registry,
    pub vfs: Box<dyn Filesystem>,
    pub regexp: State,
    pub symbols: SymbolTable,
    pub output: Strategy,
    pub prng: Random,
}

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: Registryvfs: Box<dyn Filesystem>regexp: Statesymbols: SymbolTableoutput: Strategyprng: Random

Implementations

impl State[src]

pub fn new() -> Result<Self, InterpreterAllocError>[src]

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 paltform source of randomness.

Trait Implementations

impl Debug for State[src]

impl Default for State[src]

Auto Trait Implementations

impl !RefUnwindSafe for State

impl !Send for State

impl !Sync for State

impl Unpin for State

impl !UnwindSafe for State

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]