Skip to main content

msime_engine_state

Struct msime_engine_state 

Source
#[repr(C)]
pub struct msime_engine_state {
Show 13 fields pub struct_size: u32, pub scheme: u32, pub revision: u64, pub candidate_count: u32, pub flags: u32, pub local_mode: u32, pub caret_byte: u32, pub conversion_focus_start_scalar: u32, pub conversion_focus_end_scalar: u32, pub preedit: msime_engine_str, pub editing_text: msime_engine_str, pub conversion: msime_engine_str, pub spelling_symbols: msime_engine_str,
}
Expand description

组字状态(ABI 1.0),msime_engine_state_get 填写,收发规则同 msime_engine_result。字符串借自会话按修订号缓存的快照,msime_engine_state_get、msime_engine_candidate_get 这类只读调用不让它们失效。

Fields§

§struct_size: u32§scheme: u32

当前方案,MSIME_ENGINE_SCHEME_*。

§revision: u64

候选修订号:每次可能改变候选的调用都让它变,从 0 起只增不减。按下标选择和取候选时原样交回。

§candidate_count: u32§flags: u32

MSIME_ENGINE_STATE_* 的组合。

§local_mode: u32

MSIME_ENGINE_LOCAL_MODE_*。

§caret_byte: u32

组字光标在 editing_text 里的字节偏移。

§conversion_focus_start_scalar: u32

整句改字的光标,按 conversion 的字(Unicode 标量)计:光标在第 conversion_focus_start_scalar 个字之前,[start, end) 是候选替换的那一段;不在改字时两者都是 0。

§conversion_focus_end_scalar: u32§preedit: msime_engine_str

给用户看的组字:全拼按音节分开(ni'hao),双拼默认是按键原文,本地模式与专用英文是按键原文。

§editing_text: msime_engine_str

按键原文(ASCII),caret_byte 指向它;为空就是没有在组字。

§conversion: msime_engine_str

整句改字时改好的整句,宿主在它非空时把它画在行内代替拼音。

§spelling_symbols: msime_engine_str

此刻要按字符(msime_engine_key_char)而不是按标点交来的非字母键,见 README 的按键路由。

Trait Implementations§

Source§

impl Clone for msime_engine_state

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 Copy for msime_engine_state

Source§

impl Debug for msime_engine_state

Source§

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

Formats the value using the given formatter. Read more

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> Same for T

Source§

type Output = T

Should always be Self
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.