# AnimationTask

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

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

```rust
struct AnimationTask
```

The pending or completed result of running an animation or a page
transition.

It completes with `Ok` when the animation has ended or was cancelled,
and with an error when the animation could not be run.

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

## Members

- [`completed`](#function-completed)
- [`is_completed`](#function-is_completed)
- [`result`](#function-result)
- [`on_completed`](#function-on_completed)
- [`when_all`](#function-when_all)

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

### completed

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

A successfully completed task.

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

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

### is_completed

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

Whether the task has completed, successfully or not.

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

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

### result

```rust
fn result(self: &Self) -> Option<Result<(), AnimationError>>
```

The result of the task; `None` while it is pending.

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

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

### on_completed

```rust
fn on_completed(self: &Self, continuation: impl FnOnce() -> () + 'static)
```

Runs `continuation` when the task completes; immediately if it has
completed already.

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

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

### when_all

```rust
fn when_all(tasks: impl IntoIterator<Item = AnimationTask>) -> AnimationTask
```

A task that completes when all of `tasks` have completed: with the
first error among them, if any.

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

## Trait implementations

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

## Availability

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