pub enum Scope {
Singleton,
Transient,
SingleOwner,
}
Expand description
Represents the scope of the provider.
Variants§
Singleton
singleton scope.
- the constructor run only once.
- the type implements
Clone
trait. - instances taken from context can be either instances with ownership or reference instances.
Transient
transient scope.
- the constructor run every time.
- instances taken from the context are instances with ownership.
SingleOwner
single owner scope.
- the constructor run only once.
- instances taken from the context are reference instances.
Trait Implementations§
source§impl Ord for Scope
impl Ord for Scope
source§impl PartialEq for Scope
impl PartialEq for Scope
source§impl PartialOrd for Scope
impl PartialOrd for Scope
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Scope
impl Eq for Scope
impl StructuralPartialEq for Scope
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnwindSafe for Scope
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