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§
Sourcefn load_module(&self, bytes: &[u8]) -> Result<Box<dyn SandboxInstance>>
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".