#thread-safe #node #version #dom #document #text-node #children

markup5ever_arcdom

Thread safe version of RcDom from html5ever project

3 releases

0.1.2 Apr 1, 2022
0.1.1 Feb 27, 2020
0.1.0 Feb 27, 2020

#5 in #text-node

Download history 42/week @ 2023-12-03 44/week @ 2023-12-10 49/week @ 2023-12-17 98/week @ 2023-12-24 23/week @ 2023-12-31 48/week @ 2024-01-07 54/week @ 2024-01-14 48/week @ 2024-01-21 56/week @ 2024-01-28 31/week @ 2024-02-04 47/week @ 2024-02-11 154/week @ 2024-02-18 90/week @ 2024-02-25 159/week @ 2024-03-03 111/week @ 2024-03-10 133/week @ 2024-03-17

502 downloads per month
Used in 5 crates (2 directly)

MIT/Apache

220KB
366 lines

markup5ever_arcdom

CI Crates.io docs.rs

Thread safe version of markup5ever_rcdom.


lib.rs:

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.

Dependencies

~1.2–7.5MB
~35K SLoC