Trait bevy_cobweb::ecs::SpawnedSyscallCommandsExt

source ·
pub trait SpawnedSyscallCommandsExt {
    // Required methods
    fn spawn_system<I, O, S, Marker>(&mut self, system: S) -> SysId
       where I: Send + Sync + 'static,
             O: Send + Sync + 'static,
             S: IntoSystem<I, O, Marker> + Send + Sync + 'static;
    fn spawn_system_from<I, O>(&mut self, system: CallbackSystem<I, O>) -> SysId
       where I: Send + Sync + 'static,
             O: Send + Sync + 'static;
    fn insert_system<I, O, S, Marker>(
        &mut self,
        entity: Entity,
        system: S
    ) -> Result<(), ()>
       where I: Send + Sync + 'static,
             O: Send + Sync + 'static,
             S: IntoSystem<I, O, Marker> + Send + Sync + 'static;
    fn spawned_syscall<I>(&mut self, sys_id: SysId, input: I)
       where I: Send + Sync + 'static;
}

Required Methods§

source

fn spawn_system<I, O, S, Marker>(&mut self, system: S) -> SysId
where I: Send + Sync + 'static, O: Send + Sync + 'static, S: IntoSystem<I, O, Marker> + Send + Sync + 'static,

Schedule a system to be spawned.

Systems are not initialized until they are first run.

Returns the system id that will eventually reference the spawned system. It can be used to invoke the system with spawned_syscall() or SpawnedSyscallCommandsExt::spawned_syscall().

source

fn spawn_system_from<I, O>(&mut self, system: CallbackSystem<I, O>) -> SysId
where I: Send + Sync + 'static, O: Send + Sync + 'static,

Schedule a system to be spawned.

Returns the system id that will eventually reference the spawned system. It can be used to invoke the system with spawned_syscall() or SpawnedSyscallCommandsExt::spawned_syscall().

source

fn insert_system<I, O, S, Marker>( &mut self, entity: Entity, system: S ) -> Result<(), ()>
where I: Send + Sync + 'static, O: Send + Sync + 'static, S: IntoSystem<I, O, Marker> + Send + Sync + 'static,

Schedule a system to be inserted into the specified entity.

This is useful for constructing self-referential systems, e.g. for systems that only run once then clean themselves up.

Returns an error if the entity does not exist.

source

fn spawned_syscall<I>(&mut self, sys_id: SysId, input: I)
where I: Send + Sync + 'static,

Schedule a spawned system call.

It is the responsibility of the caller to correctly match the system entity with the target system signature.

Logs a warning if the system entity doesn’t exist.

Syntax sugar for spawned_syscall().

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'w, 's> SpawnedSyscallCommandsExt for Commands<'w, 's>

source§

fn spawn_system<I, O, S, Marker>(&mut self, system: S) -> SysId
where I: Send + Sync + 'static, O: Send + Sync + 'static, S: IntoSystem<I, O, Marker> + Send + Sync + 'static,

source§

fn spawn_system_from<I, O>(&mut self, system: CallbackSystem<I, O>) -> SysId
where I: Send + Sync + 'static, O: Send + Sync + 'static,

source§

fn insert_system<I, O, S, Marker>( &mut self, entity: Entity, system: S ) -> Result<(), ()>
where I: Send + Sync + 'static, O: Send + Sync + 'static, S: IntoSystem<I, O, Marker> + Send + Sync + 'static,

source§

fn spawned_syscall<I>(&mut self, sys_id: SysId, input: I)
where I: Send + Sync + 'static,

Implementors§