pub struct RtfIndex {
pub nodes: Vec<RtfNode>,
pub host_index: usize,
}Expand description
One result-tree fragment indexed for XPath navigation. Built
complete-then-frozen — once a RtfIndex is pushed into the
host elsa::FrozenVec, its nodes table never mutates.
Fields§
§nodes: Vec<RtfNode>LOCAL ids — node 0 is the synthetic Document node, the
rest are its descendants in document order. Callers
outside this module always see the IDs encoded with the
RTF_BASE marker (via encode_rtf_id); the local Vec
is the implementation detail.
host_index: usizeSelf-index inside the host DocIndex::rtfs vector,
captured at registration time so accessors can re-encode
child / parent ids back to the marker form callers expect.
Implementations§
Source§impl RtfIndex
impl RtfIndex
Sourcepub fn children(&self, local_id: NodeId) -> &[NodeId] ⓘ
pub fn children(&self, local_id: NodeId) -> &[NodeId] ⓘ
Children of local_id — already-encoded global ids so the
outer dispatcher can return the slice directly.
Sourcepub fn parent(&self, local_id: NodeId) -> Option<NodeId>
pub fn parent(&self, local_id: NodeId) -> Option<NodeId>
Parent of local_id, globally encoded. Returns None for
the document root (LOCAL id 0).
pub fn attr_range(&self, local_id: NodeId) -> Range<NodeId>
pub fn ns_range(&self, local_id: NodeId) -> Range<NodeId>
pub fn kind(&self, local_id: NodeId) -> XPathNodeKind
pub fn pi_target(&self, local_id: NodeId) -> &str
pub fn node_name(&self, local_id: NodeId) -> &str
pub fn local_name(&self, local_id: NodeId) -> &str
pub fn namespace_uri(&self, local_id: NodeId) -> &str
pub fn namespace_prefix(&self, local_id: NodeId) -> Option<&str>
Sourcepub fn string_value(&self, local_id: NodeId) -> String
pub fn string_value(&self, local_id: NodeId) -> String
Recursive descendant text concatenation — XPath 1.0 §5 string-value semantics for element / document nodes. Atomic kinds return their stored content directly.