Trait runtime_injector::Provider[][src]

pub trait Provider: 'static {
    fn result(&self) -> ServiceInfo;
fn provide(&mut self, injector: &mut Injector) -> InjectResult<DynSvc>; }

Weakly typed service provider. Given an injector, this will provide an implementation of a service. This is automatically implemented for all types that implement TypedProvider, and TypedProvider should be preferred if possible to allow for stronger type checking.

Required methods

fn result(&self) -> ServiceInfo[src]

The ServiceInfo which describes the type returned by this provider.

fn provide(&mut self, injector: &mut Injector) -> InjectResult<DynSvc>[src]

Provides an instance of the service.

Loading content...

Implementors

impl<T> Provider for T where
    T: TypedProvider
[src]

Loading content...