Struct runtime_injector::InjectorBuilder [−][src]
pub struct InjectorBuilder { /* fields omitted */ }
Expand description
A builder for an Injector
.
Implementations
impl InjectorBuilder
[src]
impl InjectorBuilder
[src]pub fn provide<P: Provider>(&mut self, provider: P)
[src]
pub fn provide<P: Provider>(&mut self, provider: P)
[src]Assigns the provider for a service type. Multiple providers can be registered for a service.
pub fn add_provider(&mut self, provider: Box<dyn Provider>)
[src]
pub fn add_provider(&mut self, provider: Box<dyn Provider>)
[src]Adds a provider to the injector.
pub fn remove_providers(
&mut self,
service_info: ServiceInfo
) -> Option<Vec<Box<dyn Provider>>>
[src]
pub fn remove_providers(
&mut self,
service_info: ServiceInfo
) -> Option<Vec<Box<dyn Provider>>>
[src]Removes all providers for a service type.
#[must_use]pub fn root_info(&self) -> &RequestInfo
[src]
#[must_use]pub fn root_info(&self) -> &RequestInfo
[src]Borrows the root RequestInfo
that will be used by calls to
Injector::get()
.
#[must_use]pub fn root_info_mut(&mut self) -> &mut RequestInfo
[src]
#[must_use]pub fn root_info_mut(&mut self) -> &mut RequestInfo
[src]Mutably borrows the root RequestInfo
that will be used by calls to
Injector::get()
.
pub fn add_module(&mut self, module: Module)
[src]
pub fn add_module(&mut self, module: Module)
[src]Adds all the providers registered in a module. This may cause multiple providers to be registered for the same service.
If any conflicting request parameters have been set before adding this module, they are overridden.
Trait Implementations
impl Default for InjectorBuilder
[src]
impl Default for InjectorBuilder
[src]fn default() -> InjectorBuilder
[src]
fn default() -> InjectorBuilder
[src]Returns the “default value” for a type. Read more