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§
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 Methods§
fn supports(&self, _cap: Capability) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".