pub struct SchemeSet(/* private fields */);Expand description
会话允许运行的方案集合,每个方案占 SchemeType 序号对应的那一位。缺省是 SchemeSet::ALL,即全部方案,行为与没有这个集合时完全相同。
收窄后,ProviderRegistry 只为集合里的方案构造 provider(全拼在全拼或五笔任一在集合里时构造,五笔混拼要用它),切换到集合外的方案报 INPUT_SCHEME_NOT_ENABLED。临时日文切到的也是日文方案,所以要用临时日文,集合里就得有 JapaneseRomaji;没有时临时日文的触发键不会进入这个模式。
Implementations§
Source§impl SchemeSet
impl SchemeSet
Sourcepub const ALL: Self
pub const ALL: Self
全部方案:序号 0 到 Self::LAST 的每一位。
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:代次里没有它的工作副本,用户词库只剩英文词。
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.