pub struct Idx<'n, I: Index = usize> { /* private fields */ }Expand description
Implementations§
Source§impl<'n, I: Index> Idx<'n, I>
impl<'n, I: Index> Idx<'n, I>
Sourcepub const unsafe fn new_unbound(idx: I) -> Self
pub const unsafe fn new_unbound(idx: I) -> Self
Sourcepub unsafe fn new_unchecked(idx: I, dim: Dim<'n>) -> Self
pub unsafe fn new_unchecked(idx: I, dim: Dim<'n>) -> Self
create new branded value with the same brand as Dim.
§safety
the behavior is undefined unless idx < dim and idx <= i::signed::max.
Sourcepub fn new_checked(idx: I, dim: Dim<'n>) -> Self
pub fn new_checked(idx: I, dim: Dim<'n>) -> Self
create new branded value with the same brand as Dim.
§panics
panics unless idx < dim and idx <= i::signed::max.
Source§impl<'n, I: Index> Idx<'n, I>
impl<'n, I: Index> Idx<'n, I>
Sourcepub const fn to_incl(self) -> IdxInc<'n, I>
pub const fn to_incl(self) -> IdxInc<'n, I>
returns the index, bounded inclusively by the value tied to 'n.
Sourcepub fn next(self) -> IdxInc<'n, I>
pub fn next(self) -> IdxInc<'n, I>
returns the next index, bounded inclusively by the value tied to 'n.
Sourcepub fn excl(self) -> IdxInc<'n, I>
pub fn excl(self) -> IdxInc<'n, I>
returns the index, bounded inclusively by the value tied to 'n.
Sourcepub fn from_slice_mut_checked<'a>(
slice: &'a mut [I],
size: Dim<'n>,
) -> &'a mut [Idx<'n, I>]
pub fn from_slice_mut_checked<'a>( slice: &'a mut [I], size: Dim<'n>, ) -> &'a mut [Idx<'n, I>]
assert that the values of slice are all bounded by size.
Sourcepub unsafe fn from_slice_mut_unchecked<'a>(
slice: &'a mut [I],
) -> &'a mut [Idx<'n, I>]
pub unsafe fn from_slice_mut_unchecked<'a>( slice: &'a mut [I], ) -> &'a mut [Idx<'n, I>]
assume that the values of slice are all bounded by the value tied to 'n.
Sourcepub fn from_slice_ref_checked<'a>(
slice: &'a [I],
size: Dim<'n>,
) -> &'a [Idx<'n, I>]
pub fn from_slice_ref_checked<'a>( slice: &'a [I], size: Dim<'n>, ) -> &'a [Idx<'n, I>]
assert that the values of slice are all bounded by size.
Sourcepub unsafe fn from_slice_ref_unchecked<'a>(slice: &'a [I]) -> &'a [Idx<'n, I>]
pub unsafe fn from_slice_ref_unchecked<'a>(slice: &'a [I]) -> &'a [Idx<'n, I>]
assume that the values of slice are all bounded by the value tied to 'n.
Trait Implementations§
Source§impl<'n, I: Ord + Index> Ord for Idx<'n, I>
impl<'n, I: Ord + Index> Ord for Idx<'n, I>
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: Index> PartialOrd<Dim<'n>> for Idx<'n, I>
impl<'n, I: Index> PartialOrd<Dim<'n>> for Idx<'n, I>
Source§impl<'n, I: PartialOrd + Index> PartialOrd for Idx<'n, I>
impl<'n, I: PartialOrd + Index> PartialOrd for Idx<'n, I>
impl<'n, I: Copy + Index> Copy for Idx<'n, I>
impl<'n, I: Eq + Index> Eq for Idx<'n, I>
impl<'n, I: Index> StructuralPartialEq for Idx<'n, I>
Auto Trait Implementations§
impl<'n, I> Freeze for Idx<'n, I>where
I: Freeze,
impl<'n, I> RefUnwindSafe for Idx<'n, I>where
I: RefUnwindSafe,
impl<'n, I> Send for Idx<'n, I>
impl<'n, I> Sync for Idx<'n, I>
impl<'n, I> Unpin for Idx<'n, I>where
I: Unpin,
impl<'n, I> UnwindSafe for Idx<'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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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