[−][src]Struct rbx_dom_weak::RbxTree
Represents a tree containing rooted instances.
Rooted instances are described by RbxInstance and have an ID, children, and a parent.
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]
&self
) -> impl Iterator<Item = RbxId> + '_
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 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.
Trait Implementations
impl Clone for RbxTree
[src]
fn clone(&self) -> RbxTree
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<RbxTree> for RbxTree
[src]
impl Debug 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<'de> Deserialize<'de> for RbxTree
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,