25 stable releases (4 major)

4.0.0 Oct 11, 2025
3.0.0 Mar 28, 2025
2.9.0 Aug 22, 2024
2.8.0 Jul 23, 2024
0.3.1 Feb 26, 2019

#17 in Games

Download history 516/week @ 2025-07-28 487/week @ 2025-08-04 539/week @ 2025-08-11 369/week @ 2025-08-18 818/week @ 2025-08-25 1355/week @ 2025-09-01 1101/week @ 2025-09-08 1699/week @ 2025-09-15 2003/week @ 2025-09-22 3061/week @ 2025-09-29 1038/week @ 2025-10-06 2299/week @ 2025-10-13 802/week @ 2025-10-20 757/week @ 2025-10-27 609/week @ 2025-11-03 309/week @ 2025-11-10

2,775 downloads per month
Used in 15 crates (12 directly)

MIT license

205KB
4.5K SLoC

rbx_dom_weak is a common representation of the Roblox DOM for Rust. It's designed to play nicely with the borrow checker and allows accessing instances by ID in constant time.

Constructing a new tree of instances is accomplished by first creating an InstanceBuilder object that describes a tree of instances and then wrapping it with an WeakDom:

use rbx_dom_weak::{InstanceBuilder, WeakDom};

let dm = InstanceBuilder::new("DataModel");

let mut dom = WeakDom::new(dm);

println!("ID of DOM root is {:?}", dom.root_ref());

Once we have a tree, we can use WeakDom::insert and WeakDom::get_by_ref to add instances to the tree and retrieve them.

use rbx_dom_weak::{InstanceBuilder, WeakDom};

let mut dom = WeakDom::new(InstanceBuilder::new("DataModel"));

// We can define properties using any type that can be converted to an
// rbx_dom_weak::types::Variant.
let http_service = InstanceBuilder::new("HttpService")
    .with_property("HttpEnabled", true);

let http_service_id = dom.insert(dom.root_ref(), http_service);

println!("HttpService has ID {:?}", http_service_id);

To change properties on an instance that's already present in the tree, use WeakDom::get_by_ref_mut. Note that it isn't possible to add or remove children through this method, use WeakDom::insert and WeakDom::destroy instead.


rbx_dom_weak

rbx_dom_weak on crates.io rbx_dom_weak docs

More details about this crate are available on the rbx-dom GitHub.

Weakly-typed implementation of Roblox's DOM, used for representing instances in external tools.

Coverage

Because rbx_dom_weak is weakly-typed, it doesn't need to be updated when new instances are added to Roblox. It does, however, have to be updated when new datatypes like Vector3int16 are added.

Dependencies

~4–5.5MB
~105K SLoC