# KeyFrame

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

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

```rust
struct KeyFrame
```

Stores data regarding a specific key point and value in an animation.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_cue`](#function-with_cue)
- [`with_key_time`](#function-with_key_time)
- [`setters`](#function-setters)
- [`key_time`](#function-key_time)
- [`set_key_time`](#function-set_key_time)
- [`cue`](#function-cue)
- [`set_cue`](#function-set_cue)
- [`key_spline`](#function-key_spline)
- [`set_key_spline`](#function-set_key_spline)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

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

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<KeyFrame>
```

Returns a strong reference to this object.

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

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

### construct

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

Creates the class data; see `FerroObject::construct`.

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

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

### new

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



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

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

### with_cue

```rust
fn with_cue(cue: Cue, setters: impl IntoIterator<Item = Rc<dyn IAnimationSetter>>) -> Ref<Self>
```

Creates a key frame at `cue` with the given setters.

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

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

### with_key_time

```rust
fn with_key_time(key_time: SignedDuration, setters: impl IntoIterator<Item = Rc<dyn IAnimationSetter>>) -> Ref<Self>
```

Creates a key frame at `key_time` with the given setters.

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

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

### setters

```rust
fn setters(self: &Self) -> FerroList<Rc<dyn IAnimationSetter>>
```

The setters of the key frame: the values the animated properties
have at its position.

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

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

### key_time

```rust
fn key_time(self: &Self) -> SignedDuration
```

The key time of this key frame.

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

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

### set_key_time

```rust
fn set_key_time(self: &Self, value: SignedDuration)
```

Sets the key time of this key frame. Panics when the cue has been
set: only one of them can be.

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

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

### cue

```rust
fn cue(self: &Self) -> Cue
```

The cue of this key frame.

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

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

### set_cue

```rust
fn set_cue(self: &Self, value: Cue)
```

Sets the cue of this key frame. Panics when the key time has been
set: only one of them can be.

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

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

### key_spline

```rust
fn key_spline(self: &Self) -> Option<Ref<KeySpline>>
```

The key spline of this key frame.

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

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

### set_key_spline

```rust
fn set_key_spline(self: &Self, value: Option<Ref<KeySpline>>)
```

Sets the key spline of this key frame. Panics when the spline is not
valid; it is stored nevertheless.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<KeyFrame>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)

## Availability

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