pub trait HtmlSliceExt {
// Required method
fn iter_with_dom_indices(&self) -> impl Iterator<Item = (&HtmlNode, usize)>;
}Expand description
An extension trait for [HtmlNode].
Required Methods§
Sourcefn iter_with_dom_indices(&self) -> impl Iterator<Item = (&HtmlNode, usize)>
fn iter_with_dom_indices(&self) -> impl Iterator<Item = (&HtmlNode, usize)>
Iterates over nodes alongside the indices as they would be observed in the final DOM.
-
Tags receive the index of the preceding node and don’t advance the cursor.
-
For indexing purposes, consecutive text nodes are considered as groups. They receive the same index as they are not distinguishable on the DOM level.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".