Trait InsertAndExtend

Source
pub trait InsertAndExtend<K, V>: Default {
    // Required method
    fn insert_and_extend(&mut self, key: K, value: V);
}
Expand description

A trait for mapping types to serve as a trivial wrapper over the Entry interface.

Required Methods§

Source

fn insert_and_extend(&mut self, key: K, value: V)

Creates collection with the given key if necessary and extends it with the given value.

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.

Implementations on Foreign Types§

Source§

impl<K, V, E> InsertAndExtend<K, V> for BTreeMap<K, E>
where K: Ord, E: Default + Extend<V>,

Source§

fn insert_and_extend(&mut self, key: K, value: V)

Source§

impl<K, V, E, H> InsertAndExtend<K, V> for HashMap<K, E, H>
where K: Eq + Hash, E: Default + Extend<V>, H: BuildHasher + Default,

Source§

fn insert_and_extend(&mut self, key: K, value: V)

Implementors§