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
sourceimpl<T: Ord> Ord for Constant<T>
impl<T: Ord> Ord for Constant<T>
sourceimpl<T: PartialOrd> PartialOrd<Constant<T>> for Constant<T>
impl<T: PartialOrd> PartialOrd<Constant<T>> for Constant<T>
sourcefn partial_cmp(&self, other: &Constant<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Constant<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl<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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, A> DynAccess<T> for A where
A: Access<T>,
<A as Access<T>>::Guard: 'static,
impl<T, A> DynAccess<T> for A where
A: Access<T>,
<A as Access<T>>::Guard: 'static,
sourcefn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of Access::load
.