pub struct DocumentNode {
pub id: String,
pub content: NodeContent,
pub parent: Option<u32>,
pub children: Vec<u32>,
pub annotations: Vec<TextAnnotation>,
pub attributes: Option<HashMap<String, String>>,
}Expand description
A single node in the document tree.
Fields§
§id: StringDeterministic node identifier.
content: NodeContentThe semantic content of this node.
parent: Option<u32>Index of the parent node (None for root nodes).
children: Vec<u32>Indices of child nodes in reading order.
annotations: Vec<TextAnnotation>Inline formatting annotations (bold, italic, links, etc.) with byte offsets into the text.
attributes: Option<HashMap<String, String>>Format-specific attributes preserved from the source HTML element.
Keys are lowercased attribute names as they appear in the HTML (e.g. "class", "id",
"data-foo"). Values are the raw attribute strings, copied verbatim from the source —
no HTML entity decoding is applied here.
The map is None when no attributes are present (omitted entirely in serialized output).
Not every HTML attribute is preserved: only attributes that carry semantic or structural
significance for the node type are collected. For example, heading nodes capture the "id"
attribute for anchor linking; other element-level attributes may be silently dropped.
Trait Implementations§
Source§impl Clone for DocumentNode
impl Clone for DocumentNode
Source§fn clone(&self) -> DocumentNode
fn clone(&self) -> DocumentNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more