pub struct SchemeSet(/* private fields */);Expand description
会话允许运行的方案集合,每个方案占 SchemeType 序号对应的那一位。缺省是 SchemeSet::ALL,即全部方案,行为与没有这个集合时完全相同。
收窄后,ProviderRegistry 只为集合里的方案构造 provider(全拼在全拼或五笔任一在集合里时构造,五笔混拼要用它),切换到集合外的方案报 INPUT_SCHEME_NOT_ENABLED。临时日文切到的也是日文方案,所以要用临时日文,集合里就得有 JapaneseRomaji;没有时临时日文的触发键不会进入这个模式。
Implementations§
Source§impl SchemeSet
impl SchemeSet
pub const EMPTY: Self
pub const fn contains(self, scheme: SchemeType) -> bool
pub const fn with(self, scheme: SchemeType) -> Self
Sourcepub fn of(schemes: &[SchemeType]) -> Self
pub fn of(schemes: &[SchemeType]) -> Self
由方案列表组成的集合,重复的方案只算一次。
Sourcepub const fn reads_main_dictionary(self) -> bool
pub const fn reads_main_dictionary(self) -> bool
集合里是否有读 msime-pinyin.db 的方案:全拼、双拼和五笔的候选、学习和用户词都在它里面(五笔混拼的拼音行也是)。没有这三个方案的集合(例如只有日文、越南文或藏文的版本)随包不带 msime-pinyin.db:代次里没有它的工作副本,用户词库只剩英文词。
Sourcepub const fn requires_english_dictionary(self) -> bool
pub const fn requires_english_dictionary(self) -> bool
集合里是否有离不开 msime-english.db 的方案:全拼、双拼的英文混输、九键英文和回车学英文词,全拼、双拼、五笔的临时英文(Shift+Y)都读它,所以有这三个方案时准备代次要求资源目录里有它。其余方案(日文、韩语、越南语、藏文、粤语、注音、笔画)自己不读它,只有宿主打开专用英文(Session::set_dedicated_english)时才查英文补全、学回车上屏的词:这样的集合不要求它,资源目录里带了就照样复制进代次,没带时代次里没有它,专用英文只出键入的字母、回车不学词,个人词典的英文词也无处可存(编辑以 NO_ENGLISH_DICTIONARY 失败)。读 msime-pinyin.db 的集合(Self::reads_main_dictionary)一定要求它。
Trait Implementations§
impl Copy for SchemeSet
impl Eq for SchemeSet
impl StructuralPartialEq for SchemeSet
Auto Trait Implementations§
impl Freeze for SchemeSet
impl RefUnwindSafe for SchemeSet
impl Send for SchemeSet
impl Sync for SchemeSet
impl Unpin for SchemeSet
impl UnsafeUnpin for SchemeSet
impl UnwindSafe for SchemeSet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.