LockFreeObservableCache
struct · ferroui-dynamic-data · v0.5.0
struct LockFreeObservableCache<T, K>
An observable cache for a single writer (LockFreeObservableCache<TObject, TKey>): an edit
delivers its change set as soon as it ends. A clone is a handle to the same cache.
As upstream's, the count and the preview are never notified after the subscription: the count is the number of items when it is observed, and the preview never has a change set.
Members
new
fn new() -> Self
An empty cache (LockFreeObservableCache()).
from_source
fn from_source<C: IChangeSet<T, K>>(source: Rc<dyn IObservable<C>>) -> Self
A cache that applies the change sets of source (LockFreeObservableCache(IObservable<IChangeSet>)).
edit
fn edit(self: &Self, edit_action: impl FnOnce(&mut dyn ICacheUpdater<T, K>) -> ())
Runs an edit, then delivers its changes (Edit(Action<ICacheUpdater>)).
clear
fn clear(self: &Self)
Removes every item (Clear(LockFreeObservableCache)).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeSourceCacheEx<T, K>Borrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedCloneDefaultIConnectableCache<T, K>IObservableCache<T, K>IDisposable
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.