pub struct RangeUsize<const MIN: usize, const MAX: usize>(/* private fields */);
Expand description
Represents ranged type over a bounded range of values.
Implementations§
Source§impl<const MIN: usize, const MAX: usize> RangeUsize<MIN, MAX>
impl<const MIN: usize, const MAX: usize> RangeUsize<MIN, MAX>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new RangeUsize.
Sourcepub const fn try_from_inner(val: usize) -> Result<Self>
pub const fn try_from_inner(val: usize) -> Result<Self>
Attempts to convert a raw index value into a RangeUsize.
Sourcepub const fn try_from_unchecked(val: usize) -> Self
pub const fn try_from_unchecked(val: usize) -> Self
Converts a raw index value into a RangeUsize with no bounds check.
§Panics
Panics if the provided index is out-of-bounds.
Caller must ensure that the index is in the valid range.
Sourcepub const fn into_inner(self) -> usize
pub const fn into_inner(self) -> usize
Converts a RangeUsize into a raw index value.
Trait Implementations§
Source§impl<const MIN: usize, const MAX: usize> Clone for RangeUsize<MIN, MAX>
impl<const MIN: usize, const MAX: usize> Clone for RangeUsize<MIN, MAX>
Source§fn clone(&self) -> RangeUsize<MIN, MAX>
fn clone(&self) -> RangeUsize<MIN, MAX>
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 MIN: usize, const MAX: usize> From<RangeUsize<MIN, MAX>> for usize
impl<const MIN: usize, const MAX: usize> From<RangeUsize<MIN, MAX>> for usize
Source§fn from(val: RangeUsize<MIN, MAX>) -> Self
fn from(val: RangeUsize<MIN, MAX>) -> Self
Converts to this type from the input type.
impl<const MIN: usize, const MAX: usize> Copy for RangeUsize<MIN, MAX>
impl<const MIN: usize, const MAX: usize> Eq for RangeUsize<MIN, MAX>
impl<const MIN: usize, const MAX: usize> StructuralPartialEq for RangeUsize<MIN, MAX>
Auto Trait Implementations§
impl<const MIN: usize, const MAX: usize> Freeze for RangeUsize<MIN, MAX>
impl<const MIN: usize, const MAX: usize> RefUnwindSafe for RangeUsize<MIN, MAX>
impl<const MIN: usize, const MAX: usize> Send for RangeUsize<MIN, MAX>
impl<const MIN: usize, const MAX: usize> Sync for RangeUsize<MIN, MAX>
impl<const MIN: usize, const MAX: usize> Unpin for RangeUsize<MIN, MAX>
impl<const MIN: usize, const MAX: usize> UnwindSafe for RangeUsize<MIN, MAX>
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