pub struct CountRange<T> { /* private fields */ }Expand description
Inclusive count range with optional upper bound.
Implementations§
Source§impl<T: Copy + Ord> CountRange<T>
impl<T: Copy + Ord> CountRange<T>
Sourcepub const fn unbounded_from(min: T) -> Self
pub const fn unbounded_from(min: T) -> Self
Return an inclusive range with no upper bound.
Sourcepub fn new(min: T, max: Option<T>) -> Option<Self>
pub fn new(min: T, max: Option<T>) -> Option<Self>
Build a validated inclusive range.
Returns None when max is present and min > max.
Sourcepub fn contains_range(self, sub: Self) -> bool
pub fn contains_range(self, sub: Self) -> bool
Return true when sub is wholly contained by this range.
Trait Implementations§
Source§impl<T: Clone> Clone for CountRange<T>
impl<T: Clone> Clone for CountRange<T>
Source§fn clone(&self) -> CountRange<T>
fn clone(&self) -> CountRange<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 CountRange<T>
impl<T: Debug> Debug for CountRange<T>
Source§impl<T: PartialEq> PartialEq for CountRange<T>
impl<T: PartialEq> PartialEq for CountRange<T>
impl<T: Copy> Copy for CountRange<T>
impl<T: Eq> Eq for CountRange<T>
impl<T> StructuralPartialEq for CountRange<T>
Auto Trait Implementations§
impl<T> Freeze for CountRange<T>where
T: Freeze,
impl<T> RefUnwindSafe for CountRange<T>where
T: RefUnwindSafe,
impl<T> Send for CountRange<T>where
T: Send,
impl<T> Sync for CountRange<T>where
T: Sync,
impl<T> Unpin for CountRange<T>where
T: Unpin,
impl<T> UnsafeUnpin for CountRange<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for CountRange<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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.