Skip to main content

SessionSnapshot

Struct SessionSnapshot 

Source
pub struct SessionSnapshot {
Show 27 fields pub prediction: bool, pub scheme: SchemeType, pub local_mode: LocalInputMode, pub spelling_symbols: String, pub preedit: String, pub raw_segmentation: String, pub normalized_segmentation: String, pub candidates: Vec<WordItem>, pub dedicated_english: bool, pub editing_text: String, pub caret_position: usize, pub nine_key_spellings: Vec<String>, pub nine_key_reading: String, pub nine_key_single_character: bool, pub nine_key_strokes: String, pub answered_by_pinyin_fallback: bool, pub wubi_unique_four_code: bool, pub shuangpin_profile: String, pub candidate_sources: Vec<CandidateSource>, pub multilingual_conversion: Option<Conversion>, pub candidate_annotations: Vec<String>, pub candidate_answers_key: Vec<bool>, pub candidate_list_open: bool, pub conversion: String, pub conversion_focus: (usize, usize), pub caret_edit_suffix: bool, pub caret_edit_prefix: String,
}
Expand description

A value copy of the composition; safe to hand to another thread. candidate_sources, candidate_annotations and candidate_answers_key are aligned with candidates.

Fields§

§prediction: bool

非组字的上屏后联想,只接受显式选择,不由空格、回车或失焦提交。

§scheme: SchemeType§local_mode: LocalInputMode§spelling_symbols: String

The non-letter characters character takes in this state: the active local mode’s spelling_symbols (拆字按光标处列出部件分隔符 ' 和微软双拼的韵母 ;), or while nothing is composed the keys that open the / and @ modes. A host or runtime that would send one of these as punctuation sends it as a character instead.

§preedit: String§raw_segmentation: String§normalized_segmentation: String§candidates: Vec<WordItem>§dedicated_english: bool§editing_text: String

The ASCII source text; caret_position is a byte offset into it.

§caret_position: usize§nine_key_spellings: Vec<String>§nine_key_reading: String

九键组字时的读音行:首选候选覆盖的数字显示成它的拼音,其余数字按 preedit 原样显示(xi'an、yi'c、ni'hao'9);首选不是拼音候选时为空。只用于显示,preedit 仍是数字。

§nine_key_single_character: bool

九宫格候选只留单字(set_nine_key_filter)。

§nine_key_strokes: String

九宫格候选按笔画筛选时所选的笔顺前缀(hspnz),否则为空。

§answered_by_pinyin_fallback: bool

The candidates came from the wubi mixed-pinyin fallback, not the wubi table.

§wubi_unique_four_code: bool§shuangpin_profile: String§candidate_sources: Vec<CandidateSource>§multilingual_conversion: Option<Conversion>

当前唯一的连续混合行所携带的语言边界;没有该行时为空,不随普通候选重排而错位。

§candidate_annotations: Vec<String>

Helpcodes or correction hints.

§candidate_answers_key: Vec<bool>

Whether each candidate answers the whole key rather than a prefix of it or a completion past it.

§candidate_list_open: bool

The scheme’s openable candidate list is showing (the Korean Hanja list). Hosts read this instead of inferring it from the scheme and a non-empty list.

§conversion: String

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

§conversion_focus: (usize, usize)

整句改字的光标和光标处那一段,按 conversion 的字(Unicode 标量)计:光标在第 .0 个字之前,.0..1 是候选所替换的那一段;光标在句末时两者都等于字数。不在改字时为 (0, 0)。

§caret_edit_suffix: bool

光标后编辑(SessionOptions::caret_edit_suffix)正在生效:候选是光标后那段的,首选前面接着 caret_edit_prefix。宿主据此显示模式提示。

§caret_edit_prefix: String

光标后编辑里首选前面固定的那段文字(已经交出去的部分加上光标前那段的最佳转换)。candidates 仍是光标后那段的行,首选显示为这段文字接上 candidates[0].word,宿主可以把这几个字画淡;选中首选时上屏的是光标前那段的转换接上这一行。模式不生效时为空。

Trait Implementations§

Source§

impl Clone for SessionSnapshot

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 SessionSnapshot

Source§

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

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

impl Default for SessionSnapshot

Source§

fn default() -> Self

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

impl PartialEq for SessionSnapshot

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 SessionSnapshot

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.