FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    KeyValueCollection

    struct · ferroui-dynamic-data · v0.5.0

    struct KeyValueCollection<T, K>
    

    The sorted pairs of a key and an item of a sorted change set (KeyValueCollection<TObject, TKey>), with the comparer that sorted them and the reason of the sort.

    Deviation (DEVIATIONS.md, DynamicData): a pair is the tuple (key, item), upstream's KeyValuePair<TKey, TObject>; .0 is Key and .1 is Value. The pairs are shared, so cloning a collection is cheap.

    View source

    Members

    new

    fn new(items: Vec<(K, T)>, comparer: KeyValueComparer<T, K>, sort_reason: SortReason, optimisations: SortOptimisations) -> Self
    

    A collection of items, sorted by comparer for sort_reason (KeyValueCollection(IReadOnlyCollection<KeyValuePair<TKey, TObject>>, IComparer, SortReason, SortOptimisations)).

    Source

    empty

    fn empty() -> Self
    

    An empty collection (KeyValueCollection()): no optimisations, compared by the keys.

    Source

    comparer

    fn comparer(self: &Self) -> &KeyValueComparer<T, K>
    

    The comparer of the pairs (Comparer).

    Source

    count

    fn count(self: &Self) -> usize
    

    The number of pairs (Count).

    Source

    optimisations

    fn optimisations(self: &Self) -> SortOptimisations
    

    The optimisations of the sort (Optimisations).

    Source

    sort_reason

    fn sort_reason(self: &Self) -> SortReason
    

    The reason of the sort (SortReason).

    Source

    items

    fn items(self: &Self) -> &[(K, T)]
    

    The pairs, in order.

    Source

    to_vec

    fn to_vec(self: &Self) -> Vec<(K, T)>
    where T: Clone,
          K: Clone
    

    The pairs as a list of their own (ToList).

    Source

    values

    fn values(self: &Self) -> impl Iterator<Item = &T>
    

    The items, in order (Select(kv => kv.Value)).

    Source

    keys

    fn keys(self: &Self) -> impl Iterator<Item = &K>
    

    The keys, in order (Select(kv => kv.Key)).

    Source

    ptr_eq

    fn ptr_eq(self: &Self, other: &Self) -> bool
    

    Whether self and other share their pairs (ReferenceEquals of upstream's collections).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Receiver
    • Any
    • ToOwned
    • Clone
    • Default
    • Deref
    • IntoIterator
    • PartialEq
    • Debug
    • IKeyValueCollection<T, K>

    Availability

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