pub struct HelpcodeKeymap { /* private fields */ }Expand description
A helpcode table: the code letters (one or two, lowercase) of each character, which the session uses to filter and order candidates and to annotate them. Read one from a resource directory with load_helpcode_keymap, from a file’s bytes with HelpcodeKeymap::from_table_bytes, or build one with HelpcodeKeymap::from_codes; a session takes it through SessionOptions::helpcode_table or Session::set_helpcode_table.
Implementations§
Source§impl HelpcodeKeymap
impl HelpcodeKeymap
Sourcepub fn from_codes(codes: HashMap<String, String>) -> Self
pub fn from_codes(codes: HashMap<String, String>) -> Self
A table from character to code letters as given; the caller has already applied the file rules of load_helpcode_keymap.
Sourcepub fn from_table_bytes(bytes: &[u8]) -> Option<Self>
pub fn from_table_bytes(bytes: &[u8]) -> Option<Self>
从码表文件的字节解析,规则与 load_helpcode_keymap 读文件时相同;给没有文件系统的宿主(网页引擎)用。超过 1 MiB 的表返回 None,与读文件时的上限一致。
Trait Implementations§
Source§impl Clone for HelpcodeKeymap
impl Clone for HelpcodeKeymap
Source§impl Debug for HelpcodeKeymap
impl Debug for HelpcodeKeymap
Source§impl Default for HelpcodeKeymap
impl Default for HelpcodeKeymap
impl Eq for HelpcodeKeymap
Source§impl PartialEq for HelpcodeKeymap
impl PartialEq for HelpcodeKeymap
impl StructuralPartialEq for HelpcodeKeymap
Auto Trait Implementations§
impl Freeze for HelpcodeKeymap
impl RefUnwindSafe for HelpcodeKeymap
impl Send for HelpcodeKeymap
impl Sync for HelpcodeKeymap
impl Unpin for HelpcodeKeymap
impl UnsafeUnpin for HelpcodeKeymap
impl UnwindSafe for HelpcodeKeymap
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.