[−][src]Struct rbx_dom_weak::RbxTree
Represents a tree containing Roblox instances.
Instances are described by RbxInstance objects and have an ID, children, and a parent.
When constructing instances, you'll want to create RbxInstanceProperties objects and insert them into the tree.
Methods
impl RbxTree
[src]
pub fn new(root_properties: RbxInstanceProperties) -> RbxTree
[src]
Construct a new RbxTree
with its root instance constructed using the
given properties.
pub fn get_root_id(&self) -> RbxId
[src]
Returns the ID of the root instance in the tree, which can be used
alongside get_instance
and friends.
pub fn iter_all_ids(&self) -> impl Iterator<Item = RbxId> + '_
[src]
Returns an iterator over all IDs in the tree.
pub fn get_instance(&self, id: RbxId) -> Option<&RbxInstance>
[src]
Returns the instance with the given ID if it's contained in this tree.
pub fn get_instance_mut(&mut self, id: RbxId) -> Option<&mut RbxInstance>
[src]
Returns mutable access to the instance with the given ID if it's contained in this tree.
pub fn move_instance(
&mut self,
source_id: RbxId,
dest_tree: &mut RbxTree,
dest_parent_id: RbxId
)
[src]
&mut self,
source_id: RbxId,
dest_tree: &mut RbxTree,
dest_parent_id: RbxId
)
Move the instance with the given ID from this tree to a new tree, underneath the given parent instance ID.
Panics
Panics if the instance source_id
doesn't exist in the source tree or
if the instance dest_parent_id
doesn't exist in the destination tree.
pub fn set_parent(&mut self, id: RbxId, dest_parent_id: RbxId)
[src]
Move the instance with the ID id
so that its new parent is
dest_parent_id
.
Panics
Panics if id
or dest_parent_id
do not refer to instances that exist
in the tree.
Panics if this operation would cause the tree to become cyclical and invalid.
pub fn insert_instance(
&mut self,
properties: RbxInstanceProperties,
parent_id: RbxId
) -> RbxId
[src]
&mut self,
properties: RbxInstanceProperties,
parent_id: RbxId
) -> RbxId
Inserts a new instance with the given properties into the tree, putting it under the instance with the given ID.
Panics
Panics if the given ID does not refer to an instance in this tree.
pub fn remove_instance(&mut self, root_id: RbxId) -> Option<RbxTree>
[src]
Given an ID, remove the instance from the tree with that ID, along with all of its descendants.
ⓘImportant traits for Descendants<'a>pub fn descendants(&self, id: RbxId) -> Descendants
[src]
Returns an iterator over all of the descendants of the given instance by ID.
Panics
Panics if the given ID is not present in the tree.
Trait Implementations
impl Clone for RbxTree
[src]
impl Debug for RbxTree
[src]
impl<'de> Deserialize<'de> for RbxTree
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<RbxTree> for RbxTree
[src]
impl Serialize for RbxTree
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for RbxTree
[src]
Auto Trait Implementations
impl RefUnwindSafe for RbxTree
impl Send for RbxTree
impl Sync for RbxTree
impl Unpin for RbxTree
impl UnwindSafe for RbxTree
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,