Skip to main content

PersistSpawnWorldExt

Trait PersistSpawnWorldExt 

Source
pub trait PersistSpawnWorldExt {
    // Required methods
    fn spawn_persisted<T: Bundle>(&mut self, bundle: T) -> EntityWorldMut<'_>;
    fn spawn_persisted_with_id<T: Bundle>(
        &mut self,
        id: impl Into<String>,
        bundle: T,
    ) -> EntityWorldMut<'_>;
}
Expand description

Ergonomic helpers for spawning persisted entities directly on a World.

Useful for exclusive systems and tests that work with &mut World.

Required Methods§

Source

fn spawn_persisted<T: Bundle>(&mut self, bundle: T) -> EntityWorldMut<'_>

Source

fn spawn_persisted_with_id<T: Bundle>( &mut self, id: impl Into<String>, bundle: T, ) -> EntityWorldMut<'_>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PersistSpawnWorldExt for World

Source§

fn spawn_persisted<T: Bundle>(&mut self, bundle: T) -> EntityWorldMut<'_>

Source§

fn spawn_persisted_with_id<T: Bundle>( &mut self, id: impl Into<String>, bundle: T, ) -> EntityWorldMut<'_>

Implementors§