Skip to main content

BashSandbox

Trait BashSandbox 

Source
pub trait BashSandbox: Send + Sync {
    // Required methods
    fn exec_command<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        command: &'life1 str,
        guest_workspace: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<SandboxOutput>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn shutdown<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Abstraction over sandbox bash execution used by the bash built-in tool.

Implement this trait to provide a custom sandbox backend. The default implementation ([BoxSandboxHandle]) uses A3S Box.

Required Methods§

Source

fn exec_command<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, command: &'life1 str, guest_workspace: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<SandboxOutput>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute a shell command inside the sandbox.

  • command — the shell command string (passed as bash -c <command>).
  • guest_workspace — the guest path where the workspace is mounted (e.g., "/workspace").
Source

fn shutdown<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Shut down the sandbox (best-effort, infallible from caller’s perspective).

Implementors§