# TextInputMethodEdit

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

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

```rust
struct TextInputMethodEdit
```

An exact platform edit in the current visible text, including an IME preview.
All positions count UTF-16 code units. `range` is ordered; `selection` is
directed and refers to the resulting text. Empty text is a real deletion.

This is the portable contract of CoreText's Range/Text/NewSelection request.
A client must reject unsupported filtering, normalization or length changes
before mutation; it must never acknowledge a different replacement as exact.

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

## Members

- [`range`](#struct_field-range)
- [`text`](#struct_field-text)
- [`selection`](#struct_field-selection)
- [`new`](#function-new)
- [`apply_to`](#function-apply_to)

<a id="struct_field-range"></a>

### range

```rust
range: super::TextSelection
```



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

<a id="struct_field-text"></a>

### text

```rust
text: String
```



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

<a id="struct_field-selection"></a>

### selection

```rust
selection: super::TextSelection
```



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

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

### new

```rust
fn new(range: TextSelection, text: impl Into<String>, selection: TextSelection) -> Self
```



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

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

### apply_to

```rust
fn apply_to(self: &Self, current: &str) -> Result<String, TextInputMethodError>
```

Validates both ranges without clamping or splitting a surrogate pair and
returns the complete candidate text. No client state is changed.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`

## Availability

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