pub struct ExplicitLevels {
pub levels: Vec<u8>,
pub effective_classes: Vec<BidiClass>,
pub removed: Vec<bool>,
}Expand description
Output of the X1..X9 explicit-level pass.
levels[i] is the embedding level assigned to the ith input
character by X1..X8, effective_classes[i] is the (possibly
override-rewritten) bidi class the implicit phases consume, and
removed[i] reflects rule X9 (“Remove all RLE, LRE, RLO, LRO,
PDF, and BN characters”). Index positions are preserved across all
three slices so callers can map back to the original logical
offsets if needed.
Per X9 the removed positions still carry a level — the spec note
allows implementations to leave the characters in place “as long as
all other characters are ordered correctly”, so callers walking
removed[i] == false get the X9-filtered logical sequence in one
pass without re-shuffling indices.
Fields§
§levels: Vec<u8>Per-character embedding level assigned by X1..X8. The first entry of the directional status stack (the paragraph level) is what gets assigned to every B per X8.
effective_classes: Vec<BidiClass>Per-character bidi class after X4 / X5 / X5a / X5b / X6 /
X6a override rewriting. For positions whose enclosing scope
has neutral override status the class is unchanged; under an
L override every non-formatting character is rewritten to
L; under an R override to R (per X6 and the X5a / X5b /
X6a override-on-isolate-format clauses).
removed: Vec<bool>removed[i] is true iff the ith character is one of the
types removed by X9 (RLE / LRE / RLO / LRO / PDF /
BN). The isolate-formatting characters (LRI / RLI /
FSI / PDI) are not removed per the X9 note “FSI, LRI,
RLI, and PDI characters are not removed.”
Trait Implementations§
Source§impl Clone for ExplicitLevels
impl Clone for ExplicitLevels
Source§fn clone(&self) -> ExplicitLevels
fn clone(&self) -> ExplicitLevels
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExplicitLevels
impl Debug for ExplicitLevels
impl Eq for ExplicitLevels
Source§impl PartialEq for ExplicitLevels
impl PartialEq for ExplicitLevels
Source§fn eq(&self, other: &ExplicitLevels) -> bool
fn eq(&self, other: &ExplicitLevels) -> bool
self and other values to be equal, and is used by ==.