[][src]Struct rbx_tree::RbxTree

pub struct RbxTree { /* fields omitted */ }

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]

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]

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 PartialEq<RbxTree> for RbxTree
[src]

impl Clone for RbxTree
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for RbxTree
[src]

impl Serialize for RbxTree
[src]

impl<'de> Deserialize<'de> for RbxTree
[src]

Auto Trait Implementations

impl Send for RbxTree

impl Sync for RbxTree

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]