pub enum ProviderLifetime {
Singleton,
Transient,
Request,
}Expand description
Provider creation and reuse strategy.
Variants§
Singleton
Create once and reuse for all resolutions.
Transient
Create a fresh value on every resolution.
Request
Create per request when request scopes are enabled.
Trait Implementations§
Source§impl Clone for ProviderLifetime
impl Clone for ProviderLifetime
Source§fn clone(&self) -> ProviderLifetime
fn clone(&self) -> ProviderLifetime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ProviderLifetime
Source§impl Debug for ProviderLifetime
impl Debug for ProviderLifetime
impl Eq for ProviderLifetime
Source§impl PartialEq for ProviderLifetime
impl PartialEq for ProviderLifetime
impl StructuralPartialEq for ProviderLifetime
Auto Trait Implementations§
impl Freeze for ProviderLifetime
impl RefUnwindSafe for ProviderLifetime
impl Send for ProviderLifetime
impl Sync for ProviderLifetime
impl Unpin for ProviderLifetime
impl UnsafeUnpin for ProviderLifetime
impl UnwindSafe for ProviderLifetime
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.