[][src]Struct tfsi::injector::Injector

pub struct Injector<Components> { /* fields omitted */ }

An Injector: a container for components.

Implementations

impl<Components> Injector<Components>[src]

pub fn construct<'p, 'd, Output, ConstructIdx, ProvideIdx>(&'p self) -> Output where
    'd: 'p,
    Output: Construct<'p, 'd, ConstructIdx>,
    Components: 'p,
    Self: FitRequirement<'p, 'd, <Output as Construct<'p, 'd, ConstructIdx>>::Requirement, ProvideIdx>, 
[src]

Instantiate an Output using this Injector via Construct<ConstructIdx>

impl Injector<ComponentFromProvider<ProvideNil>>[src]

pub fn create() -> Self[src]

Constructs an empty Injector

impl<Components> Injector<Components>[src]

pub fn with_arc<V>(
    self,
    arced_value: Arc<V>
) -> Injector<ComponentPair<ComponentFromProvider<ProvideArc<V>>, Components>>
[src]

Constructs an Injector by adding to self a component that provides the access to the value via the given Arc<V>.

impl<Components> Injector<Components>[src]

pub fn with_component<C>(
    self,
    component: C
) -> Injector<ComponentPair<C, Components>>
[src]

Constructs an Injector by adding to self the given component: C.

pub fn ref_with_component<'p, C>(
    &'p self,
    component: &'p C
) -> Injector<ComponentPair<ComponentForward<'p, Components>, ComponentForward<'p, C>>>
[src]

Create an Injector that references self and another component: C.

impl<Components> Injector<Components>[src]

pub fn with_provider<P>(
    self,
    provider: P
) -> Injector<ComponentPair<ComponentFromProvider<P>, Components>>
[src]

Constructs an Injector by adding to self the given a Component over the given provider: P.

pub fn ref_with_provider<'p, P>(
    &'p self,
    provider: &'p P
) -> Injector<ComponentPair<ComponentForward<'p, Components>, ComponentFromProvider<ProvideForward<'p, P>>>>
[src]

Create an Injector that references self and another provider: P.

impl<Components> Injector<Components>[src]

pub fn with_value<V>(
    self,
    value: V
) -> Injector<ComponentPair<ComponentFromProvider<ProvideVal<V>>, Components>>
[src]

Constructs an Injector by adding to self a component that provides the given value: V.

Trait Implementations

impl<Components: Clone> Clone for Injector<Components>[src]

impl<Components: Debug> Debug for Injector<Components>[src]

impl<'p, 'd, C, T, I> Provide<'p, 'd, T, IdxInjector<I>> for Injector<C> where
    C: Provide<'p, 'd, T, I>,
    T: 'd, 
[src]

Auto Trait Implementations

impl<Components> RefUnwindSafe for Injector<Components> where
    Components: RefUnwindSafe
[src]

impl<Components> Send for Injector<Components> where
    Components: Send
[src]

impl<Components> Sync for Injector<Components> where
    Components: Sync
[src]

impl<Components> Unpin for Injector<Components> where
    Components: Unpin
[src]

impl<Components> UnwindSafe for Injector<Components> where
    Components: UnwindSafe
[src]

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<'p, 'd, P, T, I> FitRequirement<'p, 'd, RequireOne<'p, 'd, T>, I> for P where
    'd: 'p,
    P: Provide<'p, 'd, T, I>,
    I: 'p,
    T: 'd, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.