[][src]Struct shaku::ModuleBuilder

pub struct ModuleBuilder<M: Module> { /* fields omitted */ }

Builds a Module. Component parameters can be set, and both components and providers implementations can be overridden.

Implementations

impl<M: Module> ModuleBuilder<M>[src]

pub fn with_submodules(submodules: M::Submodules) -> Self[src]

Create a ModuleBuilder by providing the module's submodules.

pub fn with_component_parameters<C: Component<M>>(
    self,
    params: C::Parameters
) -> Self where
    M: HasComponent<C::Interface>, 
[src]

Set the parameters of the specified component. If the parameters are not manually set, the defaults will be used.

pub fn with_component_override<I: Interface + ?Sized>(
    self,
    component: Box<I>
) -> Self where
    M: HasComponent<I>, 
[src]

Override a component implementation.

pub fn with_provider_override<I: 'static + ?Sized>(
    self,
    provider_fn: ProviderFn<M, I>
) -> Self where
    M: HasProvider<I>, 
[src]

Override a provider implementation.

pub fn build(self) -> M[src]

Build the module

Auto Trait Implementations

impl<M> !RefUnwindSafe for ModuleBuilder<M>

impl<M> !Send for ModuleBuilder<M>

impl<M> !Sync for ModuleBuilder<M>

impl<M> Unpin for ModuleBuilder<M> where
    M: Unpin,
    <M as Module>::Submodules: Unpin

impl<M> !UnwindSafe for ModuleBuilder<M>

Blanket Implementations

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

impl<T> Any for T where
    T: Any
[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.