Struct runestick::Context [−][src]
pub struct Context { /* fields omitted */ }
Expand description
Static run context visible to the virtual machine.
This contains:
- Declared functions.
- Declared instance functions.
- Type definitions.
Implementations
Construct a default set of modules with the given configuration.
stdio
determines if we include I/O functions that interact with stdout and stderr by default, likedbg
,print
, andprintln
.
Construct a runtime context used when executing the virtual machine.
use runestick::{Context, Vm, Unit}; use std::sync::Arc; let context = Context::with_default_modules()?; let runtime = Arc::new(context.runtime()); let unit = Arc::new(Unit::default()); let vm = Vm::new(runtime, unit);
Use the specified type check.
Construct a new collection of functions with default packages installed.
Check if context contains the given crate.
Test if the context has the default modules installed.
This determines among other things whether a prelude should be used or not.
pub fn iter_components<'a, I: 'a>(
&'a self,
iter: I
) -> impl Iterator<Item = ComponentRef<'a>> + 'a where
I: IntoIterator,
I::Item: IntoComponent,
pub fn iter_components<'a, I: 'a>(
&'a self,
iter: I
) -> impl Iterator<Item = ComponentRef<'a>> + 'a where
I: IntoIterator,
I::Item: IntoComponent,
Iterate over known child components of the given name.
Check if unit contains the given name.
Check if unit contains the given name by prefix.
Lookup the given native function handler in the context.
Lookup the given macro handler.
Access the meta for the given language item.
Iterate over all available functions
Iterate over all available types.