Skip to main content

SpawnableList

Trait SpawnableList 

pub trait SpawnableList<R>: Sized {
    // Required methods
    fn spawn(this: MovingPtr<'_, 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§

fn spawn(this: MovingPtr<'_, 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.

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.

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§

§

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

§

fn spawn(_this: MovingPtr<'_, ()>, _world: &mut World, _entity: Entity)
where (): Sized,

§

fn size_hint(&self) -> usize

§

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

§

fn spawn(ptr: MovingPtr<'_, Vec<B>>, world: &mut World, entity: Entity)

§

fn size_hint(&self) -> usize

§

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

§

fn spawn(_this: MovingPtr<'_, (P0, P1)>, _world: &mut World, _entity: Entity)
where (P0, P1): Sized,

§

fn size_hint(&self) -> usize

§

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

§

fn spawn( _this: MovingPtr<'_, (P0, P1, P2)>, _world: &mut World, _entity: Entity, )

§

fn size_hint(&self) -> usize

§

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>,

§

fn spawn( _this: MovingPtr<'_, (P0, P1, P2, P3)>, _world: &mut World, _entity: Entity, )

§

fn size_hint(&self) -> usize

§

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>,

§

fn spawn( _this: MovingPtr<'_, (P0, P1, P2, P3, P4)>, _world: &mut World, _entity: Entity, )

§

fn size_hint(&self) -> usize

§

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>,

§

fn spawn( _this: MovingPtr<'_, (P0, P1, P2, P3, P4, P5)>, _world: &mut World, _entity: Entity, )

§

fn size_hint(&self) -> usize

§

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>,

§

fn spawn( _this: MovingPtr<'_, (P0, P1, P2, P3, P4, P5, P6)>, _world: &mut World, _entity: Entity, )

§

fn size_hint(&self) -> usize

§

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>,

§

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>,

§

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>,

§

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>,

§

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>,

§

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

§

fn spawn(_this: MovingPtr<'_, (P,)>, _world: &mut World, _entity: Entity)
where (P,): Sized,

§

fn size_hint(&self) -> usize

Implementors§

§

impl<R> SpawnableList<R> for WithOneRelated
where R: Relationship,

§

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

§

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

§

impl<R, I> SpawnableList<R> for WithRelated<I>
where R: Relationship, I: Iterator<Item = Entity>,

§

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