# TextInputMethodComposition

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

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

```rust
struct TextInputMethodComposition
```

A platform composition bound to one connection and one accepted client state.
Clones refer to the same session. Late callbacks fail after reset, focus
handoff, external edits, or a newer native composition.

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

## Members

- [`is_current`](#function-is_current)
- [`update`](#function-update)
- [`apply_edit`](#function-apply_edit)
- [`select_exact`](#function-select_exact)
- [`complete`](#function-complete)
- [`commit`](#function-commit)
- [`cancel`](#function-cancel)

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

### is_current

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



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

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

### update

```rust
fn update(self: &Self, text: &str, cursor: Option<i32>) -> Result<(), TextInputMethodError>
```



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

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

### apply_edit

```rust
fn apply_edit(self: &Self, edit: &TextInputMethodEdit) -> Result<bool, TextInputMethodError>
```

Applies the platform's delta to the current preview without committing
history. The resulting selection is part of this operation.

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

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

### select_exact

```rust
fn select_exact(self: &Self, selection: super::TextSelection) -> Result<(), TextInputMethodError>
```



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

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

### complete

```rust
fn complete(self: &Self, timestamp: u64) -> Result<bool, TextInputMethodError>
```

Commits exactly the accepted preview, including empty deletions and
arbitrary directed selection, as one undo transaction.

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

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

### commit

```rust
fn commit(self: &Self, text: &str, timestamp: u64) -> Result<bool, TextInputMethodError>
```



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

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

### cancel

```rust
fn cancel(self: &Self) -> Result<bool, TextInputMethodError>
```



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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`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`

## Availability

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