pub trait Spawn {
    type Output: Bundle;

    // Required method
    fn spawn(&self, world: &World, entity: Entity) -> Self::Output;
}
Expand description

Represents a type which spawns an Entity.

Usage

The output of a spawn is a Bundle which is inserted into the given spawned Entity.

By default, anything which implements SpawnOnce and Clone also implements this trait. This includes bundles which can be cloned.

Required Associated Types§

Required Methods§

source

fn spawn(&self, world: &World, entity: Entity) -> Self::Output

Implementors§

source§

impl<T: SpawnOnce + Clone> Spawn for T

§

type Output = <T as SpawnOnce>::Output