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 new empty collection of functions.

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, like dbg, print, and println.

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.

Iterate over known child components of the given name.

Access the currently known unit type.

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.

Install the specified module.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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.