Skip to main content

MapValuesExt

Trait MapValuesExt 

Source
pub trait MapValuesExt<K, V>: MapQuery<Key = K, Value = V>
where K: Hash + Eq + CellValue, V: CellValue,
{ // Provided methods fn map_values<U, F>(self, f: F) -> MapValuesPlan<Self, K, V, U, F> where U: CellValue, F: Fn(&K, &V) -> U + Send + Sync + 'static { ... } fn filter_map_values<U, F>( self, f: F, ) -> FilterMapValuesPlan<Self, K, V, U, F> where U: CellValue, F: Fn(&K, &V) -> Option<U> + Send + Sync + 'static { ... } }
Expand description

Semantic key-preserving projection operators.

Projection closures must be deterministic, externally side-effect-free, and nonblocking. They may be invoked repeatedly or concurrently; invocation count, order, and thread are not API guarantees.

Provided Methods§

Source

fn map_values<U, F>(self, f: F) -> MapValuesPlan<Self, K, V, U, F>
where U: CellValue, F: Fn(&K, &V) -> U + Send + Sync + 'static,

Map every value while retaining its input key.

Source

fn filter_map_values<U, F>(self, f: F) -> FilterMapValuesPlan<Self, K, V, U, F>
where U: CellValue, F: Fn(&K, &V) -> Option<U> + Send + Sync + 'static,

Map or omit a value while retaining its input key.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K, V, M> MapValuesExt<K, V> for M
where K: Hash + Eq + CellValue, V: CellValue, M: MapQuery<Key = K, Value = V>,