pub trait CopyMap<K, V>: Container{
// Required methods
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>;
}
Expand description
Trait for a container indexed by a value that implements Copy
and Eq
.
Required Methods§
Sourcefn get(&self, key: K) -> Option<&V>
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.