pub struct ModuleBuilder<M: Module> { /* private fields */ }
Expand description
Builds a Module
. Component parameters can be set, and both components and providers
implementations can be overridden.
Implementations§
Source§impl<M: Module> ModuleBuilder<M>
impl<M: Module> ModuleBuilder<M>
Sourcepub fn with_submodules(submodules: M::Submodules) -> Self
pub fn with_submodules(submodules: M::Submodules) -> Self
Create a ModuleBuilder by providing the module’s submodules.
Sourcepub fn with_component_parameters<C: Component<M>>(
self,
params: C::Parameters,
) -> Selfwhere
M: HasComponent<C::Interface>,
pub fn with_component_parameters<C: Component<M>>(
self,
params: C::Parameters,
) -> Selfwhere
M: HasComponent<C::Interface>,
Set the parameters of the specified component. If the parameters are not manually set, the defaults will be used.
Sourcepub fn with_component_override<I: Interface + ?Sized>(
self,
component: Box<I>,
) -> Selfwhere
M: HasComponent<I>,
pub fn with_component_override<I: Interface + ?Sized>(
self,
component: Box<I>,
) -> Selfwhere
M: HasComponent<I>,
Override a component implementation. This method is best used when the overriding component has no injected dependencies.
Sourcepub fn with_component_override_fn<I: Interface + ?Sized>(
self,
component_fn: ComponentFn<M, I>,
) -> Selfwhere
M: HasComponent<I>,
pub fn with_component_override_fn<I: Interface + ?Sized>(
self,
component_fn: ComponentFn<M, I>,
) -> Selfwhere
M: HasComponent<I>,
Override a component implementation. This method is best used when the overriding component has injected dependencies.
Sourcepub fn with_provider_override<I: 'static + ?Sized>(
self,
provider_fn: ProviderFn<M, I>,
) -> Selfwhere
M: HasProvider<I>,
pub fn with_provider_override<I: 'static + ?Sized>(
self,
provider_fn: ProviderFn<M, I>,
) -> Selfwhere
M: HasProvider<I>,
Override a provider implementation.
Auto Trait Implementations§
impl<M> Freeze for ModuleBuilder<M>
impl<M> !RefUnwindSafe for ModuleBuilder<M>
impl<M> Send for ModuleBuilder<M>
impl<M> !Sync for ModuleBuilder<M>
impl<M> Unpin for ModuleBuilder<M>
impl<M> !UnwindSafe for ModuleBuilder<M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more