pub trait IdxSliceIndex<I: Idx, T>: Sealed {
    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

Implementations on Foreign Types§

source§

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

§

type Output = T

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

source§

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

§

type Output = IndexSlice<I, [T]>

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

source§

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

§

type Output = IndexSlice<I, [T]>

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

source§

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

§

type Output = IndexSlice<I, [T]>

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

source§

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

§

type Output = IndexSlice<I, [T]>

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

source§

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

§

type Output = IndexSlice<I, [T]>

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

source§

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

§

type Output = IndexSlice<I, [T]>

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

Implementors§

source§

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

§

type Output = T