pub struct Container(/* private fields */);Implementations§
Source§impl Container
impl Container
pub fn new() -> Self
pub fn register<T: Clone + 'static>(&self, value: T)
pub fn register_constructor<T: Clone + 'static>( &self, value: impl Fn(Container) -> T + 'static, )
pub fn get<T: Clone + 'static>(&self) -> T
pub fn try_get<T: Clone + 'static>(&self) -> Result<T, GetServiceError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Container
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