FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Animatable

    struct · ferroui-livecharts · v0.5.0

    struct Animatable
    

    A named collection of typed motion values and motionless state properties.

    Call begin_frame and read every drawn property, or call sample_frame, to recompute is_valid. A getter invalidates the frame while its motion remains active, exactly as source drawing getters do. Each frame uses one host time.

    View source

    Members

    is_valid

    is_valid: bool
    

    Source

    remove_on_completed

    remove_on_completed: bool
    

    Source

    new

    fn new() -> Self
    

    Source

    register_motion

    fn register_motion<T: Interpolate + 'static>(self: &mut Self, name: impl Into<String>, default: T) -> Result<PropertyKey<T>, PropertyError>
    

    Source

    register_state

    fn register_state<T: Clone + 'static>(self: &mut Self, name: impl Into<String>, default: T) -> Result<PropertyKey<T>, PropertyError>
    

    Source

    get_property_definition

    fn get_property_definition(self: &Self, name: &str) -> Option<&PropertyDefinition>
    

    Source

    property_definitions

    fn property_definitions(self: &Self) -> impl Iterator<Item = &PropertyDefinition>
    

    Source

    get

    fn get<T: Clone + 'static>(self: &mut Self, property: &PropertyKey<T>, now_ms: f64) -> Result<T, PropertyError>
    

    Source

    set

    fn set<T: Clone + 'static>(self: &mut Self, property: &PropertyKey<T>, value: T, now_ms: f64) -> Result<(), PropertyError>
    

    Source

    get_value

    fn get_value(self: &mut Self, name: &str, now_ms: f64) -> Result<PropertyValue, PropertyError>
    

    Source

    target_value

    fn target_value(self: &Self, name: &str) -> Result<PropertyValue, PropertyError>
    

    Gets the destination for motion values and the current value otherwise. Visual states use this to restore the original intended value mid-flight.

    Source

    register_parser

    fn register_parser<T: 'static>(self: &mut Self, parser: impl Fn(&str) -> Option<T> + 'static)
    

    Source

    coerce_value

    fn coerce_value(self: &Self, name: &str, value: PropertyValue) -> Result<PropertyValue, PropertyError>
    

    Source

    set_value

    fn set_value(self: &mut Self, name: &str, value: PropertyValue, now_ms: f64) -> Result<(), PropertyError>
    

    Source

    set_transition

    fn set_transition(self: &mut Self, animation: Option<Animation>, properties: &[&str]) -> Result<(), PropertyError>
    

    Source

    remove_transition

    fn remove_transition(self: &mut Self, properties: &[&str]) -> Result<(), PropertyError>
    

    Source

    complete_transition

    fn complete_transition(self: &mut Self, properties: &[&str]) -> Result<(), PropertyError>
    

    Source

    motion_info

    fn motion_info(self: &Self, name: &str) -> Result<Option<MotionInfo>, PropertyError>
    

    Source

    motion

    fn motion<T: Interpolate + 'static>(self: &Self, property: &PropertyKey<T>) -> Result<Option<&MotionProperty<T>>, PropertyError>
    

    Source

    copy_motion_from

    fn copy_motion_from(self: &mut Self, name: &str, source: &Animatable, source_name: &str) -> Result<(), PropertyError>
    

    Source

    import_properties

    fn import_properties(self: &mut Self, prototype: &Animatable)
    

    Imports prototype values and definitions; later imports replace duplicate names, matching source base/derived definition precedence. Callbacks are instance-local and are never copied into the destination.

    Source

    clone_snapshot

    fn clone_snapshot(self: &mut Self, now_ms: f64) -> Result<Self, PropertyError>
    

    Clones the visible values into independent defaults/from/to baselines. Sampling happens once per property; no animation, callback or state tracker is carried into the resulting instance.

    Source

    on_completed

    fn on_completed(self: &mut Self, name: &str, callback: impl Fn(&mut Animatable, f64) -> () + 'static) -> Result<CompletionToken, PropertyError>
    

    Source

    remove_completed_handler

    fn remove_completed_handler(self: &mut Self, token: CompletionToken) -> bool
    

    Source

    begin_frame

    fn begin_frame(self: &mut Self)
    

    Source

    sample_frame

    fn sample_frame(self: &mut Self, now_ms: f64) -> bool
    

    Source

    can_remove

    fn can_remove(self: &Self) -> bool
    

    Source

    is_state_active

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

    Source

    active_states

    fn active_states(self: &Self) -> impl Iterator<Item = &str>
    

    Active states in activation order; setting an active state keeps its place.

    Source

    Trait implementations

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

    Availability

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