# async_data

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-view/async_data/

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

```rust
module async_data
```

Asynchronous data: a future run by a component and its state
([`use_future`](/docs/0.5.0/api/ferroui-view/async_data/function-use_future/)), an element that follows that state ([`suspense`](/docs/0.5.0/api/ferroui-view/async_data/function-suspense/)), and a
future that waits on a timer of the dispatcher ([`sleep`](/docs/0.5.0/api/ferroui-view/async_data/function-sleep/)).

The futures run on the dispatcher of the thread
(`Dispatcher::start_local`): a future is polled for the first time when
it is started, and every later poll is a dispatcher job that a wake
queues, at the priority of the job that started it
(`DispatcherPriority::DEFAULT` outside of a job), on the thread of the
user interface, so what it reads and writes needs no synchronization. A
load that is replaced is aborted (`JoinHandle::abort`), which drops its
future. Nothing here blocks the thread.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/async_data.rs#L1)

## Contents

- [`AsyncState`](/docs/0.5.0/api/ferroui-view/async_data/enum-asyncstate/) — enum
- [`use_future`](/docs/0.5.0/api/ferroui-view/async_data/function-use_future/) — function
- [`suspense`](/docs/0.5.0/api/ferroui-view/async_data/function-suspense/) — function
- [`sleep`](/docs/0.5.0/api/ferroui-view/async_data/function-sleep/) — function

## Availability

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