# RichTextTransfer

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/rich_text/struct-richtexttransfer/

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

```rust
struct RichTextTransfer
```

Framework-native clipboard exchange. In-process transfers retain the exact immutable
document fragment, including inline controls; external applications receive text and RTF.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/rich_text/rich_text_transfer.rs#L52)

## Members

- [`document_format`](#function-document_format)
- [`rtf_formats`](#function-rtf_formats)
- [`create`](#function-create)
- [`create_with_default_tab_stop`](#function-create_with_default_tab_stop)
- [`read`](#function-read)
- [`read_for_insertion`](#function-read_for_insertion)
- [`can_read`](#function-can_read)
- [`read_with_format`](#function-read_with_format)
- [`read_with_format_for_insertion`](#function-read_with_format_for_insertion)

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

### document_format

```rust
fn document_format() -> DataFormatOf<DocumentSnapshot>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/rich_text/rich_text_transfer.rs#L55)

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

### rtf_formats

```rust
fn rtf_formats() -> Vec<DataFormatOf<Rc<[u8]>>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/rich_text/rich_text_transfer.rs#L59)

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

### create

```rust
fn create(fragment: &DocumentSnapshot, format: RichEditClipboardFormat) -> Rc<dyn IAsyncDataTransfer>
```

Builds one clipboard item containing all applicable formats. If a rich feature has
no RTF representation, the exact in-process fragment and plain text are still offered.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/rich_text/rich_text_transfer.rs#L73)

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

### create_with_default_tab_stop

```rust
fn create_with_default_tab_stop(fragment: &DocumentSnapshot, format: RichEditClipboardFormat, default_tab_stop: f64) -> Rc<dyn IAsyncDataTransfer>
```

Includes RTF using the owning editor's default interval while retaining
the exact original snapshot in the in-process clipboard format.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/rich_text/rich_text_transfer.rs#L82)

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

### read

```rust
async fn read(data: &dyn IAsyncDataTransfer, plain_text_only: bool) -> Result<Option<DocumentSnapshot>, ClipboardError>
```

Reads the highest-fidelity offered format. A malformed advertised RTF payload is
reported to the caller instead of silently replacing formatted content with text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/rich_text/rich_text_transfer.rs#L120)

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

### read_for_insertion

```rust
async fn read_for_insertion(data: &dyn IAsyncDataTransfer, plain_text_only: bool, default_tab_stop: f64) -> Result<Option<DocumentSnapshot>, ClipboardError>
```

Imports external RTF for insertion into an existing editor. Its document
default is replaced by the destination's interval; explicit stops remain.
Exact in-process fragments retain their paragraph formatting unchanged.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/rich_text/rich_text_transfer.rs#L138)

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

### can_read

```rust
fn can_read(data: &dyn IAsyncDataTransfer, format: RichTextPasteFormat) -> Result<bool, ClipboardError>
```

Checks advertised formats without requesting or decoding their payloads.
A true result does not promise that a later platform read will succeed or
that an advertised RTF payload is well formed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/rich_text/rich_text_transfer.rs#L158)

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

### read_with_format

```rust
async fn read_with_format(data: &dyn IAsyncDataTransfer, format: RichTextPasteFormat) -> Result<Option<DocumentSnapshot>, ClipboardError>
```

Reads exactly the requested representation policy. The caller retains
ownership of `data` and is responsible for disposing a retrieved transfer.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/rich_text/rich_text_transfer.rs#L177)

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

### read_with_format_for_insertion

```rust
async fn read_with_format_for_insertion(data: &dyn IAsyncDataTransfer, format: RichTextPasteFormat, default_tab_stop: f64) -> Result<Option<DocumentSnapshot>, ClipboardError>
```

Reads a chosen format for an existing editor, applying its default tab
interval to external RTF while retaining explicit paragraph tab stops.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/rich_text/rich_text_transfer.rs#L188)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`

## Availability

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