Trait stride::StrideIndex [−][src]
A helper trait used for indexing operations.
This is the Stride
version of SliceIndex
.
You should not use or implement this trait directly but instead use the
corresponding methods on Stride
.
Associated Types
Loading content...Required methods
fn get(self, stride: &T) -> Option<&Self::Output>
[src]
Returns a shared reference to the output at this location, if in bounds.
fn get_mut(self, stride: &mut T) -> Option<&mut Self::Output>
[src]
Returns a mutable reference to the output at this location, if in bounds.
unsafe fn get_unchecked(self, stride: *const T) -> *const Self::Output
[src]
Returns a shared reference to the output at this location, without performing any bounds checking.
Safety
Calling this method with an out-of-bounds index or a dangling stride
pointer
is undefined behavior even if the resulting reference is not used.
unsafe fn get_unchecked_mut(self, stride: *mut T) -> *mut Self::Output
[src]
Returns a mutable reference to the output at this location, without performing any bounds checking.
Safety
Calling this method with an out-of-bounds index or a dangling stride
pointer
is undefined behavior even if the resulting reference is not used.
fn index(self, stride: &T) -> &Self::Output
[src]
Returns a shared reference to the output at this location, panicking if out of bounds.
fn index_mut(self, stride: &mut T) -> &mut Self::Output
[src]
Returns a mutable reference to the output at this location, panicking if out of bounds.
Implementations on Foreign Types
impl<T, const S: usize> StrideIndex<Stride<T, S>> for Range<usize>
[src]
type Output = Stride<T, S>
fn get(self, stride: &Stride<T, S>) -> Option<&Self::Output>
[src]
fn get_mut(self, stride: &mut Stride<T, S>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(
self,
stride: *const Stride<T, S>
) -> *const Self::Output
[src]
self,
stride: *const Stride<T, S>
) -> *const Self::Output
unsafe fn get_unchecked_mut(
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
[src]
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
fn index(self, stride: &Stride<T, S>) -> &Self::Output
[src]
fn index_mut(self, stride: &mut Stride<T, S>) -> &mut Self::Output
[src]
impl<T, const S: usize> StrideIndex<Stride<T, S>> for RangeFrom<usize>
[src]
type Output = Stride<T, S>
fn get(self, stride: &Stride<T, S>) -> Option<&Self::Output>
[src]
fn get_mut(self, stride: &mut Stride<T, S>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(
self,
stride: *const Stride<T, S>
) -> *const Self::Output
[src]
self,
stride: *const Stride<T, S>
) -> *const Self::Output
unsafe fn get_unchecked_mut(
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
[src]
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
fn index(self, stride: &Stride<T, S>) -> &Self::Output
[src]
fn index_mut(self, stride: &mut Stride<T, S>) -> &mut Self::Output
[src]
impl<T, const S: usize> StrideIndex<Stride<T, S>> for RangeFull
[src]
type Output = Stride<T, S>
fn get(self, stride: &Stride<T, S>) -> Option<&Self::Output>
[src]
fn get_mut(self, stride: &mut Stride<T, S>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(
self,
stride: *const Stride<T, S>
) -> *const Self::Output
[src]
self,
stride: *const Stride<T, S>
) -> *const Self::Output
unsafe fn get_unchecked_mut(
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
[src]
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
fn index(self, stride: &Stride<T, S>) -> &Self::Output
[src]
fn index_mut(self, stride: &mut Stride<T, S>) -> &mut Self::Output
[src]
impl<T, const S: usize> StrideIndex<Stride<T, S>> for RangeInclusive<usize>
[src]
type Output = Stride<T, S>
fn get(self, stride: &Stride<T, S>) -> Option<&Self::Output>
[src]
fn get_mut(self, stride: &mut Stride<T, S>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(
self,
stride: *const Stride<T, S>
) -> *const Self::Output
[src]
self,
stride: *const Stride<T, S>
) -> *const Self::Output
unsafe fn get_unchecked_mut(
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
[src]
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
fn index(self, stride: &Stride<T, S>) -> &Self::Output
[src]
fn index_mut(self, stride: &mut Stride<T, S>) -> &mut Self::Output
[src]
impl<T, const S: usize> StrideIndex<Stride<T, S>> for RangeTo<usize>
[src]
type Output = Stride<T, S>
fn get(self, stride: &Stride<T, S>) -> Option<&Self::Output>
[src]
fn get_mut(self, stride: &mut Stride<T, S>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(
self,
stride: *const Stride<T, S>
) -> *const Self::Output
[src]
self,
stride: *const Stride<T, S>
) -> *const Self::Output
unsafe fn get_unchecked_mut(
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
[src]
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
fn index(self, stride: &Stride<T, S>) -> &Self::Output
[src]
fn index_mut(self, stride: &mut Stride<T, S>) -> &mut Self::Output
[src]
impl<T, const S: usize> StrideIndex<Stride<T, S>> for RangeToInclusive<usize>
[src]
type Output = Stride<T, S>
fn get(self, stride: &Stride<T, S>) -> Option<&Self::Output>
[src]
fn get_mut(self, stride: &mut Stride<T, S>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(
self,
stride: *const Stride<T, S>
) -> *const Self::Output
[src]
self,
stride: *const Stride<T, S>
) -> *const Self::Output
unsafe fn get_unchecked_mut(
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
[src]
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
fn index(self, stride: &Stride<T, S>) -> &Self::Output
[src]
fn index_mut(self, stride: &mut Stride<T, S>) -> &mut Self::Output
[src]
Implementors
impl<T, const S: usize> StrideIndex<Stride<T, S>> for usize
[src]
type Output = T
fn get(self, stride: &Stride<T, S>) -> Option<&Self::Output>
[src]
fn get_mut(self, stride: &mut Stride<T, S>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(
self,
stride: *const Stride<T, S>
) -> *const Self::Output
[src]
self,
stride: *const Stride<T, S>
) -> *const Self::Output
unsafe fn get_unchecked_mut(
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output
[src]
self,
stride: *mut Stride<T, S>
) -> *mut Self::Output