# AnimatorBase

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/animation/animators/struct-animatorbase/

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

```rust
struct AnimatorBase
```

The state every animator has: its key frames and its target property.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animators/animator.rs#L17)

## Members

- [`new`](#function-new)
- [`property`](#function-property)
- [`set_property`](#function-set_property)
- [`count`](#function-count)
- [`get`](#function-get)
- [`to_vec`](#function-to_vec)
- [`styled_property`](#function-styled_property)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animators/animator.rs#L23)

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

### property

```rust
fn property(self: &Self) -> Option<&'static FerroProperty>
```

The target property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animators/animator.rs#L29)

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

### set_property

```rust
fn set_property(self: &Self, value: Option<&'static FerroProperty>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animators/animator.rs#L33)

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

### count

```rust
fn count(self: &Self) -> usize
```

The number of key frames.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animators/animator.rs#L39)

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

### get

```rust
fn get(self: &Self, index: usize) -> Ref<AnimatorKeyFrame>
```

The key frame at `index`. Panics when out of range.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animators/animator.rs#L44)

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

### to_vec

```rust
fn to_vec(self: &Self) -> Vec<Ref<AnimatorKeyFrame>>
```

A copy of the key frames.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animators/animator.rs#L49)

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

### styled_property

```rust
fn styled_property<T: PropertyValue>(self: &Self) -> &'static StyledProperty<T>
```

The target property as a styled property of value type `T`. Panics
when the animator has no property or the property has another type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/animation/animators/animator.rs#L59)

## Trait implementations

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

## Availability

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