FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ObservableCache

    struct · ferroui-dynamic-data · v0.5.0

    struct ObservableCache<T, K>
    

    A cache whose edits and contents can be observed (ObservableCache<TObject, TKey>): the core of SourceCache, and the cache of AsObservableCache.

    View source

    Members

    new

    fn new(key_selector: impl Fn(&T) -> K + 'static) -> Self
    

    An empty cache whose items are keyed by key_selector (ObservableCache(Func<TObject, TKey>)).

    Source

    without_key_selector

    fn without_key_selector() -> Self
    

    A cache without a key selector, for edits that give the keys (ObservableCache(Func<TObject, TKey>? = null)).

    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 (ObservableCache(IObservable<IChangeSet>)).

    Source

    key_selector

    fn key_selector(self: &Self) -> Option<&KeySelector<T, K>>
    

    The key selector of the cache.

    Source

    update_from_source

    fn update_from_source(self: &Self, update: impl FnOnce(&mut dyn ISourceUpdater<T, K>) -> ())
    

    Runs an edit with the cache's key selector (UpdateFromSource); the changes are delivered once the outermost edit ends.

    Source

    update_from_intermediate

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

    Runs an edit that gives the keys (UpdateFromIntermediate).

    Source

    suspend_count

    fn suspend_count(self: &Self) -> Rc<dyn IDisposable>
    

    Holds back the notifications of count changes until the result is disposed (SuspendCount).

    Source

    suspend_notifications

    fn suspend_notifications(self: &Self) -> Rc<dyn IDisposable>
    

    Holds back the notifications of changes until the result is disposed; the changes made meanwhile are delivered as one change set (SuspendNotifications).

    Source

    Trait implementations

    Availability

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