Skip to main content

Sandbox

Trait Sandbox 

Source
pub trait Sandbox: Send + Sync {
    // Required methods
    fn load_module(&self, bytes: &[u8]) -> Result<Box<dyn SandboxInstance>>;
    fn name(&self) -> &'static str;
}
Expand description

A plugin runtime.

Implementations are cheap to clone: they share the underlying engine and compile cache. Each load_module produces an independent SandboxInstance with its own linear memory and an empty capability set.

Required Methods§

Source

fn load_module(&self, bytes: &[u8]) -> Result<Box<dyn SandboxInstance>>

Compile and link a plugin from raw WASM (or WAT, depending on the impl) bytes.

Source

fn name(&self) -> &'static str

Human-readable runtime name (e.g. "wasmtime").

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§