Struct runtime_injector::InjectorBuilder [−][src]
A builder for an Injector
.
Implementations
impl InjectorBuilder
[src]
pub fn provide<P: Provider>(&mut self, provider: P) -> Option<Box<dyn Provider>>
[src]
Assigns the provider for a service type. If a provider was already registered for the same service type, then that old provider is returned and the new provider is used instead.
pub fn implement<Interface: ?Sized, Implementation>(
&mut self
) -> Option<ServiceInfo> where
Interface: InterfaceFor<Implementation>,
Implementation: Service,
[src]
&mut self
) -> Option<ServiceInfo> where
Interface: InterfaceFor<Implementation>,
Implementation: Service,
Assigns the implementation of an interface for a service type.
#[must_use]pub fn build(self) -> Injector
[src]
Builds the injector.
Trait Implementations
impl Default for InjectorBuilder
[src]
fn default() -> InjectorBuilder
[src]
Auto Trait Implementations
impl !RefUnwindSafe for InjectorBuilder
impl !Send for InjectorBuilder
impl !Sync for InjectorBuilder
impl Unpin for InjectorBuilder
impl !UnwindSafe for InjectorBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,