Trait portaldi_core::traits::AsyncDIPortal
source · pub trait AsyncDIPortal {
fn create_for_di<'life0, 'async_trait>(
container: &'life0 DIContainer
) -> Pin<Box<dyn Future<Output = Self> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn di_on<'life0, 'async_trait>(
container: &'life0 DIContainer
) -> Pin<Box<dyn Future<Output = DI<Self>> + Send + 'async_trait>>
where
Self: Sized + DITarget + Send + 'async_trait,
'life0: 'async_trait,
{ ... }
fn di<'async_trait>(
) -> Pin<Box<dyn Future<Output = DI<Self>> + Send + 'async_trait>>
where
Self: Sized + DITarget + Send + 'async_trait,
{ ... }
}Expand description
Add di methods for DI target types that needs async creation.
Required Methods§
sourcefn create_for_di<'life0, 'async_trait>(
container: &'life0 DIContainer
) -> Pin<Box<dyn Future<Output = Self> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_for_di<'life0, 'async_trait>(
container: &'life0 DIContainer
) -> Pin<Box<dyn Future<Output = Self> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create new instance for DI.