Trait Sandbox

Source
pub trait Sandbox:
    Default
    + 'static
    + Send {
    // Required method
    fn run_wasi(
        &self,
        ctx: &impl RuntimeContext,
    ) -> impl Future<Output = Result<i32>> + Send;

    // Provided method
    fn can_handle(
        &self,
        ctx: &impl RuntimeContext,
    ) -> impl Future<Output = Result<()>> + Send { ... }
}

Required Methods§

Source

fn run_wasi( &self, ctx: &impl RuntimeContext, ) -> impl Future<Output = Result<i32>> + Send

Run a WebAssembly container

Provided Methods§

Source

fn can_handle( &self, ctx: &impl RuntimeContext, ) -> impl Future<Output = Result<()>> + Send

Check that the runtime can run the container. This checks runs after the container creation and before the container starts. By default it checks that the wasi_entrypoint is either:

  • a OCI image with wasm layers
  • a file with the wasm filetype header
  • a parsable wat file.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§