Trait MergeCombineByKey

Source
pub trait MergeCombineByKey {
    type Elem;

    // Required method
    fn merge_combine_by_key<F, K>(&mut self, template: &Self, get_key: F)
       where F: FnMut(&Self::Elem) -> K,
             K: Hash + Eq;
}
Expand description

Merge and combine the elements in two containers using a custom function for getting the key that should be used for each element. This allows merging and combining Vec.

Required Associated Types§

Required Methods§

Source

fn merge_combine_by_key<F, K>(&mut self, template: &Self, get_key: F)
where F: FnMut(&Self::Elem) -> K, K: Hash + Eq,

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<T> MergeCombineByKey for Option<T>

Source§

type Elem = <T as MergeCombineByKey>::Elem

Source§

fn merge_combine_by_key<F, K>(&mut self, template: &Self, get_key: F)
where F: FnMut(&Self::Elem) -> K, K: Hash + Eq,

Source§

impl<T> MergeCombineByKey for Vec<T>
where T: Merge + Clone,

Source§

type Elem = T

Source§

fn merge_combine_by_key<F, K>(&mut self, template: &Self, get_key: F)
where F: FnMut(&Self::Elem) -> K, K: Hash + Eq,

Implementors§