# Animatable

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-livecharts/motion/struct-animatable/

**struct** · [`ferroui-livecharts`](/docs/0.5.0/api/ferroui-livecharts/) · v0.5.0

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L303)

## Members

- [`is_valid`](#struct_field-is_valid)
- [`remove_on_completed`](#struct_field-remove_on_completed)
- [`new`](#function-new)
- [`register_motion`](#function-register_motion)
- [`register_state`](#function-register_state)
- [`get_property_definition`](#function-get_property_definition)
- [`property_definitions`](#function-property_definitions)
- [`get`](#function-get)
- [`set`](#function-set)
- [`get_value`](#function-get_value)
- [`target_value`](#function-target_value)
- [`register_parser`](#function-register_parser)
- [`coerce_value`](#function-coerce_value)
- [`set_value`](#function-set_value)
- [`set_transition`](#function-set_transition)
- [`remove_transition`](#function-remove_transition)
- [`complete_transition`](#function-complete_transition)
- [`motion_info`](#function-motion_info)
- [`motion`](#function-motion)
- [`copy_motion_from`](#function-copy_motion_from)
- [`import_properties`](#function-import_properties)
- [`clone_snapshot`](#function-clone_snapshot)
- [`on_completed`](#function-on_completed)
- [`remove_completed_handler`](#function-remove_completed_handler)
- [`begin_frame`](#function-begin_frame)
- [`sample_frame`](#function-sample_frame)
- [`can_remove`](#function-can_remove)
- [`is_state_active`](#function-is_state_active)
- [`active_states`](#function-active_states)

<a id="struct_field-is_valid"></a>

### is_valid

```rust
is_valid: bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L304)

<a id="struct_field-remove_on_completed"></a>

### remove_on_completed

```rust
remove_on_completed: bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L305)

<a id="function-new"></a>

### new

```rust
fn new() -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L339)

<a id="function-register_motion"></a>

### register_motion

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L343)

<a id="function-register_state"></a>

### register_state

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L354)

<a id="function-get_property_definition"></a>

### get_property_definition

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L388)

<a id="function-property_definitions"></a>

### property_definitions

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L391)

<a id="function-get"></a>

### get

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L412)

<a id="function-set"></a>

### set

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L424)

<a id="function-get_value"></a>

### get_value

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L433)

<a id="function-target_value"></a>

### target_value

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L457)

<a id="function-register_parser"></a>

### register_parser

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L463)

<a id="function-coerce_value"></a>

### coerce_value

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L469)

<a id="function-set_value"></a>

### set_value

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L498)

<a id="function-set_transition"></a>

### set_transition

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L528)

<a id="function-remove_transition"></a>

### remove_transition

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L542)

<a id="function-complete_transition"></a>

### complete_transition

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L545)

<a id="function-motion_info"></a>

### motion_info

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L551)

<a id="function-motion"></a>

### motion

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L557)

<a id="function-copy_motion_from"></a>

### copy_motion_from

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L568)

<a id="function-import_properties"></a>

### import_properties

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L593)

<a id="function-clone_snapshot"></a>

### clone_snapshot

```rust
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](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L615)

<a id="function-on_completed"></a>

### on_completed

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L632)

<a id="function-remove_completed_handler"></a>

### remove_completed_handler

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L651)

<a id="function-begin_frame"></a>

### begin_frame

```rust
fn begin_frame(self: &mut Self)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L659)

<a id="function-sample_frame"></a>

### sample_frame

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L662)

<a id="function-can_remove"></a>

### can_remove

```rust
fn can_remove(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L671)

<a id="function-is_state_active"></a>

### is_state_active

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L674)

<a id="function-active_states"></a>

### active_states

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

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/motion/animatable.rs#L678)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Default`
- `Debug`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
