Trait SpawnableList

Source
pub trait SpawnableList<R> {
    // Required methods
    fn spawn(self, world: &mut World, entity: Entity);
    fn size_hint(&self) -> usize;
}
Expand description

A spawn-able list of changes to a given World and relative to a given Entity. This is generally used for spawning “related” entities, such as children.

Required Methods§

Source

fn spawn(self, world: &mut World, entity: Entity)

Spawn this list of changes in a given World and relative to a given Entity. This is generally used for spawning “related” entities, such as children.

Source

fn size_hint(&self) -> usize

Returns a size hint, which is used to reserve space for this list in a RelationshipTarget. This should be less than or equal to the actual size of the list. When in doubt, just use 0.

Implementations on Foreign Types§

Source§

impl<R> SpawnableList<R> for ()
where R: Relationship,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R, P0> SpawnableList<R> for (P0,)
where R: Relationship, P0: SpawnableList<R>,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R, P0, P1> SpawnableList<R> for (P0, P1)
where R: Relationship, P0: SpawnableList<R>, P1: SpawnableList<R>,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R, P0, P1, P2> SpawnableList<R> for (P0, P1, P2)
where R: Relationship, P0: SpawnableList<R>, P1: SpawnableList<R>, P2: SpawnableList<R>,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R, P0, P1, P2, P3> SpawnableList<R> for (P0, P1, P2, P3)
where R: Relationship, P0: SpawnableList<R>, P1: SpawnableList<R>, P2: SpawnableList<R>, P3: SpawnableList<R>,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R, P0, P1, P2, P3, P4> SpawnableList<R> for (P0, P1, P2, P3, P4)
where R: Relationship, P0: SpawnableList<R>, P1: SpawnableList<R>, P2: SpawnableList<R>, P3: SpawnableList<R>, P4: SpawnableList<R>,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R, P0, P1, P2, P3, P4, P5> SpawnableList<R> for (P0, P1, P2, P3, P4, P5)
where R: Relationship, P0: SpawnableList<R>, P1: SpawnableList<R>, P2: SpawnableList<R>, P3: SpawnableList<R>, P4: SpawnableList<R>, P5: SpawnableList<R>,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R, P0, P1, P2, P3, P4, P5, P6> SpawnableList<R> for (P0, P1, P2, P3, P4, P5, P6)
where R: Relationship, P0: SpawnableList<R>, P1: SpawnableList<R>, P2: SpawnableList<R>, P3: SpawnableList<R>, P4: SpawnableList<R>, P5: SpawnableList<R>, P6: SpawnableList<R>,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R, P0, P1, P2, P3, P4, P5, P6, P7> SpawnableList<R> for (P0, P1, P2, P3, P4, P5, P6, P7)
where R: Relationship, P0: SpawnableList<R>, P1: SpawnableList<R>, P2: SpawnableList<R>, P3: SpawnableList<R>, P4: SpawnableList<R>, P5: SpawnableList<R>, P6: SpawnableList<R>, P7: SpawnableList<R>,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R, P0, P1, P2, P3, P4, P5, P6, P7, P8> SpawnableList<R> for (P0, P1, P2, P3, P4, P5, P6, P7, P8)
where R: Relationship, P0: SpawnableList<R>, P1: SpawnableList<R>, P2: SpawnableList<R>, P3: SpawnableList<R>, P4: SpawnableList<R>, P5: SpawnableList<R>, P6: SpawnableList<R>, P7: SpawnableList<R>, P8: SpawnableList<R>,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9> SpawnableList<R> for (P0, P1, P2, P3, P4, P5, P6, P7, P8, P9)
where R: Relationship, P0: SpawnableList<R>, P1: SpawnableList<R>, P2: SpawnableList<R>, P3: SpawnableList<R>, P4: SpawnableList<R>, P5: SpawnableList<R>, P6: SpawnableList<R>, P7: SpawnableList<R>, P8: SpawnableList<R>, P9: SpawnableList<R>,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> SpawnableList<R> for (P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10)
where R: Relationship, P0: SpawnableList<R>, P1: SpawnableList<R>, P2: SpawnableList<R>, P3: SpawnableList<R>, P4: SpawnableList<R>, P5: SpawnableList<R>, P6: SpawnableList<R>, P7: SpawnableList<R>, P8: SpawnableList<R>, P9: SpawnableList<R>, P10: SpawnableList<R>,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> SpawnableList<R> for (P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11)
where R: Relationship, P0: SpawnableList<R>, P1: SpawnableList<R>, P2: SpawnableList<R>, P3: SpawnableList<R>, P4: SpawnableList<R>, P5: SpawnableList<R>, P6: SpawnableList<R>, P7: SpawnableList<R>, P8: SpawnableList<R>, P9: SpawnableList<R>, P10: SpawnableList<R>, P11: SpawnableList<R>,

Source§

fn spawn(self, _world: &mut World, _entity: Entity)

Source§

fn size_hint(&self) -> usize

Implementors§

Source§

impl<R, B> SpawnableList<R> for Spawn<B>
where R: Relationship, B: Bundle,

Source§

impl<R, B> SpawnableList<R> for Vec<B>

Source§

impl<R, F> SpawnableList<R> for SpawnWith<F>
where R: Relationship, F: FnOnce(&mut RelatedSpawner<'_, R>) + Send + Sync + 'static,

Source§

impl<R, I, B> SpawnableList<R> for SpawnIter<I>
where R: Relationship, I: Iterator<Item = B> + Send + Sync + 'static, B: Bundle,