# TextInputMethodConnection

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

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

```rust
struct TextInputMethodConnection
```

A manager-owned connection to one semantic input owner. Platform adapters
capture it when the client is installed. It never redirects to a newer
focused element, and retaining it does not retain its owner or client.

The input method manager creates a connection only for a client that opts
in by implementing [`TextInputMethodEditing`](/docs/0.5.0/api/ferroui-base/input/text_input/trait-textinputmethodediting/)
(`TextInputMethodClient::input_method_editing` returns `Some`); for every
other client `TextInputMethodClient::input_method_connection` is `None` and
the platform backends keep their upstream behaviour
(`docs/porting/winui-rich-text.md`, decision D5).

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

## Members

- [`owner`](#function-owner)
- [`is_current`](#function-is_current)
- [`input_scope_names`](#function-input_scope_names)
- [`effective_input_scope`](#function-effective_input_scope)
- [`effective_content_type`](#function-effective_content_type)
- [`supports_composition`](#function-supports_composition)
- [`supports_exact_edits`](#function-supports_exact_edits)
- [`edit_state`](#function-edit_state)
- [`apply_edit`](#function-apply_edit)
- [`select_exact`](#function-select_exact)
- [`begin_composition`](#function-begin_composition)
- [`commit_text`](#function-commit_text)

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

### owner

```rust
fn owner(self: &Self) -> Option<Ref<InputElement>>
```

The original input owner, only while this connection remains valid.

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

<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#L136)

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

### input_scope_names

```rust
fn input_scope_names(self: &Self) -> Option<Rc<[crate::input::InputScopeNameValue]>>
```

The input scopes of the owner (`TextInputOptions.InputScopeNames`), while this
connection remains valid. Backends read them here within 0.4, where they are not
a field of `TextInputOptions` (decision D8).

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

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

### effective_input_scope

```rust
fn effective_input_scope(self: &Self) -> Option<crate::input::InputScopeNameValue>
```

The first input scope of the owner, for a platform with a single hint.

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

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

### effective_content_type

```rust
fn effective_content_type(self: &Self, options: &super::TextInputOptions) -> super::TextInputContentType
```

The content type that best matches the first input scope of the owner, or
`options.content_type` without one.

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

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

### supports_composition

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



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

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

### supports_exact_edits

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



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

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

### edit_state

```rust
fn edit_state(self: &Self) -> Result<TextInputMethodState, TextInputMethodError>
```



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

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

### apply_edit

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

Applies a committed exact edit through the same raw/routed interception
path as ordinary text. The owner's acknowledgement is authoritative.

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

<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#L252)

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

### begin_composition

```rust
fn begin_composition(self: &Rc<Self>) -> Result<TextInputMethodComposition, TextInputMethodError>
```

Starts a new immutable platform session without deleting the current
selection. Any previous session on this connection is superseded.

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

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

### commit_text

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

Sends ordinary committed input to a client with the atomic editing
capability. A platform composing text should use its captured
composition's `commit` instead.

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

## Trait implementations

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

## Availability

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