[−][src]Trait containers_rs::CopyMap
Trait for a container indexed by a value that implements Copy
and Eq
.
Required methods
fn get(&self, key: K) -> Option<&V>
Get a reference to a value from this map.
Takes a key by value
and returns a reference to the corresponding data,
or None
if the key doesn't exist in the map.
fn get_mut(&mut self, key: K) -> Option<&mut V>
Get a mutable reference to a value from this map.
Takes a key by value
and returns a mutable reference to the corresponding data,
or None
if the key doesn't exist in the map.
fn insert(&mut self, k: K, v: V) -> Option<V>
Inserts a key-value pair into the map.
If the map did not have this key present, None is returned.
If the map did have this key present, the value is updated, and the old value is returned. Note that the key itself isn't necessarily updated.