IResourceDictionary
trait · ferroui-base · v0.5.0
trait IResourceDictionary: IResourceProvider
An indexed dictionary of resources.
Members
merged_dictionariesmerged_dictionaries_snapshottheme_dictionaries_snapshotcountaddsetcontains_keyremovetry_get_valueclear
merged_dictionaries
fn merged_dictionaries(self: &Self) -> FerroList<Rc<dyn IResourceProvider>>
The collection of child resource dictionaries, shared with the dictionary:
a change to the list is a change to the dictionary. The default, for a
dictionary that keeps no such list, is a new list with the providers of
merged_dictionaries_snapshot, which
the dictionary does not see change.
merged_dictionaries_snapshot
fn merged_dictionaries_snapshot(self: &Self) -> Rc<Vec<Rc<dyn IResourceProvider>>>
A snapshot of the collection of child resource dictionaries.
theme_dictionaries_snapshot
fn theme_dictionaries_snapshot(self: &Self) -> Vec<(ThemeVariant, Rc<dyn IThemeVariantProvider>)>
A snapshot of the collection of resource providers used for specific theme variants.
count
fn count(self: &Self) -> usize
The number of resources in the dictionary itself.
add
fn add(self: &Self, key: ResourceKey, value: ResourceValue)
Adds a resource. Panics if the key is already present.
set
fn set(self: &Self, key: ResourceKey, value: ResourceValue)
Adds or replaces a resource.
contains_key
fn contains_key(self: &Self, key: &ResourceKey) -> bool
Whether the dictionary itself contains the key.
remove
fn remove(self: &Self, key: &ResourceKey) -> bool
Removes a resource. Returns whether it was present.
try_get_value
fn try_get_value(self: &Self, key: &ResourceKey) -> Option<ResourceValue>
Gets a resource of the dictionary itself.
clear
fn clear(self: &Self)
Removes all resources of the dictionary itself.
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.