pub struct FragmentIndex { /* private fields */ }Expand description
The string-only registry of what spilled content still owes the rest of the conversion.
Implementations§
Source§impl FragmentIndex
impl FragmentIndex
Sourcepub fn record_id(&mut self, id: &str, segment: SegmentId)
pub fn record_id(&mut self, id: &str, segment: SegmentId)
A spilled node’s xml:id, and the segment now holding it.
Sourcepub fn record_label(&mut self, label: &str, id: &str)
pub fn record_label(&mut self, label: &str, id: &str)
A label → xml:id association from spilled content.
Sourcepub fn record_rdfa_prefix(&mut self, prefix: &str, uri: &str)
pub fn record_rdfa_prefix(&mut self, prefix: &str, uri: &str)
An RDFa prefix declaration (prefix → uri) seen in spilled content.
Sourcepub fn id_segment(&self, id: &str) -> Option<SegmentId>
pub fn id_segment(&self, id: &str) -> Option<SegmentId>
Which segment holds id, if it was spilled.
Sourcepub fn contains_id(&self, id: &str) -> bool
pub fn contains_id(&self, id: &str) -> bool
Is id claimed by any spilled fragment? (The global half of id-collision
dedup; the live spine’s half stays in Document::idstore.)
Sourcepub fn label_id(&self, label: &str) -> Option<&str>
pub fn label_id(&self, label: &str) -> Option<&str>
The xml:id a spilled label resolves to, if any.
Sourcepub fn labels(&self) -> impl Iterator<Item = (&str, &str)>
pub fn labels(&self) -> impl Iterator<Item = (&str, &str)>
All spilled label → id associations (with the spine’s, the shared map
every fragment and the spine consult on a local miss —
Document::rewrite_labels_shared — so a label:-scoped rule resolves no
matter which fragment holds the label).
Sourcepub fn sizes(&self) -> (usize, usize, usize)
pub fn sizes(&self) -> (usize, usize, usize)
Registry sizes (ids, labels, rdfa) — pass-1 telemetry.
Sourcepub fn rdfa_prefixes(&self) -> impl Iterator<Item = (&str, &str)>
pub fn rdfa_prefixes(&self) -> impl Iterator<Item = (&str, &str)>
All RDFa prefix declarations contributed by spilled content.
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Persist beside the segments (diagnostics / crash inspection). Line
format, one record per line: kind\tkey\tvalue, keys percent-escaped
for the three bytes that would break the framing (%, tab, newline).
The records of each kind are in key order, so the file is a function of the index’s content and not of its hash
tables’ layout (det354 C5).