PlatformAdapter

Trait PlatformAdapter 

Source
pub trait PlatformAdapter: Send + Sync {
    // Required methods
    fn platform(&self) -> Platform;
    fn spawn<'life0, 'async_trait>(
        &'life0 self,
        daemon: Box<dyn Daemon>,
    ) -> Pin<Box<dyn Future<Output = Result<DaemonHandle>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn signal<'life0, 'life1, 'async_trait>(
        &'life0 self,
        handle: &'life1 DaemonHandle,
        sig: Signal,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn status<'life0, 'life1, 'async_trait>(
        &'life0 self,
        handle: &'life1 DaemonHandle,
    ) -> Pin<Box<dyn Future<Output = Result<DaemonStatus>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn attach_tracer<'life0, 'life1, 'async_trait>(
        &'life0 self,
        handle: &'life1 DaemonHandle,
    ) -> Pin<Box<dyn Future<Output = Result<TracerHandle>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Platform-specific daemon adapter.

Each platform implements this trait to provide daemon lifecycle management in a platform-appropriate way.

Required Methods§

Source

fn platform(&self) -> Platform

Returns the platform this adapter supports.

Source

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

Spawns a daemon on this platform.

§Errors

Returns an error if spawning fails.

Source

fn signal<'life0, 'life1, 'async_trait>( &'life0 self, handle: &'life1 DaemonHandle, sig: Signal, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends a signal to a daemon.

§Errors

Returns an error if signaling fails.

Source

fn status<'life0, 'life1, 'async_trait>( &'life0 self, handle: &'life1 DaemonHandle, ) -> Pin<Box<dyn Future<Output = Result<DaemonStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Queries the status of a daemon.

§Errors

Returns an error if status query fails.

Source

fn attach_tracer<'life0, 'life1, 'async_trait>( &'life0 self, handle: &'life1 DaemonHandle, ) -> Pin<Box<dyn Future<Output = Result<TracerHandle>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Attaches a tracer to a daemon (renacer integration).

§Errors

Returns an error if tracer attachment fails.

Implementors§