Skip to main content

FragmentIndex

Struct FragmentIndex 

Source
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

Source

pub fn record_id(&mut self, id: &str, segment: SegmentId)

A spilled node’s xml:id, and the segment now holding it.

Source

pub fn record_label(&mut self, label: &str, id: &str)

A label → xml:id association from spilled content.

Source

pub fn record_rdfa_prefix(&mut self, prefix: &str, uri: &str)

An RDFa prefix declaration (prefix → uri) seen in spilled content.

Source

pub fn id_segment(&self, id: &str) -> Option<SegmentId>

Which segment holds id, if it was spilled.

Source

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.)

Source

pub fn label_id(&self, label: &str) -> Option<&str>

The xml:id a spilled label resolves to, if any.

Source

pub fn labels(&self) -> impl Iterator<Item = (&str, &str)>

All spilled label → id associations (merged into each fragment’s — and the spine’s — rewrite_labels before rules run, so a label:-scoped rule resolves no matter which fragment holds the label).

Source

pub fn sizes(&self) -> (usize, usize, usize)

Registry sizes (ids, labels, rdfa) — pass-1 telemetry.

Source

pub fn rdfa_prefixes(&self) -> impl Iterator<Item = (&str, &str)>

All RDFa prefix declarations contributed by spilled content.

Source

pub fn id_count(&self) -> usize

Number of spilled ids recorded.

Source

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).

Source

pub fn load(path: &Path) -> Result<Self>

Load a saved index. Unknown record kinds are an error, not a skip — a partially understood index would silently drop facts (fail toward flagging).

Trait Implementations§

Source§

impl Debug for FragmentIndex

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FragmentIndex

Source§

fn default() -> FragmentIndex

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.