pub struct LevelRun {
pub start: usize,
pub end: usize,
pub level: u8,
}Expand description
A maximal substring of characters that share an embedding level per UAX #9 BD7 (§3.1.2).
start is the index of the first character in the run; end is
one past the last character (half-open, matching Range<usize>
idioms). Both indices refer back into the level vector returned
by resolve_explicit_levels (and therefore the underlying
classes slice the caller fed to that function — they are the
same length).
X9-removed positions (RLE / LRE / RLO / LRO / PDF / BN) are
included in their containing level run — BD7 partitions on
assigned embedding level, not on removal status. The implicit
phases (W / N / I) walk runs via IsolatingRunSequence::indices
which skips removed positions per the X9 “behave as though the
characters were not present” clause.
Provenance: BD7 transcribed verbatim from
docs/text/unicode-bidi/tr9-50-uax9-unicode16.html §3.1.2
(UAX #9 Revision 50, Unicode 16.0).
Fields§
§start: usizeFirst character index in the run (inclusive).
end: usizeOne past the last character index in the run (exclusive).
level: u8Embedding level shared by every character in the run.