Skip to main content

CellBackend

Trait CellBackend 

Source
pub trait CellBackend: Send + Sync {
    // Required methods
    fn create<'life0, 'life1, 'async_trait>(
        &'life0 self,
        spec: &'life1 ExecutionCellDocument,
    ) -> Pin<Box<dyn Future<Output = Result<CellHandle, CellosError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn destroy<'life0, 'life1, 'async_trait>(
        &'life0 self,
        handle: &'life1 CellHandle,
    ) -> Pin<Box<dyn Future<Output = Result<TeardownReport, CellosError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn wait_for_in_vm_exit<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _cell_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Option<Result<i32, CellosError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Map ExecutionCellDocument to host isolation primitives (L2).

Required Methods§

Source

fn create<'life0, 'life1, 'async_trait>( &'life0 self, spec: &'life1 ExecutionCellDocument, ) -> Pin<Box<dyn Future<Output = Result<CellHandle, CellosError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Provided Methods§

Source

fn wait_for_in_vm_exit<'life0, 'life1, 'async_trait>( &'life0 self, _cell_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<Result<i32, CellosError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Wait for the cell’s workload to complete inside the backend and return its exit code.

Returns Some(Ok(code)) when the backend manages in-VM command execution (e.g. via the cellos-init + vsock bridge in a Firecracker microVM) and the exit code has been received.

Returns Some(Err(...)) if the backend owns execution but the bridge failed (e.g. vsock connection dropped before the exit code arrived).

Returns None if this backend does not manage workload execution — the supervisor will fall back to launching spec.run.argv as a host-side subprocess. This is the default for all backends that do not override it.

Implementors§