Trait hecs_hierarchy::Hierarchy[][src]

pub trait Hierarchy where
    Self: Sized
{ fn parent<T: Component>(&self, child: Entity) -> Result<Entity>;
fn root<T: Component>(&self, child: Entity) -> Result<Entity>;
fn children<T: Component>(
        &self,
        parent: Entity
    ) -> ChildrenIter<'_, Self, T>
Notable traits for ChildrenIter<'a, W, T>
impl<'a, W: GenericWorld, T> Iterator for ChildrenIter<'a, W, T> where
    T: 'static + Send + Sync
type Item = Entity;
;
fn ancestors<T: Component>(
        &self,
        child: Entity
    ) -> AncestorIter<'_, Self, T>
Notable traits for AncestorIter<'a, W, T>
impl<'a, W: GenericWorld, T: 'static + Send + Sync> Iterator for AncestorIter<'a, W, T> type Item = Entity;
;
fn descendants_depth_first<T: Component>(
        &self,
        root: Entity
    ) -> DepthFirstIterator<'_, Self, T>
Notable traits for DepthFirstIterator<'a, W, T>
impl<'a, W: GenericWorld, T: 'static + Send + Sync> Iterator for DepthFirstIterator<'a, W, T> type Item = Entity;
;
fn descendants_breadth_first<T: Component>(
        &self,
        root: Entity
    ) -> BreadthFirstIterator<'_, Self, T>
Notable traits for BreadthFirstIterator<'a, W, T>
impl<'a, W: GenericWorld + Hierarchy, T: 'static + Send + Sync> Iterator for BreadthFirstIterator<'a, W, T> type Item = Entity;
;
fn roots<T: Component>(
        &self
    ) -> QueryBorrow<'_, Without<Child<T>, &Parent<T>>>; }
Expand description

Non mutating part of hierarchy

Required methods

Returns the parent entity of child.

Traverses the immediate children of parent. If parent is not a Parent, an empty iterator is returned.

Traverse the tree upwards. Iterator does not include the child itself.

Traverse the tree depth first. Iterator does not include the child itself.

Traverse the tree breadth first. Iterator does not include the child itself.

Returns an iterator over all root objects in the world

Implementations on Foreign Types

Traverse the tree breadth first. Iterator does not include the child itself.

Traverse the tree breadth first. Iterator does not include the child itself.

Implementors