Skip to main content

ProcessLifecycleCapability

Trait ProcessLifecycleCapability 

Source
pub trait ProcessLifecycleCapability {
    type Process: Send;
    type Error: Into<GuestError>;

    // Required methods
    fn start(
        &self,
        registry: &Arc<Registry>,
        process_id: ResourceId,
        module_id: &str,
        name: &str,
        capabilities: Vec<Capability>,
        entrypoint: EntrypointInvocation,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
    fn stop(
        &self,
        instance: &mut Self::Process,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
}
Expand description

Capability responsible for starting/stopping guest instances.

Required Associated Types§

Required Methods§

Source

fn start( &self, registry: &Arc<Registry>, process_id: ResourceId, module_id: &str, name: &str, capabilities: Vec<Capability>, entrypoint: EntrypointInvocation, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Start a new process, identified by module_id and name

Source

fn stop( &self, instance: &mut Self::Process, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Stop a running process

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> ProcessLifecycleCapability for Arc<T>

Source§

type Process = <T as ProcessLifecycleCapability>::Process

Source§

type Error = <T as ProcessLifecycleCapability>::Error

Source§

fn start( &self, registry: &Arc<Registry>, process_id: ResourceId, module_id: &str, name: &str, capabilities: Vec<Capability>, entrypoint: EntrypointInvocation, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Source§

fn stop( &self, instance: &mut Self::Process, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Implementors§