pub trait MapLike<K, V> {
// Required methods
fn insert(&mut self, k: K, v: V) -> Option<V>;
fn extend(&mut self, iter: impl Iterator<Item = (K, V)>);
fn contains_key(&self, t: &K) -> bool;
fn remove(&mut self, t: &K) -> Option<V>;
fn get(&self, k: &K) -> Option<&V>;
fn get_mut(&mut self, k: &K) -> Option<&mut V>;
fn keys<'a>(&'a self) -> impl Iterator<Item = &'a K>
where K: 'a;
}Required Methods§
fn insert(&mut self, k: K, v: V) -> Option<V>
fn extend(&mut self, iter: impl Iterator<Item = (K, V)>)
fn contains_key(&self, t: &K) -> bool
fn remove(&mut self, t: &K) -> Option<V>
fn get(&self, k: &K) -> Option<&V>
fn get_mut(&mut self, k: &K) -> Option<&mut V>
fn keys<'a>(&'a self) -> impl Iterator<Item = &'a K>where
K: 'a,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.