FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    new

    fn new() -> Self
    

    Source

    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.

    Source

    get

    fn get(self: &Self, name: &str) -> Option<&DrawnPropertiesDictionary>
    

    Source

    iter

    fn iter(self: &Self) -> impl Iterator<Item = (&str, &DrawnPropertiesDictionary)>
    

    Source

    len

    fn len(self: &Self) -> usize
    

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Source

    contains_key

    fn contains_key(self: &Self, name: &str) -> bool
    

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Clone
    • Debug
    • Default

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.