Skip to main content

OopBackend

Trait OopBackend 

Source
pub trait OopBackend: Send + Sync {
    // Required methods
    fn spawn<'life0, 'async_trait>(
        &'life0 self,
        config: OopSpawnConfig,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown_all<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A type-erased backend for spawning OoP gears.

This trait is used by HostRuntime to spawn OoP gears after the start phase.

Required Methods§

Source

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

Spawn an OoP gear instance.

Source

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

Shutdown all spawned instances (called during stop phase).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl OopBackend for LocalProcessBackend

Adapter that implements OopBackend trait for LocalProcessBackend.

This allows LocalProcessBackend to be used by HostRuntime for spawning OoP gears.