MapInsert

Trait MapInsert 

Source
pub trait MapInsert<K>: Collection {
    type Output;

    // Required method
    fn insert(&mut self, key: K, value: Self::Item) -> Self::Output;
}
Expand description

Mutable map where new new key-value pairs can be inserted.

Required Associated Types§

Source

type Output

The output of the insertion function.

Required Methods§

Source

fn insert(&mut self, key: K, value: Self::Item) -> Self::Output

Insert a new key-value pair in the collection.

Implementations on Foreign Types§

Source§

impl<K: Ord, V> MapInsert<K> for BTreeMap<K, V>

Source§

type Output = Option<V>

Source§

fn insert(&mut self, key: K, value: V) -> Option<V>

Source§

impl<K: Hash + Eq, V> MapInsert<K> for HashMap<K, V>

Source§

type Output = Option<V>

Source§

fn insert(&mut self, key: K, value: V) -> Option<V>

Implementors§