Skip to main content

ferroui_dynamic_data/aggregation/
i_aggregate_change_set.rs

1//! `IAggregateChangeSet<T>` (`Aggregation/IAggregateChangeSet.cs`).
2
3use super::AggregateItem;
4
5/// A change set shaped for fast continuous aggregations: the items added and removed, in order
6/// (`IAggregateChangeSet<T>`, an `IEnumerable<AggregateItem<T>>`).
7///
8/// The sequences of aggregate change sets are `Rc<dyn IObservable<Rc<dyn IAggregateChangeSet<T>>>>`
9/// ([`for_aggregation`](super::AggregationCacheEx::for_aggregation)), the operators of which are
10/// those of [`AggregateChangeSetEx`](super::AggregateChangeSetEx).
11pub trait IAggregateChangeSet<T> {
12    /// The items added and removed, in the order of the changes (`GetEnumerator`).
13    fn items(&self) -> Box<dyn Iterator<Item = AggregateItem<T>> + '_>;
14}
15
16/// A sequence of aggregate change sets (`IObservable<IAggregateChangeSet<T>>`).
17pub type AggregateChangeSets<T> = std::rc::Rc<dyn ferroui_system::IObservable<std::rc::Rc<dyn IAggregateChangeSet<T>>>>;