Skip to main content

SandboxRunner

Trait SandboxRunner 

Source
pub trait SandboxRunner: Send + Sync {
    // Required methods
    fn create<'life0, 'async_trait>(
        &'life0 self,
        config: SandboxConfig,
    ) -> Pin<Box<dyn Future<Output = Result<SandboxHandle, SandboxError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        handle: &'life1 SandboxHandle,
        request: ExecutionRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, SandboxError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn write_file<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        handle: &'life1 SandboxHandle,
        path: &'life2 str,
        content: &'life3 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<(), SandboxError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn read_file<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        handle: &'life1 SandboxHandle,
        path: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SandboxError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn destroy<'life0, 'async_trait>(
        &'life0 self,
        handle: SandboxHandle,
    ) -> Pin<Box<dyn Future<Output = Result<(), SandboxError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn capabilities(&self) -> RunnerCapabilities;

    // Provided method
    fn enforces_isolation(&self) -> bool { ... }
}

Required Methods§

Source

fn create<'life0, 'async_trait>( &'life0 self, config: SandboxConfig, ) -> Pin<Box<dyn Future<Output = Result<SandboxHandle, SandboxError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, handle: &'life1 SandboxHandle, request: ExecutionRequest, ) -> Pin<Box<dyn Future<Output = Result<ExecutionResult, SandboxError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn write_file<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, handle: &'life1 SandboxHandle, path: &'life2 str, content: &'life3 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), SandboxError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn read_file<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, handle: &'life1 SandboxHandle, path: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SandboxError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn destroy<'life0, 'async_trait>( &'life0 self, handle: SandboxHandle, ) -> Pin<Box<dyn Future<Output = Result<(), SandboxError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn capabilities(&self) -> RunnerCapabilities

Provided Methods§

Source

fn enforces_isolation(&self) -> bool

Whether this backend enforces an execution boundary rather than running an ordinary host process. Capability labels alone are not isolation. Unported and custom backends must explicitly implement this contract before governed sandbox-required tools can use them.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§