IFerroReadOnlyDictionary
trait · ferroui-base · v0.5.0
trait IFerroReadOnlyDictionary<K, V>: INotifyCollectionChanged + INotifyPropertyChanged
A read-only notifying dictionary.
The members of the read-only dictionary contract it extends are part of
the trait, together with the typed form of the collection changed event,
which carries the entries; INotifyCollectionChanged is its untyped
form.
Members
countgettry_get_valuecontains_keykeysvaluesto_vecadd_collection_changedremove_collection_changed
count
fn count(self: &Self) -> usize
The number of entries.
get
fn get(self: &Self, key: &K) -> V
The value for key. Panics if the key is not present.
try_get_value
fn try_get_value(self: &Self, key: &K) -> Option<V>
The value for key, if present.
contains_key
fn contains_key(self: &Self, key: &K) -> bool
keys
fn keys(self: &Self) -> Vec<K>
The keys, in enumeration order.
values
fn values(self: &Self) -> Vec<V>
The values, in enumeration order.
to_vec
fn to_vec(self: &Self) -> Vec<(K, V)>
The entries, in enumeration order (enumeration).
add_collection_changed
fn add_collection_changed(self: &Self, handler: Rc<CollectionChangedHandler<(K, V)>>) -> u64
Subscribes to changes of the collection. Returns a token for
remove_collection_changed.
remove_collection_changed
fn remove_collection_changed(self: &Self, token: u64) -> bool
Unsubscribes a handler.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.