Run code in virtual machines (sandboxes)
This crate provides an abstract API for the Rust programming language to allow executing scripting language code snippets in a sandbox.
The scripting language (or VM which executes code written in that scripting language) is not specified by this crate. Instead, other crates may use this crate to provide a scripting-language-independent interface to execute certain functions or provide callbacks from the VM to Rust.
Central trait is a
Machine, which is capable to compile certain code
into a function (see trait
Compile for compiling code into functions,
and see associated type
Machine::Function and trait
executing these functions).
Passing values from Rust to the VM or from the VM to Rust is done through a
“datum” type that is specific to each particular VM used (see associated
Machine::Datum). Some VMs may support creating closures in Rust
which can then be converted into a “datum” and passed to the VM (see trait
As different VMs may have “datum” types with different features (e.g. some
scripting languages might support integers while others only know strings,
Machine::Datum can implement different traits in the
which determine which functionality is supported
types::MaybeString if a datum can be a string).
Error traits and error kinds
Prelude that (currently) re-exports everything
Unnameable traits to be included via wildcard syntax
Virtual machine to execute code (with inner mutability)