pub struct InRange<A: Unsigned, B>{ /* 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<A: Unsigned, B> Finite for InRange<A, B>
impl<A: Unsigned, B> Finite for InRange<A, B>
Source§type INHABITANTS = <InRange<A, B> as InRangeBounds>::INHABITANTS
type INHABITANTS = <InRange<A, B> as InRangeBounds>::INHABITANTS
The total number of different inhabitants of the type. Read more
Source§impl<A: Unsigned, B> InRangeBounds for InRange<A, B>
impl<A: Unsigned, B> InRangeBounds for InRange<A, B>
Source§type INHABITANTS = <B as Sub<A>>::Output
type INHABITANTS = <B as Sub<A>>::Output
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<A: Ord + Unsigned, B> Ord for InRange<A, B>
impl<A: Ord + Unsigned, B> 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<A: PartialOrd + Unsigned, B> PartialOrd for InRange<A, B>
impl<A: PartialOrd + Unsigned, B> PartialOrd for InRange<A, B>
impl<A: Copy + Unsigned, B> Copy for InRange<A, B>
impl<A: Eq + Unsigned, B> Eq for InRange<A, B>
impl<A: Unsigned, B> StructuralPartialEq for InRange<A, B>
Auto Trait Implementations§
impl<A, B> Freeze for InRange<A, B>
impl<A, B> RefUnwindSafe for InRange<A, B>
impl<A, B> Send for InRange<A, B>
impl<A, B> Sync for InRange<A, B>
impl<A, B> Unpin for InRange<A, B>
impl<A, B> 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