ferroui_dynamic_data/cache/i_change_set_adaptor.rs
1//! `IChangeSetAdaptor<TObject, TKey>` and `ISortedChangeSetAdaptor<TObject, TKey>`
2//! (`Cache/IChangeSetAdaptor.cs`, `Cache/ISortedChangeSetAdaptor.cs`).
3
4use super::{ChangeSet, SortedChangeSet};
5
6/// Applies the change sets of a cache to something else (`IChangeSetAdaptor<TObject, TKey>`).
7pub trait IChangeSetAdaptor<T, K> {
8 /// Applies `changes` (`Adapt`).
9 fn adapt(&self, changes: &ChangeSet<T, K>);
10}
11
12/// Applies the sorted change sets of a cache to something else
13/// (`ISortedChangeSetAdaptor<TObject, TKey>`).
14pub trait ISortedChangeSetAdaptor<T, K> {
15 /// Applies `changes` (`Adapt`).
16 fn adapt(&self, changes: &SortedChangeSet<T, K>);
17}