pub struct TextInputMethodRangeGeometry { /* private fields */ }Expand description
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.
Implementations§
Source§impl TextInputMethodRangeGeometry
impl TextInputMethodRangeGeometry
Sourcepub fn new(
range: TextSelection,
fragments: impl Into<Rc<[TextInputMethodTextBounds]>>,
is_current: impl Fn() -> bool + 'static,
) -> Result<Self, TextInputMethodError>
pub 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.
pub fn range(&self) -> TextSelection
pub fn fragments(&self) -> &[TextInputMethodTextBounds]
Sourcepub fn is_current(&self) -> bool
pub fn is_current(&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.
Trait Implementations§
Source§impl Clone for TextInputMethodRangeGeometry
impl Clone for TextInputMethodRangeGeometry
Auto Trait Implementations§
impl !RefUnwindSafe for TextInputMethodRangeGeometry
impl !Send for TextInputMethodRangeGeometry
impl !Sync for TextInputMethodRangeGeometry
impl !UnwindSafe for TextInputMethodRangeGeometry
impl Freeze for TextInputMethodRangeGeometry
impl Unpin for TextInputMethodRangeGeometry
impl UnsafeUnpin for TextInputMethodRangeGeometry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more