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.
Members
new
fn new() -> Self
An empty lookup.
add
fn add(self: &mut Self, key: K, element: E)
Adds element under key (Add).
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]).
contains
fn contains<Q>(self: &Self, key: &Q) -> bool
where K: Borrow<Q>,
Q: Eq + Hash + ?Sized
Whether there are elements under key (Contains).
count
fn count(self: &Self) -> usize
The number of keys (Count).
is_empty
fn is_empty(self: &Self) -> bool
Whether there are no keys.
iter
fn iter(self: &Self) -> std::slice::Iter<'_, Grouping<K, E>>
The groups, in the order their keys were first added (GetEnumerator).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedCloneDefaultIntoIteratorPartialEqEqDebug
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.