TextInputMethodConnection
struct · ferroui-base · v0.5.0
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
(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).
Members
owneris_currentinput_scope_nameseffective_input_scopeeffective_content_typesupports_compositionsupports_exact_editsedit_stateapply_editselect_exactbegin_compositioncommit_text
owner
fn owner(self: &Self) -> Option<Ref<InputElement>>
The original input owner, only while this connection remains valid.
is_current
fn is_current(self: &Self) -> bool
input_scope_names
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).
effective_input_scope
fn effective_input_scope(self: &Self) -> Option<crate::input::InputScopeNameValue>
The first input scope of the owner, for a platform with a single hint.
effective_content_type
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.
supports_composition
fn supports_composition(self: &Self) -> bool
supports_exact_edits
fn supports_exact_edits(self: &Self) -> bool
edit_state
fn edit_state(self: &Self) -> Result<TextInputMethodState, TextInputMethodError>
apply_edit
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.
select_exact
fn select_exact(self: &Self, selection: super::TextSelection) -> Result<(), TextInputMethodError>
begin_composition
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.
commit_text
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.