ferroui_dynamic_data/cache/i_group.rs
1//! `IGroup<TObject, TKey, TGroupKey>` (`Cache/IGroup.cs`).
2
3use super::IObservableCache;
4use std::rc::Rc;
5
6/// A group of the items of a cache that share a group key, with the cache of those items
7/// (`IGroup<TObject, TKey, TGroupKey>`): the items of the change sets of `Group`,
8/// `GroupOnObservable` and `GroupOnProperty`.
9///
10/// Deviation (DEVIATIONS.md, DynamicData): the change sets of groups hold the concrete
11/// [`Group`](super::Group), which implements this trait, rather than the interface: a change set
12/// holds its items by value.
13pub trait IGroup<T, K, G> {
14 /// The group key (`Key`, of `IKey<TGroupKey>`).
15 fn key(&self) -> &G;
16
17 /// The items of the group, as a cache that can be observed (`Cache`).
18 fn cache(&self) -> Rc<dyn IObservableCache<T, K>>;
19}