Expand description
Collectors for grouping and aggregating entities.
Collectors aggregate entities within groups during group_by() operations.
They maintain incremental state for O(1) insert/retract operations.
§Example
use solverforge_scoring::stream::collector::{count, sum};
// Count collector for counting entities in a group
let counter = count::<i32>();
// Sum collector for summing a property
let summer = sum(|x: &i32| *x as i64);Structs§
- Count
Accumulator - Accumulator for counting entities.
- Count
Collector - A collector that counts entities.
- Load
Balance - Result of load balancing - tracks loads per item and computes unfairness.
- Load
Balance Accumulator - Accumulator for load balance with incremental variance computation.
- Load
Balance Collector - Collector for computing load balance unfairness.
- SumAccumulator
- Zero-erasure accumulator for summing values.
- SumCollector
- Zero-erasure collector that sums values extracted from entities.
Traits§
- Accumulator
- An accumulator that incrementally collects values.
- UniCollector
- A collector that aggregates entities of type
Ainto a result of typeR.
Functions§
- count
- Creates a collector that counts entities.
- load_
balance - Creates a load balance collector.
- sum
- Creates a zero-erasure collector that sums values extracted from entities.