#[repr(u8)]pub enum Layer {
Auto = 0,
Phrase = 1,
Zigen = 2,
Jianma3 = 3,
Jianma2 = 4,
Jianma1 = 5,
}Expand description
Discriminants are ascending priority: Auto = 0 is lowest, Jianma1
is highest. This makes the FST’s packed (layer << 56) | freq compare
correctly with raw u64 ordering — higher u64 = higher priority — so the
build-time merge step can keep the larger value on collision without
special casing.
Variants§
Auto = 0
Auto-decomposed CJK extension character — algorithmically valid but may pick a non-canonical 字根 sequence.
Phrase = 1
Multi-character phrase (词组).
Zigen = 2
Hand-curated 字根/seed entry — pedagogically canonical decomposition.
Jianma3 = 3
三级简码 — three-letter shortcut.
Jianma2 = 4
二级简码 — two-letter shortcut.
Jianma1 = 5
一级简码 — single-letter shortcut (e.g., g → 一).
Implementations§
Source§impl Layer
impl Layer
Sourcepub const fn from_u8(b: u8) -> Option<Self>
pub const fn from_u8(b: u8) -> Option<Self>
Decode from the discriminant byte. None for any value outside
0..=5 — used by unpack to recover the layer from a packed FST
value, falling back to Layer::Auto on corruption.