index_vec

Trait IdxSliceIndex

Source
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

Source§

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>

Source§

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>

Source§

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

Source§

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>

Source§

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>

Source§

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>

Source§

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