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: StringThe 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: StringThe 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: boolThe 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: boolThe 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,宿主可以把这几个字画淡;选中首选时上屏的是光标前那段的转换接上这一行。模式不生效时为空。