ChangeAwareCache
struct · ferroui-dynamic-data · v0.5.0
struct ChangeAwareCache<T, K>
A keyed collection that records its changes until they are captured (ChangeAwareCache<TObject, TKey>): the building block of the cache operators.
Members
new
fn new() -> Self
An empty cache.
with_capacity
fn with_capacity(capacity: usize) -> Self
An empty cache with room for capacity items.
from_dictionary
fn from_dictionary(data: IndexMap<K, T>) -> Self
A cache of the items of data, in their order, without changes
(ChangeAwareCache(Dictionary<TKey, TObject>)).
into_dictionary
fn into_dictionary(self: Self) -> IndexMap<K, T>
The items in the order of enumeration of the cache, giving up the cache.
add
fn add(self: &mut Self, item: T, key: K)
Adds an item (Add).
Panics
When the key is there already (ArgumentException of the dictionary).
capture_changes
fn capture_changes(self: &mut Self) -> ChangeSet<T, K>
The changes since the last capture, and a clean slate (CaptureChanges).
has_changes
fn has_changes(self: &Self) -> bool
Whether there are changes not captured yet.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyDefaultIQuery<T, K>ICache<T, K>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.