Skip to main content

Sandbox

Trait Sandbox 

Source
pub trait Sandbox: SandboxBackend {
    type Child: SandboxChild<Error = Self::Error>;
    type Error: Error + 'static;

    // Required methods
    fn prepare<'a>(
        &self,
        request: BackendRequest<'a>,
        context: &PathResolutionContext,
    ) -> Result<PreparedBackendRequest<'a, Self>, Self::Error>
       where Self: Sized;
    fn spawn<'a>(
        &self,
        prepared: PreparedBackendRequest<'a, Self>,
    ) -> Result<Self::Child, Self::Error>
       where Self: Sized;
}
Expand description

Common preparation and process-launch contract for native Cageforge backends.

Required Associated Types§

Source

type Child: SandboxChild<Error = Self::Error>

The native child handle returned by Self::spawn.

Source

type Error: Error + 'static

The native error type for preparation and launch.

Required Methods§

Source

fn prepare<'a>( &self, request: BackendRequest<'a>, context: &PathResolutionContext, ) -> Result<PreparedBackendRequest<'a, Self>, Self::Error>
where Self: Sized,

Validates a command and effective policy against this backend.

Source

fn spawn<'a>( &self, prepared: PreparedBackendRequest<'a, Self>, ) -> Result<Self::Child, Self::Error>
where Self: Sized,

Launches one command in a new native sandbox boundary.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§