[][src]Trait heaparray::CopyMap

pub trait CopyMap<K, V, E = (K, V)>: Container<E> where
    K: Copy + Eq
{ fn get(&self, key: K) -> Option<&V>;
fn get_mut(&mut self, key: K) -> Option<&mut V>;
fn insert(&mut self, k: K, v: V) -> Option<V>; }

Trait for a container indexed by a value that implements copy. The value that indexes the container must implement the Eq trait to.

Required methods

fn get(&self, key: K) -> Option<&V>

Get a value from this Map. Takes a key by reference and returns a reference to the corresponding data, or None if none exists.

fn get_mut(&mut self, key: K) -> Option<&mut V>

Returns a mutable reference to an object stored in this container based on the key given, or None if the key does not exist.

fn insert(&mut self, k: K, v: V) -> Option<V>

Adds a new item into this container with the associated key, and returns the previous value associated with that key, if it existed.

Loading content...

Implementors

impl<'a, L, E> CopyMap<usize, E, (usize, E)> for FatPtrArray<'a, L, E>[src]

impl<'a, L, E> CopyMap<usize, E, (usize, E)> for ThinPtrArray<'a, L, E>[src]

Loading content...