pub struct Document { /* private fields */ }Expand description
An HTML document tree, produced by crate::parse.
Read access (root/node/parent/children) is the public surface:
enough to walk the tree and read each node’s kind and source position.
Mutation (new_node/append_child/…) stays crate-internal — it’s
tree_builder’s job to build the tree in the first place, following
the spec-level insertion algorithms (“insert a comment”, “insert an
HTML element”, table foster parenting, …), see
plan/03-tree-construction.md’s “gemeinsame
Tree-Construction-Infrastruktur” step.
Implementations§
Source§impl Document
impl Document
Sourcepub fn root(&self) -> NodeId
pub fn root(&self) -> NodeId
Returns the id of the document’s own root node (the NodeKind::Document node).
Sourcepub fn node(&self, id: NodeId) -> &Node
pub fn node(&self, id: NodeId) -> &Node
Returns the node identified by id: its kind, source position, and
tree-navigation links (via Document::parent/Document::children).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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
Mutably borrows from an owned value. Read more