Trait BuildWorldChildren

Source
pub trait BuildWorldChildren {
    // Required methods
    fn with_children(
        &mut self,
        spawn_children: impl FnOnce(&mut WorldChildBuilder<'_>),
    ) -> &mut Self;
    fn push_children(&mut self, children: &[Entity]) -> &mut Self;
    fn insert_children(
        &mut self,
        index: usize,
        children: &[Entity],
    ) -> &mut Self;
    fn remove_children(&mut self, children: &[Entity]) -> &mut Self;
}
Expand description

Trait that defines adding children to an entity directly through the World

Required Methods§

Source

fn with_children( &mut self, spawn_children: impl FnOnce(&mut WorldChildBuilder<'_>), ) -> &mut Self

Creates a WorldChildBuilder with the given children built in the given closure

Source

fn push_children(&mut self, children: &[Entity]) -> &mut Self

Pushes children to the back of the builder’s children

Source

fn insert_children(&mut self, index: usize, children: &[Entity]) -> &mut Self

Inserts children at the given index

Source

fn remove_children(&mut self, children: &[Entity]) -> &mut Self

Removes the given children

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'w> BuildWorldChildren for EntityMut<'w>

Source§

fn with_children( &mut self, spawn_children: impl FnOnce(&mut WorldChildBuilder<'_>), ) -> &mut EntityMut<'w>

Source§

fn push_children(&mut self, children: &[Entity]) -> &mut EntityMut<'w>

Source§

fn insert_children( &mut self, index: usize, children: &[Entity], ) -> &mut EntityMut<'w>

Source§

fn remove_children(&mut self, children: &[Entity]) -> &mut EntityMut<'w>

Implementors§