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 state. Each load_module produces
an independent SandboxInstance with its own subprocess 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>>
Spawn a plugin subprocess.
For the process sandbox, bytes is interpreted as the UTF-8
encoded path to the plugin executable. (This keeps the trait
signature byte-oriented so it matches the WASM sandbox’s
load_module(&[u8]); the meaning of those bytes is runtime
specific.)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".