mckernant1_tools::iter::map

Trait MapUtils

Source
pub trait MapUtils {
    type Item;

    // Required methods
    fn associate_to_map<K, V, F>(self, transform: F) -> HashMap<K, V>
       where F: Fn(Self::Item) -> (K, V),
             K: Eq + Hash;
    fn associate_with_to_map<B, F>(self, transform: F) -> HashMap<Self::Item, B>
       where F: Fn(Self::Item) -> B;
}

Required Associated Types§

Required Methods§

Source

fn associate_to_map<K, V, F>(self, transform: F) -> HashMap<K, V>
where F: Fn(Self::Item) -> (K, V), K: Eq + Hash,

Source

fn associate_with_to_map<B, F>(self, transform: F) -> HashMap<Self::Item, B>
where F: Fn(Self::Item) -> B,

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.

Implementors§

Source§

impl<I, T> MapUtils for I
where I: IntoIterator<Item = T>, T: Hash + Eq + Clone,

Source§

type Item = T