Sandbox

Trait Sandbox 

Source
pub trait Sandbox:
    Send
    + Sync
    + 'static {
    // Provided methods
    fn create_sandbox(
        &self,
        create_sandbox_request: CreateSandboxRequest,
    ) -> impl Future<Output = Result<CreateSandboxResponse>> + Send { ... }
    fn start_sandbox(
        &self,
        start_sandbox_request: StartSandboxRequest,
    ) -> impl Future<Output = Result<StartSandboxResponse>> + Send { ... }
    fn platform(
        &self,
        platform_request: PlatformRequest,
    ) -> impl Future<Output = Result<PlatformResponse>> + Send { ... }
    fn stop_sandbox(
        &self,
        stop_sandbox_request: StopSandboxRequest,
    ) -> impl Future<Output = Result<StopSandboxResponse>> + Send { ... }
    fn wait_sandbox(
        &self,
        wait_sandbox_request: WaitSandboxRequest,
    ) -> impl Future<Output = Result<WaitSandboxResponse>> + Send { ... }
    fn sandbox_status(
        &self,
        sandbox_status_request: SandboxStatusRequest,
    ) -> impl Future<Output = Result<SandboxStatusResponse>> + Send { ... }
    fn ping_sandbox(
        &self,
        ping_request: PingRequest,
    ) -> impl Future<Output = Result<PingResponse>> + Send { ... }
    fn shutdown_sandbox(
        &self,
        shutdown_sandbox_request: ShutdownSandboxRequest,
    ) -> impl Future<Output = Result<ShutdownSandboxResponse>> + Send { ... }
}
Expand description

Sandbox is an optional interface that shim may implement to support sandboxes environments. A typical example of sandbox is microVM or pause container - an entity that groups containers and/or holds resources relevant for this group.

Provided Methods§

Source

fn create_sandbox( &self, create_sandbox_request: CreateSandboxRequest, ) -> impl Future<Output = Result<CreateSandboxResponse>> + Send

CreateSandbox will be called right after sandbox shim instance launched. It is a good place to initialize sandbox environment.

Source

fn start_sandbox( &self, start_sandbox_request: StartSandboxRequest, ) -> impl Future<Output = Result<StartSandboxResponse>> + Send

StartSandbox will start previsouly created sandbox.

Source

fn platform( &self, platform_request: PlatformRequest, ) -> impl Future<Output = Result<PlatformResponse>> + Send

Platform queries the platform the sandbox is going to run containers on. containerd will use this to generate a proper OCI spec.

Source

fn stop_sandbox( &self, stop_sandbox_request: StopSandboxRequest, ) -> impl Future<Output = Result<StopSandboxResponse>> + Send

StopSandbox will stop existing sandbox instance

Source

fn wait_sandbox( &self, wait_sandbox_request: WaitSandboxRequest, ) -> impl Future<Output = Result<WaitSandboxResponse>> + Send

WaitSandbox blocks until sanbox exits.

Source

fn sandbox_status( &self, sandbox_status_request: SandboxStatusRequest, ) -> impl Future<Output = Result<SandboxStatusResponse>> + Send

SandboxStatus will return current status of the running sandbox instance

Source

fn ping_sandbox( &self, ping_request: PingRequest, ) -> impl Future<Output = Result<PingResponse>> + Send

PingSandbox is a lightweight API call to check whether sandbox alive.

Source

fn shutdown_sandbox( &self, shutdown_sandbox_request: ShutdownSandboxRequest, ) -> impl Future<Output = Result<ShutdownSandboxResponse>> + Send

ShutdownSandbox must shutdown shim instance.

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.

Implementations on Foreign Types§

Source§

impl Sandbox for Client

Source§

fn create_sandbox( &self, create_sandbox_request: CreateSandboxRequest, ) -> impl Future<Output = Result<CreateSandboxResponse>> + Send

Source§

fn start_sandbox( &self, start_sandbox_request: StartSandboxRequest, ) -> impl Future<Output = Result<StartSandboxResponse>> + Send

Source§

fn platform( &self, platform_request: PlatformRequest, ) -> impl Future<Output = Result<PlatformResponse>> + Send

Source§

fn stop_sandbox( &self, stop_sandbox_request: StopSandboxRequest, ) -> impl Future<Output = Result<StopSandboxResponse>> + Send

Source§

fn wait_sandbox( &self, wait_sandbox_request: WaitSandboxRequest, ) -> impl Future<Output = Result<WaitSandboxResponse>> + Send

Source§

fn sandbox_status( &self, sandbox_status_request: SandboxStatusRequest, ) -> impl Future<Output = Result<SandboxStatusResponse>> + Send

Source§

fn ping_sandbox( &self, ping_request: PingRequest, ) -> impl Future<Output = Result<PingResponse>> + Send

Source§

fn shutdown_sandbox( &self, shutdown_sandbox_request: ShutdownSandboxRequest, ) -> impl Future<Output = Result<ShutdownSandboxResponse>> + Send

Implementors§