Skip to main content

ImePreeditState

Struct ImePreeditState 

Source
pub struct ImePreeditState { /* private fields */ }
Expand description

Active OS Input Method Editor (IME) preedit composition state for CJK and dead-key input.

Implementations§

Source§

impl ImePreeditState

Composition update and sanitization methods for ImePreeditState.

Source

pub fn update( &mut self, composition: String, cursor_start_byte: usize, cursor_end_byte: usize, underlines: Vec<ImeUnderlineSpan>, anchor_rect: Rect, )

Starts or updates an active IME preedit composition string, cursor range, underline clauses, and candidate anchor rectangle.

§Arguments
  • String - Uncommitted UTF-8 composition string.
  • usize - Inclusive UTF-8 cursor start offset within composition.
  • usize - Exclusive UTF-8 cursor end offset within composition.
  • Vec<ImeUnderlineSpan> - Clause underline spans within composition.
  • Rect - Screen-space logical anchor rectangle for OS candidate popups.
Source

pub fn set_candidate_anchor_rect_safe(&mut self, anchor_rect: Rect)

Updates candidate_anchor_rect with finite non-negative dimensions.

§Arguments
  • Rect - Screen-space candidate anchor rectangle.
Source

pub fn clear(&mut self)

Clears the active IME composition text, cursor offsets, and underline clauses while keeping the anchor rectangle.

Source

pub fn is_composing(&self) -> bool

Returns true when an active non-empty IME composition is in progress.

§Returns
  • bool - true when actively composing preedit text.
Source§

impl ImePreeditState

Implements impl #impl_generics #name #ty_generics #where_clause.

Source

pub fn get_active(&self) -> bool

Source

pub fn get_mut_active(&mut self) -> &mut bool

Source

pub fn set_active(&mut self, val: bool) -> &mut Self

Source

pub fn get_composition(&self) -> &String

Source

pub fn get_mut_composition(&mut self) -> &mut String

Source

pub fn set_composition(&mut self, val: String) -> &mut Self

Source

pub fn get_cursor_start_byte(&self) -> usize

Source

pub fn get_mut_cursor_start_byte(&mut self) -> &mut usize

Source

pub fn set_cursor_start_byte(&mut self, val: usize) -> &mut Self

Source

pub fn get_cursor_end_byte(&self) -> usize

Source

pub fn get_mut_cursor_end_byte(&mut self) -> &mut usize

Source

pub fn set_cursor_end_byte(&mut self, val: usize) -> &mut Self

Source

pub fn get_underlines(&self) -> &Vec<ImeUnderlineSpan>

Source

pub fn get_mut_underlines(&mut self) -> &mut Vec<ImeUnderlineSpan>

Source

pub fn set_underlines(&mut self, val: Vec<ImeUnderlineSpan>) -> &mut Self

Source

pub fn get_candidate_anchor_rect(&self) -> Rect

Source

pub fn get_mut_candidate_anchor_rect(&mut self) -> &mut Rect

Source

pub fn set_candidate_anchor_rect(&mut self, val: Rect) -> &mut Self

Trait Implementations§

Source§

impl Clone for ImePreeditState

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ImePreeditState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ImePreeditState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ImePreeditState

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ImePreeditState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.