pub struct ImeComposition { /* private fields */ }Expand description
Tracks inline IME pre-edit composition states and cursor positioning.
Implementations§
Source§impl ImeComposition
impl ImeComposition
pub fn new() -> Self
Sourcepub fn is_composing(&self) -> bool
pub fn is_composing(&self) -> bool
Returns whether the user is actively composing an IME candidate string.
Sourcepub fn update(&mut self, text: &str, cursor_offset: usize)
pub fn update(&mut self, text: &str, cursor_offset: usize)
Updates the active pre-edit text and caret position during candidate composition.
Sourcepub fn commit(&mut self) -> Option<String>
pub fn commit(&mut self) -> Option<String>
Commits the composed string and resets IME state to inactive.
Sourcepub fn preedit_text(&self) -> Option<&str>
pub fn preedit_text(&self) -> Option<&str>
Accesses the active pre-edit string if composing.
Trait Implementations§
Source§impl Clone for ImeComposition
impl Clone for ImeComposition
Source§impl Debug for ImeComposition
impl Debug for ImeComposition
Auto Trait Implementations§
impl Forget for ImeComposition
impl Freeze for ImeComposition
impl Move for ImeComposition
impl RefUnwindSafe for ImeComposition
impl Send for ImeComposition
impl Sync for ImeComposition
impl Unpin for ImeComposition
impl UnsafeUnpin for ImeComposition
impl UnwindSafe for ImeComposition
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
Mutably borrows from an owned value. Read more