Struct rbx_dom_weak::WeakDom [−][src]
pub struct WeakDom { /* fields omitted */ }
Expand description
Represents a DOM containing one or more Roblox instances.
Instances are described by Instance
objects and have a referent, a class
name, a name, properties, and an ordered list of children.
When constructing instances, you’ll want to create InstanceBuilder
objects and insert them into the tree.
Implementations
Construct a new WeakDom
described by the given InstanceBuilder
.
Returns a mutable reference to the root instance of the WeakDom
.
Returns a reference to an instance by referent, or None
if it is not
found.
Returns a mutable reference to an instance by referent, or None
if
it is not found.
Insert a new instance into the DOM with the given parent.
Panics
Panics if parent_ref
does not refer to an instance in the DOM.
Destroy the instance with the given referent.
Panics
Panics if referent
does not refer to an instance in the DOM.
Will also panic if referent
refers to the root instance in this
WeakDom
.
Move the instance with the given referent to a new WeakDom
, parenting
it to the given ref. To move to within the same DOM, use
WeakDom::transfer_within
.
This function would be called move
, but that’s a Rust keyword!
Panics
Panics if referent
does not refer to an instance in self
or if
dest_parent_ref
does not refer to an instance in other_dom
.
Will also panic if referent
refers to the root instance in this
WeakDom
.
Move the instance with the given referent to a new parent within the
same WeakDom
. To move to another DOM, use WeakDom::transfer
.
This function would be called move_within
, but move
is a Rust
keyword and consistency with transfer
is valuable.
Panics
Panics if referent
or dest_parent_ref
do not refer to instances in
self
.
Will also panic if referent
refers to the root instance in this
WeakDom
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WeakDom
impl UnwindSafe for WeakDom