Struct coi::ContainerBuilder
source · pub struct ContainerBuilder { /* private fields */ }
Expand description
A builder used to construct a Container
.
Implementations§
source§impl ContainerBuilder
impl ContainerBuilder
sourcepub fn register<P, T>(self, key: &'static str, provider: P) -> Self
pub fn register<P, T>(self, key: &'static str, provider: P) -> Self
Register a Provider
for T
with identifier key
.
sourcepub fn register_as<P, T>(
self,
key: &'static str,
registration: Registration<P>
) -> Self
pub fn register_as<P, T>( self, key: &'static str, registration: Registration<P> ) -> Self
Register a Provider
for T
with identifier key
, while also specifying the resolution
behavior.
Trait Implementations§
source§impl Clone for ContainerBuilder
impl Clone for ContainerBuilder
source§fn clone(&self) -> ContainerBuilder
fn clone(&self) -> ContainerBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for ContainerBuilder
impl Default for ContainerBuilder
source§fn default() -> ContainerBuilder
fn default() -> ContainerBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ContainerBuilder
impl Send for ContainerBuilder
impl Sync for ContainerBuilder
impl Unpin for ContainerBuilder
impl !UnwindSafe for ContainerBuilder
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