pub struct ServiceContainer { /* private fields */ }Expand description
Dependency injection container for managing services
This container provides a simple way to register and retrieve
services using type erasure. Services are stored as Arc
Implementations§
Source§impl ServiceContainer
impl ServiceContainer
Sourcepub fn register_arc<T: 'static + Send + Sync>(&mut self, service: Arc<T>)
pub fn register_arc<T: 'static + Send + Sync>(&mut self, service: Arc<T>)
Sourcepub fn list_services(&self) -> Vec<String>
pub fn list_services(&self) -> Vec<String>
Lists all registered service types
Trait Implementations§
Source§impl Debug for ServiceContainer
impl Debug for ServiceContainer
Auto Trait Implementations§
impl !RefUnwindSafe for ServiceContainer
impl !UnwindSafe for ServiceContainer
impl Freeze for ServiceContainer
impl Send for ServiceContainer
impl Sync for ServiceContainer
impl Unpin for ServiceContainer
impl UnsafeUnpin for ServiceContainer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more