ColorPaletteResourcesCollection
struct · ferroui-themes-fluent · v0.5.0
struct ColorPaletteResourcesCollection
The colour palettes of a FluentTheme by theme
variant: a dictionary that is also the resource provider of the palette
of the requested variant.
The managed class implements IDictionary<ThemeVariant, ColorPaletteResources> over an inner observable dictionary; here the
dictionary members are inherent methods.
Members
TYPEto_refconstructnewas_resource_providercountaddtry_addclearcontains_keyremovetry_get_valuegetsetkeysvaluesto_vec
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ColorPaletteResourcesCollection>
Returns a strong reference to this object.
construct
fn construct() -> Self
Field initialisation; see ResourceProvider::construct.
new
fn new() -> Ref<Self>
as_resource_provider
fn as_resource_provider(self: &Self) -> Rc<dyn IResourceProvider>
The provider as the resource provider interface.
count
fn count(self: &Self) -> usize
The number of palettes.
add
fn add(self: &Self, key: ThemeVariant, value: Ref<ColorPaletteResources>)
Adds the palette of a variant.
Panics
Panics if the variant already has a palette, or if it is neither the light nor the dark variant.
try_add
fn try_add(self: &Self, key: ThemeVariant, value: Ref<ColorPaletteResources>) -> Result<(), String>
add for untyped callers (markup): the failures are
errors. A variant that is not supported is rejected before the
palette is added.
clear
fn clear(self: &Self)
Removes all palettes.
contains_key
fn contains_key(self: &Self, key: &ThemeVariant) -> bool
Whether the variant has a palette.
remove
fn remove(self: &Self, key: &ThemeVariant) -> bool
Removes the palette of a variant; returns whether there was one.
try_get_value
fn try_get_value(self: &Self, key: &ThemeVariant) -> Option<Ref<ColorPaletteResources>>
The palette of a variant.
get
fn get(self: &Self, key: &ThemeVariant) -> Ref<ColorPaletteResources>
The palette of a variant.
Panics
Panics if the variant has no palette.
set
fn set(self: &Self, key: ThemeVariant, value: Ref<ColorPaletteResources>)
Sets the palette of a variant, replacing the one it has.
keys
fn keys(self: &Self) -> Vec<ThemeVariant>
The variants with a palette.
values
fn values(self: &Self) -> Vec<Ref<ColorPaletteResources>>
The palettes.
to_vec
fn to_vec(self: &Self) -> Vec<(ThemeVariant, Ref<ColorPaletteResources>)>
The palettes with their variants.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyResourceProviderImplExtFerroObjectImplExtClassDefaultsErasedDestructorIntoEitherDerefUpcast<T>Upcast<ColorPaletteResourcesCollection>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleFerroObjectImplResourceProviderImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.