better_collect 0.5.0-deprecated

Provides a composable, declarative way to consume an iterator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::aggregate::AggregateOp;

/// An [`AggregateOp`] that can also operates on a mutable reference to an item.
pub trait RefAggregateOp: AggregateOp {
    /// Creates a new value for a newly created group.
    ///
    /// See [`AggregateOp::new_value()`] for more detail.
    fn new_value_ref(&mut self, key: &Self::Key, item: &mut Self::Item) -> Self::Value;

    /// Creates a new value for a newly created group.
    ///
    /// See [`AggregateOp::modify()`] for more detail.
    fn modify_ref(&mut self, value: &mut Self::Value, item: &mut Self::Item);
}