pub struct Container { /* private fields */ }Expand description
A handle onto the application’s services. Cheap to clone.
Implementations§
Source§impl Container
impl Container
pub fn contains<T: Any + Send + Sync>(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn get_dyn<I: ?Sized + Send + Sync + 'static>(&self) -> Result<Arc<I>>
pub fn get_dyn<I: ?Sized + Send + Sync + 'static>(&self) -> Result<Arc<I>>
Resolve a trait object registered with Providers::bind.
Sourcepub fn eager_init(&self) -> Result<()>
pub fn eager_init(&self) -> Result<()>
Resolve every singleton now, in registration order.
Called by App::run, so a missing or cyclic binding is a startup
failure naming the type rather than a 500 at 3am.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Container
impl !UnwindSafe for Container
impl Freeze for Container
impl Send for Container
impl Sync for Container
impl Unpin for Container
impl UnsafeUnpin 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