pub trait EventMap<K, V> {
type Item;
type Values<'a>: Iterator<Item = &'a V>
where Self: 'a,
K: 'a,
V: 'a;
// Required methods
fn new() -> Self;
fn get(&self, querry: &K) -> Option<&V>;
fn values(&self) -> Self::Values<'_>;
fn insert(&mut self, k: K, v: V) -> V;
fn insert_with<F>(&mut self, k: K, f: F) -> V
where F: FnOnce() -> V;
fn remove(&mut self, querry: &K) -> Option<V>;
fn clear(&mut self);
fn is_empty(&self) -> bool;
}Required Associated Types§
Required Methods§
fn new() -> Self
fn get(&self, querry: &K) -> Option<&V>
fn values(&self) -> Self::Values<'_>
Sourcefn insert(&mut self, k: K, v: V) -> V
fn insert(&mut self, k: K, v: V) -> V
Don’t override existent entry, but return its values instead of the one wanted to insert
fn insert_with<F>(&mut self, k: K, f: F) -> Vwhere
F: FnOnce() -> V,
fn remove(&mut self, querry: &K) -> Option<V>
fn clear(&mut self)
fn is_empty(&self) -> bool
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.