# TextInputMethodRangeGeometry

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

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

```rust
struct TextInputMethodRangeGeometry
```

Complete geometry for one ordered UTF-16 range of the currently displayed
input story, including any visible composition preview.

The fragments are immutable; an empty range describes the requested
insertion position. A nonempty range can span shaped clusters, bidi runs,
lines or linked views. No fragment is a candidate-window rectangle.

Layout and native property getters can invoke application code. Adapters
must call `is_current` after callbacks and before each
native publication, in addition to checking their input-session ownership.
A snapshot never authorizes an edit or keeps an input connection current.

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

## Members

- [`new`](#function-new)
- [`range`](#function-range)
- [`fragments`](#function-fragments)
- [`is_current`](#function-is_current)

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

### new

```rust
fn new(range: TextSelection, fragments: impl Into<Rc<[TextInputMethodTextBounds]>>, is_current: impl Fn() -> bool + 'static) -> Result<Self, TextInputMethodError>
```

Creates a snapshot with a client-supplied validity check. The check must
be observational and detect document, layout, scrolling and view changes
not already represented by the framework's visual geometry version.
Capture weak references so a retained result cannot retain its control.

Empty fragments mean geometry is unavailable, not a request to use the
current caret. Zero-width fragments are valid for line/paragraph breaks.

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

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

### range

```rust
fn range(self: &Self) -> TextSelection
```



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

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

### fragments

```rust
fn fragments(self: &Self) -> &[TextInputMethodTextBounds]
```



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

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

### is_current

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

Checks both client layout state and synchronous visual changes. The
second version check also rejects a visual change made by the callback.
The caller must still recheck its own generation after this client call.

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

## 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`
- `Debug`

## Availability

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