Trait 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§