Trait SliceIndex

Source
pub trait SliceIndex<'a> {
    type Output;

    // Required method
    fn get(self, slice: &NibSlice<'a>) -> Option<Self::Output>;
}
Expand description

A helper trait used for indexing operations

This is modeled after std::slice::SliceIndex, which slight modification to return owned types (as is required for our double-fat slice references).

Required Associated Types§

Source

type Output

Type returned by this indexing

Required Methods§

Source

fn get(self, slice: &NibSlice<'a>) -> Option<Self::Output>

Returns a shared reference to the output at this location, if in bounds.

Implementations on Foreign Types§

Source§

impl<'a> SliceIndex<'a> for usize

Source§

type Output = u8

Source§

fn get(self, slice: &NibSlice<'a>) -> Option<Self::Output>

Source§

impl<'a> SliceIndex<'a> for Range<usize>

Source§

type Output = NibSlice<'a>

Source§

fn get(self, slice: &NibSlice<'a>) -> Option<Self::Output>

Source§

impl<'a> SliceIndex<'a> for RangeFrom<usize>

Source§

type Output = NibSlice<'a>

Source§

fn get(self, slice: &NibSlice<'a>) -> Option<Self::Output>

Source§

impl<'a> SliceIndex<'a> for RangeFull

Source§

type Output = NibSlice<'a>

Source§

fn get(self, slice: &NibSlice<'a>) -> Option<Self::Output>

Source§

impl<'a> SliceIndex<'a> for RangeInclusive<usize>

Source§

type Output = NibSlice<'a>

Source§

fn get(self, slice: &NibSlice<'a>) -> Option<Self::Output>

Source§

impl<'a> SliceIndex<'a> for RangeTo<usize>

Source§

type Output = NibSlice<'a>

Source§

fn get(self, slice: &NibSlice<'a>) -> Option<Self::Output>

Source§

impl<'a> SliceIndex<'a> for RangeToInclusive<usize>

Source§

type Output = NibSlice<'a>

Source§

fn get(self, slice: &NibSlice<'a>) -> Option<Self::Output>

Implementors§