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 the referent of the root instance of the WeakDom.

Returns a reference to the root instance of the WeakDom.

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

Formats the value using the given formatter. Read more

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.

Should always be Self

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.