# IDataTransfer

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

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

```rust
trait IDataTransfer: IDisposable
```

Represents an object providing a list of [`IDataTransferItem`](/docs/0.5.0/api/ferroui-base/input/trait-idatatransferitem/) usable
during a drag and drop operation.

When an implementation of this interface is used as a drag source using
`DragDrop::do_drag_drop_async`,
it must NOT be disposed by the caller. The system will dispose of it
automatically when the drag operation completes.

See `DataTransfer` for the mutable
implementation.

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

## Members

- [`formats`](#function-formats)
- [`items`](#function-items)
- [`as_async_data_transfer`](#function-as_async_data_transfer)

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

### formats

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

Gets the formats supported by the data transfer.

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

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

### items

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

Gets a list of `IDataTransferItem` contained in this object.

Some platforms (such as Windows and X11) may only support a single
data item for all formats except files.

Items returned by this property must stay valid until the data
transfer is disposed.

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

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

### as_async_data_transfer

```rust
fn as_async_data_transfer(self: Rc<Self>) -> Option<Rc<dyn IAsyncDataTransfer>>
```

The object as an asynchronous data transfer, if it also is one.

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

## Trait implementations

- [`IDataTransfer`](/docs/0.5.0/api/ferroui-base/input/trait-idatatransfer/)

## Availability

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