Struct runtime_injector::InjectorBuilder[][src]

pub struct InjectorBuilder { /* fields omitted */ }

A builder for an Injector.

Implementations

impl InjectorBuilder[src]

pub fn provide<P: Provider>(&mut self, provider: P) -> Option<Box<dyn Provider>>[src]

Assigns the provider for a service type. If a provider was already registered for the same service type, then that old provider is returned and the new provider is used instead.

pub fn implement<Interface: ?Sized, Implementation>(
    &mut self
) -> Option<ServiceInfo> where
    Interface: InterfaceFor<Implementation>,
    Implementation: Service
[src]

Assigns the implementation of an interface for a service type.

#[must_use]pub fn build(self) -> Injector[src]

Builds the injector.

Trait Implementations

impl Default for InjectorBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.