pub struct Container(/* private fields */);
Expand description
A struct that manages all injected types.
Implementations§
source§impl Container
impl Container
sourcepub fn resolve<T>(&self, key: &'static str) -> Result<Arc<T>>
pub fn resolve<T>(&self, key: &'static str) -> Result<Arc<T>>
Resolve an Arc<T>
whose provider was previously registered with key
.
sourcepub fn scoped(&self) -> Container
pub fn scoped(&self) -> Container
Produce a child container that only contains providers for scoped registrations
Any calls to resolve from the returned container can still use the self
container
to resolve any other kinds of registrations.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Container
impl Send for Container
impl Sync for Container
impl Unpin for Container
impl UnwindSafe for Container
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