Struct tl::VDom[][src]

pub struct VDom<'a> { /* fields omitted */ }
Expand description

VDom represents a Document Object Model

It is the result of parsing an HTML document. Internally it is only a wrapper around the Parser struct, but you do not need to know much about the Parser struct except for that all of the HTML tags are stored in here. Many functions of the public API take a reference to a Parser as a parameter to resolve NodeHandles to Nodes.

Implementations

Returns a reference to the underlying parser

Finds an element by its id attribute.

Returns a list of elements that match a given class name.

Returns a slice of all the elements in the HTML document

The difference between children() and nodes() is that children only returns the immediate children of the root node, while nodes() returns all nodes, including nested tags.

Returns the topmost subnodes (“children”) of this DOM

Returns the HTML version. This is determined by the <!DOCTYPE> tag

👎 Deprecated since 0.3.0:

please use nodes().iter().find(...) instead

Calls the given closure with each tag as parameter

The closure must return a boolean, indicating whether it should stop iterating Returning true will break the loop

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.