Skip to main content

CombineByKey

Trait CombineByKey 

Source
pub trait CombineByKey {
    type Elem;

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

Combine and deduplicate items in a container that allows duplicates normally (such as Vec) while preserving the original element order.

Required Associated Types§

Required Methods§

Source

fn 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".

Implementations on Foreign Types§

Source§

impl<T> CombineByKey for Option<T>
where T: CombineByKey + Clone,

Source§

type Elem = <T as CombineByKey>::Elem

Source§

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

Source§

impl<T> CombineByKey for Vec<T>
where T: Clone,

Source§

type Elem = T

Source§

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

Implementors§