pub trait AsyncDIPortal {
    // Required method
    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;

    // Provided methods
    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§

source

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.

Provided Methods§

source

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,

DI on a container.

source

fn di<'async_trait>( ) -> Pin<Box<dyn Future<Output = DI<Self>> + Send + 'async_trait>>where Self: Sized + DITarget + Send + 'async_trait,

DI on the global container.

Object Safety§

This trait is not object safe.

Implementors§