Trait mz_ore::collections::AssociativeExt
source · pub trait AssociativeExt<K, V> {
// Required method
fn expect_insert(&mut self, k: K, v: V, msg: &str);
// Provided method
fn unwrap_insert(&mut self, k: K, v: V) { ... }
}
Expand description
Extension methods for associative collections.
Required Methods§
sourcefn expect_insert(&mut self, k: K, v: V, msg: &str)
fn expect_insert(&mut self, k: K, v: V, msg: &str)
Inserts a key and value, panicking with a given message if a true insert (as opposed to an update) cannot be done because the key already existed in the collection.
Provided Methods§
sourcefn unwrap_insert(&mut self, k: K, v: V)
fn unwrap_insert(&mut self, k: K, v: V)
Inserts a key and value, panicking if a true insert (as opposed to an update) cannot be done because the key already existed in the collection.