# IAsyncDataTransferItem

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/input/trait-iasyncdatatransferitem/

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

```rust
trait IAsyncDataTransferItem
```

Represent an item inside a `IAsyncDataTransfer`.
An item may support several formats and can return the value of a given
format on demand.

See `DataTransferItem` for the mutable
implementation.

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

## Members

- [`formats`](#function-formats)
- [`try_formats`](#function-try_formats)
- [`try_get_raw_async`](#function-try_get_raw_async)

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

### formats

```rust
fn formats(self: &Self) -> Rc<[DataFormat]>
```

Gets the formats supported by this item.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_async_data_transfer_item.rs#L21)

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

### try_formats

```rust
fn try_formats(self: &Self) -> Result<Rc<[DataFormat]>, ClipboardError>
```

Gets the formats supported by this item, or the failure of the
platform that provides them.

`formats` has no way to report a failure (where the
reference throws from the property, it panics); the asynchronous
operations reading an item use this member instead, so that the
failure reaches whoever awaits them. Items whose formats cannot fail
keep the default.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_async_data_transfer_item.rs#L31)

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

### try_get_raw_async

```rust
fn try_get_raw_async(self: &Self, format: &DataFormat) -> LocalBoxFuture<Result<Option<Rc<dyn Any>>, ClipboardError>>
```

Tries to get a value for a given format. The future resolves to
`None` if the format is not supported, and to an error if the
platform providing the value fails.

Implementations of this method are expected to return a value
matching the exact data type of the underlying
`DataFormatOf`.

To retrieve a typed value, use
`AsyncDataTransferItemExtensions::try_get_value_async`.

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

## Trait implementations

- [`IAsyncDataTransferItem`](/docs/0.5.0/api/ferroui-base/input/trait-iasyncdatatransferitem/)

## Availability

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