Skip to main content

Sandbox

Trait Sandbox 

Source
pub trait Sandbox: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn is_isolated(&self) -> bool;
    fn exec(
        &self,
        spec: &SandboxSpec,
        command: &SandboxCommand,
    ) -> Result<SandboxOutput, SandboxError>;
}
Expand description

Executes commands under an isolation policy.

Implementations are Send + Sync so a backend can be shared across the CLI’s worker threads, matching how consortium_integration::exec::Executor is threaded.

Required Methods§

Source

fn name(&self) -> &'static str

Backend name, for diagnostics.

Source

fn is_isolated(&self) -> bool

Whether this backend actually enforces isolation.

A backend that cannot honour the policy must return false here rather than pretend. Callers decide whether a degraded run is acceptable; the backend never decides it silently.

Source

fn exec( &self, spec: &SandboxSpec, command: &SandboxCommand, ) -> Result<SandboxOutput, SandboxError>

Run command under spec.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§