Skip to main content

Insert

Trait Insert 

Source
pub trait Insert<K, V = ()>: Collection {
    // Required method
    fn insert(&mut self, key: K, value: V) -> Option<V>;
}

Required Methods§

Source

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

Insert the (key, value), and return the old value

Implementations on Foreign Types§

Source§

impl<K, Gen, S> Insert<K> for GenSetOf<K, Gen, S>
where K: Clone, Gen: IGeneration, S: Insert<K, GenIDOf<K, Gen>>,

Source§

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

Source§

impl<K, V, Gen, S> Insert<K, V> for GenMapOf<K, V, Gen, S>
where K: Clone, Gen: IGeneration, S: Insert<K, GenIDOf<V, Gen>>,

Source§

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

Implementors§

Source§

impl<K> Insert<K> for BTreeSet<K>
where K: Ord,

Source§

impl<K, S> Insert<K> for HashSet<K, S>
where K: Eq + Hash, S: BuildHasher,

Available on crate feature std only.
Source§

impl<K, V> Insert<K, V> for BTreeMap<K, V>
where K: Ord,

Source§

impl<K, V, S> Insert<K, V> for HashMap<K, V, S>
where K: Eq + Hash, S: BuildHasher,

Available on crate feature std only.