[][src]Trait inject::provider::Provider

pub trait Provider {
    type ProvidedType: 'static;
    fn provide(
        &self,
        container: &Container
    ) -> Result<Self::ProvidedType, InjectError>; fn id(&self) -> TypeId { ... } }

Value provider.

Associated Types

type ProvidedType: 'static

Loading content...

Required methods

fn provide(
    &self,
    container: &Container
) -> Result<Self::ProvidedType, InjectError>

Provides the value using the Container

Loading content...

Provided methods

fn id(&self) -> TypeId

Returns the type id of the provided type.

Loading content...

Implementations on Foreign Types

impl<T: ?Sized + 'static> Provider for Arc<T>[src]

type ProvidedType = Self

Loading content...

Implementors

impl<F, T: Inject> Provider for F where
    F: Fn(&Container) -> Result<T, InjectError>, 
[src]

type ProvidedType = T

impl<T: Inject + Default> Provider for DefaultProvider<T>[src]

impl<T: Inject> Provider for InstanceProvider<T>[src]

Loading content...