Trait SummarizeFromIterator

Source
pub trait SummarizeFromIterator<V> {
    // Required method
    fn summarize_from_iter<I>(iter: I) -> Self
       where I: IntoIterator<Item = V>;
}
Expand description

Implemented by mapping types (HashMap and BTreeMap) such that they can populated by an iterator. Roughly analogous to the FromIterator trait.

Required Methods§

Source

fn summarize_from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = V>,

Builds a grouped collection from an iterator of key,value tuples.

It’s recommended to call an iterator’s summarize() method rather than call this directly.

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, V, C> SummarizeFromIterator<Option<(K, V)>> for Option<C>
where C: InsertAndIncrement<K, V>,

Source§

fn summarize_from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = Option<(K, V)>>,

Source§

impl<K, V, C, E> SummarizeFromIterator<Result<(K, V), E>> for Result<C, E>
where C: InsertAndIncrement<K, V>,

Source§

fn summarize_from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = Result<(K, V), E>>,

Implementors§

Source§

impl<K, V, C> SummarizeFromIterator<(K, V)> for C
where C: InsertAndIncrement<K, V>,