pub struct Constant<T>(pub T);Expand description
Access to an constant.
This wraps a constant value to provide Access to it. It is constant in the sense that,
unlike ArcSwapAny and Map, the loaded value will always stay the same (there’s no
remote store).
The purpose is mostly testing and plugging a parameter that works generically from code that doesn’t need the updating functionality.
Tuple Fields§
§0: TTrait Implementations§
source§impl<T: Ord> Ord for Constant<T>
impl<T: Ord> Ord for Constant<T>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: PartialEq> PartialEq<Constant<T>> for Constant<T>
impl<T: PartialEq> PartialEq<Constant<T>> for Constant<T>
source§impl<T: PartialOrd> PartialOrd<Constant<T>> for Constant<T>
impl<T: PartialOrd> PartialOrd<Constant<T>> for Constant<T>
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<T: Copy> Copy for Constant<T>
impl<T: Eq> Eq for Constant<T>
impl<T> StructuralEq for Constant<T>
impl<T> StructuralPartialEq for Constant<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Constant<T>where
T: RefUnwindSafe,
impl<T> Send for Constant<T>where
T: Send,
impl<T> Sync for Constant<T>where
T: Sync,
impl<T> Unpin for Constant<T>where
T: Unpin,
impl<T> UnwindSafe for Constant<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T, A> DynAccess<T> for Awhere
A: Access<T>,
<A as Access<T>>::Guard: 'static,
impl<T, A> DynAccess<T> for Awhere
A: Access<T>,
<A as Access<T>>::Guard: 'static,
source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of
Access::load.