Skip to main content

SchemeSet

Struct SchemeSet 

Source
pub struct SchemeSet(/* private fields */);
Expand description

会话允许运行的方案集合,每个方案占 SchemeType 序号对应的那一位。缺省是 SchemeSet::ALL,即全部方案,行为与没有这个集合时完全相同。

收窄后,ProviderRegistry 只为集合里的方案构造 provider(全拼在全拼或五笔任一在集合里时构造,五笔混拼要用它),切换到集合外的方案报 INPUT_SCHEME_NOT_ENABLED。临时日文切到的也是日文方案,所以要用临时日文,集合里就得有 JapaneseRomaji;没有时临时日文的触发键不会进入这个模式。

Implementations§

Source§

impl SchemeSet

Source

pub const ALL: Self

全部方案:序号 0 到 Self::LAST 的每一位。

Source

pub const EMPTY: Self

Source

pub const fn contains(self, scheme: SchemeType) -> bool

Source

pub const fn with(self, scheme: SchemeType) -> Self

Source

pub fn of(schemes: &[SchemeType]) -> Self

由方案列表组成的集合,重复的方案只算一次。

Source

pub const fn reads_main_dictionary(self) -> bool

集合里是否有读 msime-pinyin.db 的方案:全拼、双拼和五笔的候选、学习和用户词都在它里面(五笔混拼的拼音行也是)。没有这三个方案的集合(例如只有日文、越南文或藏文的版本)随包不带 msime-pinyin.db:代次里没有它的工作副本,用户词库只剩英文词。

Source

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§

Source§

impl Clone for SchemeSet

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 SchemeSet

Source§

impl Debug for SchemeSet

Source§

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

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

impl Default for SchemeSet

Source§

fn default() -> Self

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

impl Eq for SchemeSet

Source§

impl Hash for SchemeSet

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SchemeSet

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 SchemeSet

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.