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§
Sourcefn 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 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 asbash -c <command>).guest_workspace— the guest path where the workspace is mounted (e.g.,"/workspace").