moonshine_spawn

Trait SpawnWorld

Source
pub trait SpawnWorld {
    // Required methods
    fn spawn_with(&mut self, _: impl Spawn) -> EntityWorldMut<'_>;
    fn spawn_once_with(&mut self, _: impl SpawnOnce) -> EntityWorldMut<'_>;
    fn spawn_key(&mut self, key: impl Into<SpawnKey>) -> EntityWorldMut<'_>;
    fn spawn_key_with(
        &mut self,
        key: impl Into<SpawnKey>,
        bundle: impl Bundle,
    ) -> EntityWorldMut<'_>;
}
Expand description

Trait used to spawn spawnables either directly or via a SpawnKey using World.

Required Methods§

Source

fn spawn_with(&mut self, _: impl Spawn) -> EntityWorldMut<'_>

Source

fn spawn_once_with(&mut self, _: impl SpawnOnce) -> EntityWorldMut<'_>

Source

fn spawn_key(&mut self, key: impl Into<SpawnKey>) -> EntityWorldMut<'_>

Source

fn spawn_key_with( &mut self, key: impl Into<SpawnKey>, bundle: impl Bundle, ) -> EntityWorldMut<'_>

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 SpawnWorld for World

Source§

fn spawn_with(&mut self, spawnable: impl Spawn) -> EntityWorldMut<'_>

Source§

fn spawn_once_with(&mut self, spawnable: impl SpawnOnce) -> EntityWorldMut<'_>

Source§

fn spawn_key(&mut self, key: impl Into<SpawnKey>) -> EntityWorldMut<'_>

Source§

fn spawn_key_with( &mut self, key: impl Into<SpawnKey>, bundle: impl Bundle, ) -> EntityWorldMut<'_>

Implementors§