[−][src]Crate markup5ever_rcdom
A simple reference-counted DOM.
This is sufficient as a static parse tree, but don't build a web browser using it. :)
A DOM is a tree structure with ordered children that can be represented in an XML-like format. For example, the following graph
div
+- "text node"
+- span
in HTML would be serialized as
<div>text node<span></span></div>
See the document object model article on wikipedia for more information.
This implementation stores the information associated with each node once, and then hands out refs to children. The nodes themselves are reference-counted to avoid copying - you can create a new ref and then a node will outlive the document. Nodes own their children, but only have weak references to their parents.
Structs
Node | A DOM node. |
RcDom | The DOM itself; the result of parsing. |
SerializableHandle |
Enums
NodeData | The different kinds of nodes in the DOM. |
Type Definitions
Handle | Reference to a DOM node. |
WeakHandle | Weak reference to a DOM node, used for parent pointers. |