pub struct SegmentMeta {
pub depth: usize,
pub noindent: bool,
pub font: Option<String>,
pub namespaces: Vec<(String, String)>,
pub section_id: Option<String>,
pub parent: Option<String>,
pub ancestors: Vec<String>,
}Expand description
Per-segment facts recorded at spill time and consumed when the segment is re-materialized in pass 2.
Fields§
§depth: usizeSpine depth of the spilled subtree’s insertion point (the depth the serializer must resume at for indentation to match the eager output).
noindent: boolThe spill parent’s noindent_children — the noindent value the eager
serializer would have passed when recursing into these children
(schema-driven: whether the parent can contain #PCDATA). Pass-2
re-serialization must use the same value or indentation diverges.
font: Option<String>The ancestor font context at the spill point, in Font::to_string form —
the seed finalize_rec needs so per-fragment finalize resolves fonts
exactly as the whole-document walk would have.
namespaces: Vec<(String, String)>Namespace declarations ((prefix, uri)) the wrapper must carry so the
segment parses stand-alone. In the eager DOM these live on the document
root (hoisted during build); a spilled subtree’s own serialization does
not repeat them.
section_id: Option<String>The nearest ancestor SECTION’s xml:id on the spine at the spill point.
Scope-gated processing (\lxDeclare section scoping) resolves a token’s
section by walking ancestors — which a spilled-from-inside-a-section
fragment no longer has.
parent: Option<String>The qname of the spilled run’s PARENT element (the spine node the
segment splices back under). Pass-2 finalize consults the parent for
schema decisions — e.g. collapsing an attribute-less ltx:text font
wrapper requires can_contain(parent, grandchild) — and the parse
wrapper (ltx:_lxfragment) is not in the model, so the recorded real
parent substitutes for it (witness: tests/digestion/dollar.tex kept an
empty <text> around an inline-block that eager collapsed).
ancestors: Vec<String>Every xml:id on the spilled run’s ANCESTOR chain at the spill point.
A label:/id:-scoped rewrite whose scope node is one of these
ancestors covers the WHOLE fragment (the fragment sits inside the
scope subtree), but the node itself lives in another fragment — the
selection would come up empty (witness: tests/math/simplemath.tex,
where label:sec:restricted stamps role=FUNCTION inside a section
whose shell spills separately from its paragraphs).
Trait Implementations§
Source§impl Clone for SegmentMeta
impl Clone for SegmentMeta
Source§fn clone(&self) -> SegmentMeta
fn clone(&self) -> SegmentMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more