TextInputMethodEdit
struct · ferroui-base · v0.5.0
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.
Members
range
range: super::TextSelection
text
text: String
selection
selection: super::TextSelection
new
fn new(range: TextSelection, text: impl Into<String>, selection: TextSelection) -> Self
apply_to
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafePropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneDebugStructuralPartialEqPartialEqEq
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.