Struct ambient_api::prelude::ambient_element::ElementTree
source · pub struct ElementTree { /* private fields */ }
Expand description
A tree of instantiated Elements.
Implementations§
source§impl ElementTree
impl ElementTree
sourcepub fn new(world: &mut World, element: Element) -> ElementTree
pub fn new(world: &mut World, element: Element) -> ElementTree
Creates a new ElementTree from the given Element.
sourcepub fn root_entity(&self) -> Option<EntityId>
pub fn root_entity(&self) -> Option<EntityId>
Gets the EntityId of the entity at the root of this tree, if available.
sourcepub fn n_instances(&self) -> usize
pub fn n_instances(&self) -> usize
Get the number of instances in this tree.
sourcepub fn migrate_root(&mut self, world: &mut World, element: Element)
pub fn migrate_root(&mut self, world: &mut World, element: Element)
Migrate the root of this tree to another Element.
This can be used to change the root of the tree and/or supply new state at the root level.
sourcepub fn remove_root(&mut self, world: &mut World)
pub fn remove_root(&mut self, world: &mut World)
Remove the root of this tree.
Trait Implementations§
source§impl Debug for ElementTree
impl Debug for ElementTree
source§impl Display for ElementTree
impl Display for ElementTree
source§fn from(tree: ElementTree) -> ShareableElementTree
fn from(tree: ElementTree) -> ShareableElementTree
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ElementTree
impl Send for ElementTree
impl !Sync for ElementTree
impl Unpin for ElementTree
impl !UnwindSafe for ElementTree
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for T
impl<T> Downcast for T
source§impl<T> ElementComponentName for T
impl<T> ElementComponentName for T
source§fn element_component_name(&self) -> &'static str
fn element_component_name(&self) -> &'static str
Returns the name of the type implementing ElementComponent.