pub trait ComponentFactory<T>: Send + Sync {
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ComponentConfig,
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn metadata(&self) -> ComponentMetadata;
}Expand description
Factory trait for creating components
Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ComponentConfig,
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ComponentConfig,
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a component instance
Sourcefn metadata(&self) -> ComponentMetadata
fn metadata(&self) -> ComponentMetadata
Get component metadata
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".