FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    new

    fn new() -> Self
    

    An empty cache (LockFreeObservableCache()).

    Source

    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>)).

    Source

    edit

    fn edit(self: &Self, edit_action: impl FnOnce(&mut dyn ICacheUpdater<T, K>) -> ())
    

    Runs an edit, then delivers its changes (Edit(Action<ICacheUpdater>)).

    Source

    clear

    fn clear(self: &Self)
    

    Removes every item (Clear(LockFreeObservableCache)).

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.