Trait GroupFromIterator

Source
pub trait GroupFromIterator<V> {
    // Required method
    fn group_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 group_from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = V>,

Builds a grouped collection from an iterator of key,value tuples. Collections are extended in the order the values appear in the iterator.

It’s recommended to call an iterator’s group() 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> GroupFromIterator<Option<(K, V)>> for Option<C>
where C: InsertAndExtend<K, V>,

Source§

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

Source§

impl<K, V, C, E> GroupFromIterator<Result<(K, V), E>> for Result<C, E>
where C: InsertAndExtend<K, V>,

Source§

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

Implementors§

Source§

impl<K, V, C> GroupFromIterator<(K, V)> for C
where C: InsertAndExtend<K, V>,