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 moreSource§impl Debug for DocumentNode
impl Debug for DocumentNode
impl Eq for DocumentNode
Source§impl PartialEq for DocumentNode
impl PartialEq for DocumentNode
Source§fn eq(&self, other: &DocumentNode) -> bool
fn eq(&self, other: &DocumentNode) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DocumentNode
Auto Trait Implementations§
impl Freeze for DocumentNode
impl RefUnwindSafe for DocumentNode
impl Send for DocumentNode
impl Sync for DocumentNode
impl Unpin for DocumentNode
impl UnsafeUnpin for DocumentNode
impl UnwindSafe for DocumentNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.