# PlatformDataTransfer

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

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

```rust
struct PlatformDataTransfer
```

The base of the synchronous data transfers of the platform backends:
caches the formats and the items.

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

## Members

- [`new`](#function-new)
- [`formats`](#function-formats)
- [`try_formats`](#function-try_formats)
- [`are_formats_initialized`](#function-are_formats_initialized)
- [`items`](#function-items)
- [`try_items`](#function-try_items)
- [`are_items_initialized`](#function-are_items_initialized)

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

### new

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

Creates the data transfer for a backend implementation.

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

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

### formats

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

Gets the formats supported by the data transfer.
## 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_data_transfer.rs#L51)

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

### try_formats

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

Gets the formats supported by the data transfer, or the failure of
the backend providing them.

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

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

### are_formats_initialized

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

Whether the formats have been provided by the backend.

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

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

### items

```rust
fn items(self: &Self) -> Rc<[Rc<PlatformDataTransferItem>]>
```

Gets the items of the data transfer.
## Panics
Panics if the backend fails to provide them (where the reference
throws from the property); `try_items` reports the
failure instead.

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

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

### try_items

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

Gets the items of the data transfer, or the failure of the backend
providing them.

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

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

### are_items_initialized

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

Whether the items have been provided by the backend.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`AsyncDataTransferExtensions`](/docs/0.5.0/api/ferroui-base/input/trait-asyncdatatransferextensions/)
- [`DataTransferExtensions`](/docs/0.5.0/api/ferroui-base/input/trait-datatransferextensions/)
- [`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`
- [`IDisposable`](/docs/0.5.0/api/ferroui-base/reactive/use-idisposable/)
- [`IDataTransfer`](/docs/0.5.0/api/ferroui-base/input/trait-idatatransfer/)
- [`IAsyncDataTransfer`](/docs/0.5.0/api/ferroui-base/input/trait-iasyncdatatransfer/)

## Availability

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