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: PartialOrd> PartialOrd for Constant<T>
impl<T: PartialOrd> PartialOrd for Constant<T>
impl<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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.