Struct artichoke_backend::state::State [−][src]
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 Box
ed and stored in a user data pointer.
Fields
parser: Option<State>
classes: Registry
modules: Registry
vfs: Adapter
regexp: State
symbols: SymbolTable
output: Strategy
prng: Random
Implementations
impl State
[src]
pub fn new() -> Result<Self, InterpreterAllocError>
[src]
Create a new State
.
The state is comprised of several components:
Class
andModule
registries.Regexp
global state.- In-memory virtual filesystem.
- Ruby parser and file context.
- Intepreter-level PRNG (requires activating the
core-random
feature). - IO capturing strategy.
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,