pub trait TextInputMethodEditing {
// Required methods
fn begin_composition(&self) -> Result<(), TextInputMethodError>;
fn update_composition(
&self,
text: &str,
cursor: Option<i32>,
) -> Result<(), TextInputMethodError>;
fn cancel_composition(&self) -> Result<bool, TextInputMethodError>;
// Provided methods
fn supports_exact_edits(&self) -> bool { ... }
fn edit_state(&self) -> Result<TextInputMethodState, TextInputMethodError> { ... }
fn apply_edit(
&self,
_edit: &TextInputMethodEdit,
_composing: bool,
) -> Result<bool, TextInputMethodError> { ... }
fn complete_composition(&self) -> Result<bool, TextInputMethodError> { ... }
fn select_exact(
&self,
_selection: TextSelection,
) -> Result<(), TextInputMethodError> { ... }
}Expand description
Optional atomic composition capability of a text input client. Starting a composition preserves selected text; only an accepted update creates a preview. Commits use the normal raw and routed text-input pipeline.
Required Methods§
fn begin_composition(&self) -> Result<(), TextInputMethodError>
fn update_composition( &self, text: &str, cursor: Option<i32>, ) -> Result<(), TextInputMethodError>
fn cancel_composition(&self) -> Result<bool, TextInputMethodError>
Provided Methods§
Sourcefn supports_exact_edits(&self) -> bool
fn supports_exact_edits(&self) -> bool
Exact range edits are optional; legacy preedit clients remain supported.
fn edit_state(&self) -> Result<TextInputMethodState, TextInputMethodError>
fn apply_edit( &self, _edit: &TextInputMethodEdit, _composing: bool, ) -> Result<bool, TextInputMethodError>
fn complete_composition(&self) -> Result<bool, TextInputMethodError>
fn select_exact( &self, _selection: TextSelection, ) -> Result<(), TextInputMethodError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".