Skip to main content

PersistSpawnCommandsExt

Trait PersistSpawnCommandsExt 

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

Ergonomic helpers for spawning persisted entities via Commands.

These helpers always attach a Guid component so call sites do not need to remember (Guid, Bundle) tuples.

Required Methods§

Source

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

Source

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

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<'w, 's> PersistSpawnCommandsExt for Commands<'w, 's>

Source§

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

Source§

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

Implementors§