VisualStatesDictionary
struct · ferroui-livecharts · v0.5.0
struct VisualStatesDictionary
Reusable visual-state definitions. A user's definition takes precedence over a theme definition, regardless of registration order.
Members
new
fn new() -> Self
insert
fn insert(self: &mut Self, name: impl Into<String>, state: DrawnPropertiesDictionary) -> bool
Adds or replaces a state using source HasState precedence. Returns
false only when a theme tries to replace a user's definition.
get
fn get(self: &Self, name: &str) -> Option<&DrawnPropertiesDictionary>
iter
fn iter(self: &Self) -> impl Iterator<Item = (&str, &DrawnPropertiesDictionary)>
len
fn len(self: &Self) -> usize
is_empty
fn is_empty(self: &Self) -> bool
contains_key
fn contains_key(self: &Self, name: &str) -> bool
set_state
fn set_state(self: &Self, name: &str, target: &mut Animatable, now_ms: f64) -> Result<(), StateError>
Applies setters every time and behaviors only on first activation. Unregistered properties are ignored. Known property types are checked before changes are made, so a bad setter cannot leave a half-applied state.
clear_state
fn clear_state(self: &Self, name: &str, target: &mut Animatable, now_ms: f64) -> Result<(), StateError>
Removes a state, restoring each property from the most recently activated remaining state, or from its original target when no state still sets it.
clear_states
fn clear_states(self: &Self, target: &mut Animatable, now_ms: f64) -> Result<(), StateError>
Restores original values once and reverses each active behavior, in activation order. No global timer or target-identity table is involved.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedClassDefaultsErasedDestructorIntoEitherCloneDebugDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.