Skip to main content

Provider

Trait Provider 

Source
pub trait Provider:
    Send
    + Sync
    + 'static {
    type Output: Send + Sync + 'static;

    // Required method
    fn provide<'life0, 'async_trait>(
        container: &'life0 Container,
    ) -> Pin<Box<dyn Future<Output = Arc<Self::Output>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait implemented by types that register themselves as providers.

Required Associated Types§

Source

type Output: Send + Sync + 'static

Required Methods§

Source

fn provide<'life0, 'async_trait>( container: &'life0 Container, ) -> Pin<Box<dyn Future<Output = Arc<Self::Output>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§