pub enum ServiceLifetime {
Transient,
Scoped,
Singleton,
}Expand description
Service lifetime enum — defines how instances are cached.
Transient: new instance every resolution (never cached)Scoped: one instance per scope (cached within the scope)Singleton: one instance shared across all scopes (cached globally)
Variants§
Trait Implementations§
Source§impl Clone for ServiceLifetime
impl Clone for ServiceLifetime
impl Copy for ServiceLifetime
Source§impl Debug for ServiceLifetime
impl Debug for ServiceLifetime
impl Eq for ServiceLifetime
Source§impl Hash for ServiceLifetime
impl Hash for ServiceLifetime
Source§impl PartialEq for ServiceLifetime
impl PartialEq for ServiceLifetime
impl StructuralPartialEq for ServiceLifetime
Auto Trait Implementations§
impl Forget for ServiceLifetime
impl Freeze for ServiceLifetime
impl Move for ServiceLifetime
impl RefUnwindSafe for ServiceLifetime
impl Send for ServiceLifetime
impl Sync for ServiceLifetime
impl Unpin for ServiceLifetime
impl UnsafeUnpin for ServiceLifetime
impl UnwindSafe for ServiceLifetime
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