pub trait KeyPathsHashMapExt<K, V> {
// Required methods
fn map_values_keypath<T, F, R>(
&self,
keypath: KeyPaths<V, T>,
f: F,
) -> KeyPathResult<HashMap<K, R>>
where K: Clone,
F: Fn(&T) -> R;
fn filter_values_keypath<T, F>(
&self,
keypath: KeyPaths<V, T>,
predicate: F,
) -> KeyPathResult<HashMap<K, V>>
where K: Clone,
V: Clone,
F: Fn(&T) -> bool;
}Expand description
Operations for HashMap collections
Required Methods§
Sourcefn map_values_keypath<T, F, R>(
&self,
keypath: KeyPaths<V, T>,
f: F,
) -> KeyPathResult<HashMap<K, R>>
fn map_values_keypath<T, F, R>( &self, keypath: KeyPaths<V, T>, f: F, ) -> KeyPathResult<HashMap<K, R>>
Transform values using keypath
Sourcefn filter_values_keypath<T, F>(
&self,
keypath: KeyPaths<V, T>,
predicate: F,
) -> KeyPathResult<HashMap<K, V>>
fn filter_values_keypath<T, F>( &self, keypath: KeyPaths<V, T>, predicate: F, ) -> KeyPathResult<HashMap<K, V>>
Filter by keypath predicate on values
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.