# IDataTransferItem

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

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

```rust
trait IDataTransferItem
```

Represent an item inside a `IDataTransfer`. 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_data_transfer_item.rs#L11)

## Members

- [`formats`](#function-formats)
- [`try_get_raw`](#function-try_get_raw)

<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_data_transfer_item.rs#L13)

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

### try_get_raw

```rust
fn try_get_raw(self: &Self, format: &DataFormat) -> Option<Rc<dyn Any>>
```

Tries to get a value for a given format. Returns `None` if the
format is not supported.

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
`DataTransferItemExtensions::try_get_value`.

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

## Trait implementations

- [`IDataTransferItem`](/docs/0.5.0/api/ferroui-base/input/trait-idatatransferitem/)

## Availability

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