pub struct InRangeInclusive<const A: usize, const B: usize>(/* private fields */);Expand description
A usize value that is guaranteed to be in the range A..=B.
Common methods are in the InRangeBounds trait implementation.
Trait Implementations§
Source§impl<const A: usize, const B: usize> Clone for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> Clone for InRangeInclusive<A, B>
Source§fn clone(&self) -> InRangeInclusive<A, B>
fn clone(&self) -> InRangeInclusive<A, B>
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<const A: usize, const B: usize> Finite for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> Finite for InRangeInclusive<A, B>
Source§const INHABITANTS: usize = <Self as InRangeBounds>::INHABITANTS
const INHABITANTS: usize = <Self as InRangeBounds>::INHABITANTS
The total number of different inhabitants of the type.
Source§impl<const A: usize, const B: usize> InRangeBounds for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> InRangeBounds for InRangeInclusive<A, B>
Source§const INHABITANTS: usize
const INHABITANTS: usize
The number of values representable.
Source§unsafe fn new_unchecked(i: usize) -> Self
unsafe fn new_unchecked(i: usize) -> Self
Creates a value without checking whether the value is in range. This results in undefined behavior if the value is not in range. Read more
Source§fn new_from_start_offset(offset: usize) -> Option<Self>
fn new_from_start_offset(offset: usize) -> Option<Self>
Same as
InRangeBounds::new(Self::MIN + i).Source§impl<const A: usize, const B: usize> Ord for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> Ord for InRangeInclusive<A, B>
Source§fn cmp(&self, other: &InRangeInclusive<A, B>) -> Ordering
fn cmp(&self, other: &InRangeInclusive<A, B>) -> 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<const A: usize, const B: usize> PartialOrd for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> PartialOrd for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> Copy for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> Eq for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> StructuralPartialEq for InRangeInclusive<A, B>
Auto Trait Implementations§
impl<const A: usize, const B: usize> Freeze for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> RefUnwindSafe for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> Send for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> Sync for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> Unpin for InRangeInclusive<A, B>
impl<const A: usize, const B: usize> UnwindSafe for InRangeInclusive<A, B>
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