pub struct TypedContainer<R> { /* private fields */ }Expand description
A container with compile-time type tracking.
The type parameter tracks what was registered, enabling compile-time verification of service access.
Implementations§
Source§impl<R> TypedContainer<R>
impl<R> TypedContainer<R>
Sourcepub fn get<T: Injectable>(&self) -> Arc<T> ⓘ
pub fn get<T: Injectable>(&self) -> Arc<T> ⓘ
Resolve a service by type.
Uses the dynamic container internally but provides type-safe API.
Sourcepub fn try_get<T: Injectable>(&self) -> Option<Arc<T>>
pub fn try_get<T: Injectable>(&self) -> Option<Arc<T>>
Try to resolve a service.
Sourcepub fn contains<T: Injectable>(&self) -> bool
pub fn contains<T: Injectable>(&self) -> bool
Check if service exists.
Sourcepub fn into_inner(self) -> Container
pub fn into_inner(self) -> Container
Convert to the underlying container.
Trait Implementations§
Source§impl<R> Clone for TypedContainer<R>
impl<R> Clone for TypedContainer<R>
Auto Trait Implementations§
impl<R> !RefUnwindSafe for TypedContainer<R>
impl<R> !UnwindSafe for TypedContainer<R>
impl<R> Freeze for TypedContainer<R>
impl<R> Send for TypedContainer<R>where
R: Send,
impl<R> Sync for TypedContainer<R>where
R: Sync,
impl<R> Unpin for TypedContainer<R>where
R: Unpin,
impl<R> UnsafeUnpin for TypedContainer<R>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<R, D> DepsPresent<D> for R
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging