pub struct InRange<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> Finite for InRange<A, B>
impl<const A: usize, const B: usize> Finite for InRange<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 InRange<A, B>
impl<const A: usize, const B: usize> InRangeBounds for InRange<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 InRange<A, B>
impl<const A: usize, const B: usize> Ord for InRange<A, B>
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 InRange<A, B>
impl<const A: usize, const B: usize> PartialOrd for InRange<A, B>
impl<const A: usize, const B: usize> Copy for InRange<A, B>
impl<const A: usize, const B: usize> Eq for InRange<A, B>
impl<const A: usize, const B: usize> StructuralPartialEq for InRange<A, B>
Auto Trait Implementations§
impl<const A: usize, const B: usize> Freeze for InRange<A, B>
impl<const A: usize, const B: usize> RefUnwindSafe for InRange<A, B>
impl<const A: usize, const B: usize> Send for InRange<A, B>
impl<const A: usize, const B: usize> Sync for InRange<A, B>
impl<const A: usize, const B: usize> Unpin for InRange<A, B>
impl<const A: usize, const B: usize> UnwindSafe for InRange<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