Trait swh_graph::utils::GetIndex

source ·
pub trait GetIndex {
    type Output;

    // Required methods
    fn len(&self) -> usize;
    fn get(&self, index: usize) -> Option<Self::Output>;
    unsafe fn get_unchecked(&self, index: usize) -> Self::Output;
}

Required Associated Types§

Required Methods§

source

fn len(&self) -> usize

Returns the total number of items in the collections

source

fn get(&self, index: usize) -> Option<Self::Output>

Returns an item of the collection

source

unsafe fn get_unchecked(&self, index: usize) -> Self::Output

Returns an item of the collection

Safety

Undefined behavior if the index is past the end of the collection.

Implementors§

source§

impl<D: AsRef<[u8]>, P: AsRef<[u8]>> GetIndex for &FrontCodedList<D, P>

§

type Output = Vec<u8>

source§

impl<E: ByteOrder> GetIndex for &NumberMmap<E, i16, Mmap>

§

type Output = i16

source§

impl<E: ByteOrder> GetIndex for &NumberMmap<E, i64, Mmap>

§

type Output = i64

source§

impl<E: ByteOrder> GetIndex for &NumberMmap<E, u32, Mmap>

§

type Output = u32

source§

impl<E: ByteOrder> GetIndex for &NumberMmap<E, u64, Mmap>

§

type Output = u64

source§

impl<Item: Clone, T: Deref<Target = [Item]>> GetIndex for T

§

type Output = Item