pub struct Container<'a>(/* private fields */);
Implementations§
Source§impl<'a> Container<'a>
impl<'a> Container<'a>
pub fn new() -> Self
pub fn construct<T: Clone + 'static>(&self) -> T
pub fn try_construct<T: Clone + 'static>(&self) -> Result<T, Error<T>>
pub fn register_service<T: Clone + 'static>(&self, value: T)
pub fn try_register_service<T: Clone + 'static>( &self, value: T, ) -> Result<(), Error<T>>
pub fn register_constructor<T: Clone + 'static>( &self, value: impl Fn(Container<'_>) -> T + 'a, )
pub fn try_register_constructor<T: Clone + 'static>( &self, value: impl Fn(Container<'_>) -> T + 'a, ) -> Result<(), Error<T>>
pub fn get<T: Clone + 'static>(&self) -> T
pub fn try_get<T: Clone + 'static>(&self) -> Result<T, Error<T>>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Container<'a>
impl<'a> RefUnwindSafe for Container<'a>
impl<'a> !Send for Container<'a>
impl<'a> !Sync for Container<'a>
impl<'a> Unpin for Container<'a>
impl<'a> UnwindSafe for Container<'a>
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