Skip to main content

IdxSliceIndex

Trait IdxSliceIndex 

Source
pub trait IdxSliceIndex<I, T>: Sealed
where I: Idx,
{ type Output: ?Sized; // Required methods fn get(self, slice: &IndexSlice<I, [T]>) -> Option<&Self::Output>; fn get_mut( self, slice: &mut IndexSlice<I, [T]>, ) -> Option<&mut Self::Output>; fn index(self, slice: &IndexSlice<I, [T]>) -> &Self::Output; fn index_mut(self, slice: &mut IndexSlice<I, [T]>) -> &mut Self::Output; }
Expand description

This is the equivalent of the sealed core::slice::SliceIndex trait. It cannot be overridden from user, code nor should it normally need use directly (Outside of trait bounds, I guess).

Required Associated Types§

Required Methods§

Source

fn get(self, slice: &IndexSlice<I, [T]>) -> Option<&Self::Output>

Source

fn get_mut(self, slice: &mut IndexSlice<I, [T]>) -> Option<&mut Self::Output>

Source

fn index(self, slice: &IndexSlice<I, [T]>) -> &Self::Output

Source

fn index_mut(self, slice: &mut IndexSlice<I, [T]>) -> &mut Self::Output

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<I, T> IdxSliceIndex<I, T> for usize
where I: Idx,

Source§

type Output = T

Source§

fn get( self, slice: &IndexSlice<I, [T]>, ) -> Option<&<usize as IdxSliceIndex<I, T>>::Output>

Source§

fn get_mut( self, slice: &mut IndexSlice<I, [T]>, ) -> Option<&mut <usize as IdxSliceIndex<I, T>>::Output>

Source§

fn index( self, slice: &IndexSlice<I, [T]>, ) -> &<usize as IdxSliceIndex<I, T>>::Output

Source§

fn index_mut( self, slice: &mut IndexSlice<I, [T]>, ) -> &mut <usize as IdxSliceIndex<I, T>>::Output

Implementors§

Source§

impl<I, T> IdxSliceIndex<I, T> for Range<I>
where I: Idx,

Source§

impl<I, T> IdxSliceIndex<I, T> for RangeFrom<I>
where I: Idx,

Source§

impl<I, T> IdxSliceIndex<I, T> for RangeFull
where I: Idx,

Source§

impl<I, T> IdxSliceIndex<I, T> for RangeInclusive<I>
where I: Idx,

Source§

impl<I, T> IdxSliceIndex<I, T> for RangeTo<I>
where I: Idx,

Source§

impl<I, T> IdxSliceIndex<I, T> for RangeToInclusive<I>
where I: Idx,

Source§

impl<I, T> IdxSliceIndex<I, T> for I
where I: Idx,