pub struct DecompRef<'a> {
pub zigen: &'a [char],
pub strokes: &'a [Stroke],
pub shape: Shape,
}Expand description
Borrowed character decomposition. Cheap to construct from &[char] /
&[Stroke], suitable for both stack-only build pipelines and
the runtime hot path.
Fields§
§zigen: &'a [char]Ordered 字根 sequence (1..=N items). Encoder consumes positions
[0, 1, 2, last].
strokes: &'a [Stroke]Stroke sequence for 成字字根 / 末笔识别码 rules. May be longer than
zigen; only the first/second/last positions are read.
shape: ShapeWhole-character shape — drives the 末笔识别码 lookup.
Implementations§
Source§impl<'a> DecompRef<'a>
impl<'a> DecompRef<'a>
Sourcepub fn first_stroke(&self) -> Option<Stroke>
pub fn first_stroke(&self) -> Option<Stroke>
First stroke, or None for an empty stroke list.
Sourcepub fn second_stroke(&self) -> Option<Stroke>
pub fn second_stroke(&self) -> Option<Stroke>
Second stroke (index 1), or None if fewer than 2 strokes.
Sourcepub fn last_stroke(&self) -> Option<Stroke>
pub fn last_stroke(&self) -> Option<Stroke>
Last stroke, or None for an empty stroke list. Used by the 识别码
rule for 2- and 3-字根 codes.
Trait Implementations§
impl<'a> Copy for DecompRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for DecompRef<'a>
impl<'a> RefUnwindSafe for DecompRef<'a>
impl<'a> Send for DecompRef<'a>
impl<'a> Sync for DecompRef<'a>
impl<'a> Unpin for DecompRef<'a>
impl<'a> UnsafeUnpin for DecompRef<'a>
impl<'a> UnwindSafe for DecompRef<'a>
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