Crate collected[−][src]
Expand description
Collection types that takes the maximum, the summation and more from iterators.
Every collection type in the crate implements FromIterator
,
Extend
and Default
traits. They can be built from
collect()
, and can be updated by extend()
.
For example, it makes it easy to compute maximum and minimum value from an iterator
using unzip()
in single step.
use collected::{MaxVal, MinVal}; let (min, max): (MinVal<_>, MaxVal<_>) = vec![3, 1, 5, 2, 4, 3, 6] .into_iter() .map(|val| (val, val)) .unzip(); assert_eq!(min.unwrap(), 1); assert_eq!(max.unwrap(), 6);
Structs
AddVal | A collection that adds up values with |
FromUniqueHash | A wrapper around a collection |
FromUniqueOrd | A wrapper around a collection |
GroupHashMap | A collection that groups the tuples |
LastN | A wrapper around collection |
MaxVal | A collection that computes the maximum value. |
MinVal | A collection that computes the minimum value. |
MulVal | A collection that multiplies values with |
ProductVal | A collection taking the product from values with |
SumVal | A collection taking the summation from values with |
TopK | The collection that retains maximum |
UniqueBTreeSet | A collection that takes unique values into a BTreeSet. |
UniqueHashSet | A collection that takes unique values into a HashSet. |
UniqueIndexSet | A collection that takes unique values into a IndexSet. |
UniquifyHash | A wrapper around a collection |
UniquifyOrd | A wrapper around a collection |