# PlatformAsyncDataTransferItem

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/input/platform/struct-platformasyncdatatransferitem/

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

```rust
struct PlatformAsyncDataTransferItem
```

The base of the asynchronous data transfer items of the platform
backends: caches the formats and only asks for the values of supported
formats.

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

## Members

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

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

### new

```rust
fn new(platform_impl: impl PlatformAsyncDataTransferItemImpl + 'static) -> Rc<PlatformAsyncDataTransferItem>
```

Creates the item for a backend implementation.

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

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

### formats

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

Gets the formats supported by this item.
## Panics
Panics if the backend fails to provide them (where the reference
throws from the property); `try_formats` reports the
failure instead.

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

<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
backend providing them.

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

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

### contains

```rust
fn contains(self: &Self, format: &DataFormat) -> bool
```

Gets whether the item supports a specific format.

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

<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
backend fails to provide the formats or the value.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`AsyncDataTransferItemExtensions`](/docs/0.5.0/api/ferroui-base/input/trait-asyncdatatransferitemextensions/)
- [`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`
- [`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/).
