Trait StoreBulkMut

Source
pub trait StoreBulkMut<K, V>: StoreMut<K, V> {
    // Required methods
    fn lm_retain<F>(&mut self, predicate: F)
       where F: FnMut(&K, &V) -> bool;
    fn lm_extend<I>(&mut self, other: I)
       where I: IntoIterator<Item = (K, V)>;
}

Required Methods§

Source

fn lm_retain<F>(&mut self, predicate: F)
where F: FnMut(&K, &V) -> bool,

Retains items satisfying a predicate in this store.

Source

fn lm_extend<I>(&mut self, other: I)
where I: IntoIterator<Item = (K, V)>,

Extends this store with items from an iterator.

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: Ord, V> StoreBulkMut<K, V> for Vec<(K, V)>

Source§

fn lm_extend<I>(&mut self, iter: I)
where I: IntoIterator<Item = (K, V)>, K: Ord,

Extends this store with items from an iterator.

It uses a two-pass (sort + dedup) approach to avoid any potential quadratic costs.

The asymptotic worst case complexity is O((n + m) log(n + m)), where n is the number of elements already in self and m is the number of elements in the iterator. The best case complexity is O(m), when the input iterator is already sorted, keys aren’t duplicated and all keys sort after the existing ones.

Source§

fn lm_retain<F>(&mut self, predicate: F)
where F: FnMut(&K, &V) -> bool,

Implementors§