Skip to main content

ContainerRuntime

Trait ContainerRuntime 

Source
pub trait ContainerRuntime: Send + Sync {
    // Required methods
    fn run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        spec: &'life1 RunSpec,
    ) -> Pin<Box<dyn Future<Output = Result<InstanceId, RuntimeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn stop<'life0, 'life1, 'async_trait>(
        &'life0 self,
        uid: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove<'life0, 'life1, 'async_trait>(
        &'life0 self,
        uid: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Instance>, RuntimeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn version<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<String, RuntimeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn run<'life0, 'life1, 'async_trait>( &'life0 self, spec: &'life1 RunSpec, ) -> Pin<Box<dyn Future<Output = Result<InstanceId, RuntimeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Launch an instance tagged with spec.uid. Idempotent callers check list first.

Source

fn stop<'life0, 'life1, 'async_trait>( &'life0 self, uid: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stop the instance tagged with uid (no-op if already gone).

Source

fn remove<'life0, 'life1, 'async_trait>( &'life0 self, uid: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove the instance tagged with uid (no-op if already gone).

Source

fn list<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Instance>, RuntimeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

All instances the runtime knows about, by uid.

Source

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

Reported runtime version string (for WorkerStatus).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§