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§
sourcefn spawn_system<I, O, S, Marker>(&mut self, system: S) -> SysId
fn spawn_system<I, O, S, Marker>(&mut self, system: S) -> SysId
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().
sourcefn spawn_system_from<I, O>(&mut self, system: CallbackSystem<I, O>) -> SysId
fn spawn_system_from<I, O>(&mut self, system: CallbackSystem<I, O>) -> SysId
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().
sourcefn insert_system<I, O, S, Marker>(
&mut self,
entity: Entity,
system: S
) -> Result<(), ()>
fn insert_system<I, O, S, Marker>( &mut self, entity: Entity, system: S ) -> Result<(), ()>
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.
sourcefn spawned_syscall<I>(&mut self, sys_id: SysId, input: I)
fn spawned_syscall<I>(&mut self, sys_id: SysId, input: I)
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().