Trait AsyncDIProvider

Source
pub trait AsyncDIProvider {
    type Output: ?Sized;

    // Required method
    fn di_on<'life0, 'async_trait>(
        container: &'life0 DIContainer,
    ) -> Pin<Box<dyn Future<Output = DI<Self::Output>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn di<'async_trait>(    ) -> Pin<Box<dyn Future<Output = DI<Self::Output>> + Send + 'async_trait>>
       where Self: Send + 'async_trait { ... }
}
Expand description

Provides component instance for trait DI types that needs async creation.

Required Associated Types§

Source

type Output: ?Sized

Target trait type.

Required Methods§

Source

fn di_on<'life0, 'async_trait>( container: &'life0 DIContainer, ) -> Pin<Box<dyn Future<Output = DI<Self::Output>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

DI on a container.

Provided Methods§

Source

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

DI on the global container.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§