FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Lookup

    struct · ferroui-reactive · v0.5.0

    struct Lookup<K, E>
    

    Keys, each with the elements added under it (ILookup<TKey, TElement>, implemented by System.Reactive.Lookup<K, E>): an ordered map of keys to their elements, iterated in the order the keys were first added.

    Deviation (DEVIATIONS.md, Reactive): upstream compares keys with an IEqualityComparer<TKey> and enumerates the groups in the order of its dictionary (the order the keys were added, for a dictionary that nothing was removed from); the port compares keys with Eq and Hash and keeps that order explicitly.

    View source

    Members

    new

    fn new() -> Self
    

    An empty lookup.

    Source

    add

    fn add(self: &mut Self, key: K, element: E)
    

    Adds element under key (Add).

    Source

    get

    fn get<Q>(self: &Self, key: &Q) -> &[E]
    where K: Borrow<Q>,
          Q: Eq + Hash + ?Sized
    

    The elements under key, empty when there are none (the indexer this[TKey]).

    Source

    contains

    fn contains<Q>(self: &Self, key: &Q) -> bool
    where K: Borrow<Q>,
          Q: Eq + Hash + ?Sized
    

    Whether there are elements under key (Contains).

    Source

    count

    fn count(self: &Self) -> usize
    

    The number of keys (Count).

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Whether there are no keys.

    Source

    iter

    fn iter(self: &Self) -> std::slice::Iter<'_, Grouping<K, E>>
    

    The groups, in the order their keys were first added (GetEnumerator).

    Source

    Trait implementations

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

    Availability

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