Skip to main content

Adapter

Trait Adapter 

Source
pub trait Adapter: Send + Sync {
    // Required methods
    fn id(&self) -> AdapterId;
    fn detect<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Detection, AdapterError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn install_command<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<String, AdapterError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn supports(&self, _cap: Capability) -> bool { ... }
}
Expand description

Adapter trait. Object-safe; pin async to I/O methods only.

Required Methods§

Source

fn id(&self) -> AdapterId

Source

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

Source

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

Provided Methods§

Source

fn supports(&self, _cap: Capability) -> bool

Implementors§