Struct shaku::ModuleBuilder[][src]

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>>(
    mut self: 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>(
    mut self: Self,
    component: Box<I>
) -> Self where
    M: HasComponent<I>, 
[src]

Override a component implementation. This method is best used when the overriding component has no injected dependencies.

pub fn with_component_override_fn<I: Interface + ?Sized>(
    mut self: Self,
    component_fn: ComponentFn<M, I>
) -> Self where
    M: HasComponent<I>, 
[src]

Override a component implementation. This method is best used when the overriding component has injected dependencies.

pub fn with_provider_override<I: 'static + ?Sized>(
    mut self: 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>[src]

impl<M> Send for ModuleBuilder<M> where
    <M as Module>::Submodules: Send
[src]

impl<M> !Sync for ModuleBuilder<M>[src]

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

impl<M> !UnwindSafe for ModuleBuilder<M>[src]

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.