pub struct IdxInclusive<'n, I>(/* private fields */);
Expand description
I
value smaller or equal to the size corresponding to the lifetime 'n
.
Implementations§
Source§impl<'n> IdxInclusive<'n, usize>
impl<'n> IdxInclusive<'n, usize>
Sourcepub fn range_to(
self,
last: Self,
) -> impl DoubleEndedIterator<Item = Idx<'n, usize>>
pub fn range_to( self, last: Self, ) -> impl DoubleEndedIterator<Item = Idx<'n, usize>>
Returns an iterator over constrained indices from 0
to self
(exclusive).
Source§impl<'n, I: Index> IdxInclusive<'n, I>
impl<'n, I: Index> IdxInclusive<'n, I>
Sourcepub fn new_checked(idx: I, size: Size<'n>) -> Self
pub fn new_checked(idx: I, size: Size<'n>) -> Self
Returns a constrained inclusive index after checking that it’s bounded (inclusively) by
size
.
Sourcepub unsafe fn new_unchecked(idx: I, size: Size<'n>) -> Self
pub unsafe fn new_unchecked(idx: I, size: Size<'n>) -> Self
Returns a constrained inclusive index, assuming that it’s bounded (inclusively) by
size
.
Sourcepub unsafe fn new_raw_unchecked(idx: I) -> Self
pub unsafe fn new_raw_unchecked(idx: I) -> Self
Returns a constrained inclusive index, assuming that it’s bounded (inclusively) by
the size tied to 'n
.
Sourcepub fn into_inner(self) -> I
pub fn into_inner(self) -> I
Returns the unconstrained value.
Trait Implementations§
Source§impl<'n, I: Clone> Clone for IdxInclusive<'n, I>
impl<'n, I: Clone> Clone for IdxInclusive<'n, I>
Source§fn clone(&self) -> IdxInclusive<'n, I>
fn clone(&self) -> IdxInclusive<'n, I>
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<I: Debug> Debug for IdxInclusive<'_, I>
impl<I: Debug> Debug for IdxInclusive<'_, I>
Source§impl<I> Deref for IdxInclusive<'_, I>
impl<I> Deref for IdxInclusive<'_, I>
Source§impl<'n, I: Ord> Ord for IdxInclusive<'n, I>
impl<'n, I: Ord> Ord for IdxInclusive<'n, I>
Source§fn cmp(&self, other: &IdxInclusive<'n, I>) -> Ordering
fn cmp(&self, other: &IdxInclusive<'n, I>) -> 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<'n, I: PartialEq> PartialEq for IdxInclusive<'n, I>
impl<'n, I: PartialEq> PartialEq for IdxInclusive<'n, I>
Source§impl<'n, I: PartialOrd> PartialOrd for IdxInclusive<'n, I>
impl<'n, I: PartialOrd> PartialOrd for IdxInclusive<'n, I>
impl<'n, I: Copy> Copy for IdxInclusive<'n, I>
impl<'n, I: Eq> Eq for IdxInclusive<'n, I>
impl<'n, I> StructuralPartialEq for IdxInclusive<'n, I>
Auto Trait Implementations§
impl<'n, I> Freeze for IdxInclusive<'n, I>where
I: Freeze,
impl<'n, I> RefUnwindSafe for IdxInclusive<'n, I>where
I: RefUnwindSafe,
impl<'n, I> Send for IdxInclusive<'n, I>where
I: Send,
impl<'n, I> Sync for IdxInclusive<'n, I>where
I: Sync,
impl<'n, I> Unpin for IdxInclusive<'n, I>where
I: Unpin,
impl<'n, I> UnwindSafe for IdxInclusive<'n, I>where
I: 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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more