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: T
Trait 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 for Constant<T>
impl<T: PartialEq> PartialEq for Constant<T>
source§impl<T: PartialOrd> PartialOrd for Constant<T>
impl<T: PartialOrd> PartialOrd 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> StructuralPartialEq for Constant<T>
Auto Trait Implementations§
impl<T> Freeze for Constant<T>where
T: Freeze,
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> 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, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of
Access::load
.