Struct hecs_hierarchy::Parent
source · [−]pub struct Parent<T> { /* private fields */ }
Expand description
Component of a entity with descendents in hierarchy tree T
.
Children represent a circular linked list. Since Parent
and child is generic over a marker
type, several hierarchies can coexist.
Implementations
sourceimpl<T: 'static + Send + Sync> Parent<T>
impl<T: 'static + Send + Sync> Parent<T>
sourcepub fn num_children(&self) -> usize
pub fn num_children(&self) -> usize
Return the parent’s num children.
sourcepub fn first_child<W: GenericWorld>(&self, world: &W) -> Result<Entity>
pub fn first_child<W: GenericWorld>(&self, world: &W) -> Result<Entity>
Query the parent’s first child.
sourcepub fn view_first_child(&self, view: &View<'_, &Child<T>>) -> Result<Entity>
pub fn view_first_child(&self, view: &View<'_, &Child<T>>) -> Result<Entity>
Query the parent’s first child.
sourcepub fn last_child(&self) -> Entity
pub fn last_child(&self) -> Entity
Return the parent’s last child.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Parent<T> where
T: RefUnwindSafe,
impl<T> Send for Parent<T> where
T: Send,
impl<T> Sync for Parent<T> where
T: Sync,
impl<T> Unpin for Parent<T> where
T: Unpin,
impl<T> UnwindSafe for Parent<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more