FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    new

    fn new() -> Self
    

    An empty cache.

    Source

    with_capacity

    fn with_capacity(capacity: usize) -> Self
    

    An empty cache with room for capacity items.

    Source

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

    Source

    into_dictionary

    fn into_dictionary(self: Self) -> IndexMap<K, T>
    

    The items in the order of enumeration of the cache, giving up the cache.

    Source

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

    Source

    capture_changes

    fn capture_changes(self: &mut Self) -> ChangeSet<T, K>
    

    The changes since the last capture, and a clean slate (CaptureChanges).

    Source

    has_changes

    fn has_changes(self: &Self) -> bool
    

    Whether there are changes not captured yet.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • Default
    • IQuery<T, K>
    • ICache<T, K>

    Availability

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