KeyPathsBTreeMapExt

Trait KeyPathsBTreeMapExt 

Source
pub trait KeyPathsBTreeMapExt<K, V> {
    // Required methods
    fn map_values_keypath<T, F, R>(
        &self,
        keypath: KeyPaths<V, T>,
        f: F,
    ) -> KeyPathResult<BTreeMap<K, R>>
       where K: Clone + Ord,
             F: Fn(&T) -> R;
    fn filter_values_keypath<T, F>(
        &self,
        keypath: KeyPaths<V, T>,
        predicate: F,
    ) -> KeyPathResult<BTreeMap<K, V>>
       where K: Clone + Ord,
             V: Clone,
             F: Fn(&T) -> bool;
}
Expand description

Operations for BTreeMap collections

Required Methods§

Source

fn map_values_keypath<T, F, R>( &self, keypath: KeyPaths<V, T>, f: F, ) -> KeyPathResult<BTreeMap<K, R>>
where K: Clone + Ord, F: Fn(&T) -> R,

Transform values using keypath

Source

fn filter_values_keypath<T, F>( &self, keypath: KeyPaths<V, T>, predicate: F, ) -> KeyPathResult<BTreeMap<K, V>>
where K: Clone + Ord, V: Clone, F: Fn(&T) -> bool,

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.

Implementations on Foreign Types§

Source§

impl<K: Ord, V: KeyPathsOperable> KeyPathsBTreeMapExt<K, V> for BTreeMap<K, V>

Source§

fn map_values_keypath<T, F, R>( &self, keypath: KeyPaths<V, T>, f: F, ) -> KeyPathResult<BTreeMap<K, R>>
where K: Clone + Ord, F: Fn(&T) -> R,

Source§

fn filter_values_keypath<T, F>( &self, keypath: KeyPaths<V, T>, predicate: F, ) -> KeyPathResult<BTreeMap<K, V>>
where K: Clone + Ord, V: Clone, F: Fn(&T) -> bool,

Implementors§