pub trait IncrMap<M> {
// Required methods
fn incr_map<F, K, V, V2>(&self, f: F) -> Incr<M::OutputMap<V2>>
where M: SymmetricFoldMap<K, V> + SymmetricMapMap<K, V>,
K: Value + Ord,
V: Value,
V2: Value,
F: FnMut(&V) -> V2 + 'static + NotObserver,
M::OutputMap<V2>: Value;
fn incr_filter_map<F, K, V, V2>(&self, f: F) -> Incr<M::OutputMap<V2>>
where M: SymmetricFoldMap<K, V> + SymmetricMapMap<K, V>,
K: Value + Ord,
V: Value,
V2: Value,
F: FnMut(&V) -> Option<V2> + 'static + NotObserver,
M::OutputMap<V2>: Value;
fn incr_mapi<F, K, V, V2>(&self, f: F) -> Incr<M::OutputMap<V2>>
where M: SymmetricFoldMap<K, V> + SymmetricMapMap<K, V>,
K: Value + Ord,
V: Value,
V2: Value,
F: FnMut(&K, &V) -> V2 + 'static + NotObserver,
M::OutputMap<V2>: Value;
fn incr_filter_mapi<F, K, V, V2>(&self, f: F) -> Incr<M::OutputMap<V2>>
where M: SymmetricFoldMap<K, V> + SymmetricMapMap<K, V>,
K: Value + Ord,
V: Value,
V2: Value,
F: FnMut(&K, &V) -> Option<V2> + 'static + NotObserver,
M::OutputMap<V2>: Value;
fn incr_unordered_fold_with<K, V, R, F>(&self, init: R, fold: F) -> Incr<R>
where M: SymmetricFoldMap<K, V>,
K: Value + Ord,
V: Value,
R: Value,
F: UnorderedFold<M, K, V, R> + 'static + NotObserver;
fn incr_unordered_fold<FAdd, FRemove, K, V, R>(
&self,
init: R,
add: FAdd,
remove: FRemove,
revert_to_init_when_empty: bool,
) -> Incr<R>
where M: SymmetricFoldMap<K, V>,
K: Value + Ord,
V: Value,
R: Value,
FAdd: FnMut(R, &K, &V) -> R + 'static + NotObserver,
FRemove: FnMut(R, &K, &V) -> R + 'static + NotObserver;
fn incr_unordered_fold_update<FAdd, FRemove, FUpdate, K, V, R>(
&self,
init: R,
add: FAdd,
remove: FRemove,
update: FUpdate,
revert_to_init_when_empty: bool,
) -> Incr<R>
where M: SymmetricFoldMap<K, V>,
K: Value + Ord,
V: Value,
R: Value,
FAdd: FnMut(R, &K, &V) -> R + 'static + NotObserver,
FRemove: FnMut(R, &K, &V) -> R + 'static + NotObserver,
FUpdate: FnMut(R, &K, &V, &V) -> R + 'static + NotObserver;
}
Expand description
Incremental maps, filter maps and folds on incremental key-value containers (maps).
Common functions available on Incr<BTreeMap>
etc, with blanket
implementation covering M: SymmetricFoldMap<K, V> + SymmetricMapMap<K, V>
.
So to get a lot of functionality for a new map type, you don’t have to implement much. Just those two traits, and then you get all these methods for free.
NOTE: there are additional methods available on crate::prelude::IncrBTreeMap and
[crate::prelude::IncrOrdMap] (with the im
feature).
Required Methods§
fn incr_map<F, K, V, V2>(&self, f: F) -> Incr<M::OutputMap<V2>>where
M: SymmetricFoldMap<K, V> + SymmetricMapMap<K, V>,
K: Value + Ord,
V: Value,
V2: Value,
F: FnMut(&V) -> V2 + 'static + NotObserver,
M::OutputMap<V2>: Value,
fn incr_filter_map<F, K, V, V2>(&self, f: F) -> Incr<M::OutputMap<V2>>where
M: SymmetricFoldMap<K, V> + SymmetricMapMap<K, V>,
K: Value + Ord,
V: Value,
V2: Value,
F: FnMut(&V) -> Option<V2> + 'static + NotObserver,
M::OutputMap<V2>: Value,
fn incr_mapi<F, K, V, V2>(&self, f: F) -> Incr<M::OutputMap<V2>>where
M: SymmetricFoldMap<K, V> + SymmetricMapMap<K, V>,
K: Value + Ord,
V: Value,
V2: Value,
F: FnMut(&K, &V) -> V2 + 'static + NotObserver,
M::OutputMap<V2>: Value,
fn incr_filter_mapi<F, K, V, V2>(&self, f: F) -> Incr<M::OutputMap<V2>>where
M: SymmetricFoldMap<K, V> + SymmetricMapMap<K, V>,
K: Value + Ord,
V: Value,
V2: Value,
F: FnMut(&K, &V) -> Option<V2> + 'static + NotObserver,
M::OutputMap<V2>: Value,
fn incr_unordered_fold_with<K, V, R, F>(&self, init: R, fold: F) -> Incr<R>where
M: SymmetricFoldMap<K, V>,
K: Value + Ord,
V: Value,
R: Value,
F: UnorderedFold<M, K, V, R> + 'static + NotObserver,
fn incr_unordered_fold<FAdd, FRemove, K, V, R>(
&self,
init: R,
add: FAdd,
remove: FRemove,
revert_to_init_when_empty: bool,
) -> Incr<R>where
M: SymmetricFoldMap<K, V>,
K: Value + Ord,
V: Value,
R: Value,
FAdd: FnMut(R, &K, &V) -> R + 'static + NotObserver,
FRemove: FnMut(R, &K, &V) -> R + 'static + NotObserver,
fn incr_unordered_fold_update<FAdd, FRemove, FUpdate, K, V, R>(
&self,
init: R,
add: FAdd,
remove: FRemove,
update: FUpdate,
revert_to_init_when_empty: bool,
) -> Incr<R>where
M: SymmetricFoldMap<K, V>,
K: Value + Ord,
V: Value,
R: Value,
FAdd: FnMut(R, &K, &V) -> R + 'static + NotObserver,
FRemove: FnMut(R, &K, &V) -> R + 'static + NotObserver,
FUpdate: FnMut(R, &K, &V, &V) -> R + 'static + NotObserver,
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.