pub enum LimitValue<T> {
Limit(T),
Limitless,
}
Expand description
A structure that represents a limit value.
Variants§
Implementations§
Source§impl<T> LimitValue<T>
impl<T> LimitValue<T>
Sourcepub fn is_limitless(&self) -> bool
pub fn is_limitless(&self) -> bool
Verify if this limit is infinite.
Sourcepub fn as_value_or<'a, TF>(&'a self, default: TF) -> &T
pub fn as_value_or<'a, TF>(&'a self, default: TF) -> &T
Get the limit value.
Trait Implementations§
Source§impl<T: Clone> Clone for LimitValue<T>
impl<T: Clone> Clone for LimitValue<T>
Source§fn clone(&self) -> LimitValue<T>
fn clone(&self) -> LimitValue<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for LimitValue<T>
impl<T: Debug> Debug for LimitValue<T>
Source§impl<T: Default> Default for LimitValue<T>
impl<T: Default> Default for LimitValue<T>
Source§impl<T: Display> Display for LimitValue<T>
impl<T: Display> Display for LimitValue<T>
Source§impl<T> From<Option<T>> for LimitValue<T>
impl<T> From<Option<T>> for LimitValue<T>
Source§impl<T: ToString> Hash for LimitValue<T>
impl<T: ToString> Hash for LimitValue<T>
Source§impl<T: Ord> Ord for LimitValue<T>
impl<T: Ord> Ord for LimitValue<T>
Source§fn cmp(&self, other: &LimitValue<T>) -> Ordering
fn cmp(&self, other: &LimitValue<T>) -> Ordering
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 LimitValue<T>
impl<T: PartialEq> PartialEq for LimitValue<T>
Source§impl<T: PartialOrd> PartialOrd for LimitValue<T>
impl<T: PartialOrd> PartialOrd for LimitValue<T>
impl<T: Eq> Eq for LimitValue<T>
Auto Trait Implementations§
impl<T> Freeze for LimitValue<T>where
T: Freeze,
impl<T> RefUnwindSafe for LimitValue<T>where
T: RefUnwindSafe,
impl<T> Send for LimitValue<T>where
T: Send,
impl<T> Sync for LimitValue<T>where
T: Sync,
impl<T> Unpin for LimitValue<T>where
T: Unpin,
impl<T> UnwindSafe for LimitValue<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