Skip to main content

SignalTask

Trait SignalTask 

Source
pub trait SignalTask:
    Send
    + Sync
    + 'static {
    // Required method
    fn register_task(self: Box<Self>, world: &mut World) -> SignalHandle;
}
Expand description

A type-erased signal that can be managed as a free-floating “task”.

This trait enables Builder::hold_tasks to accept signals that haven’t been registered yet, deferring their registration until the entity is spawned.

Use the .task() method to convert a Signal, SignalVec, or SignalMap into a SignalTask.

Required Methods§

Source

fn register_task(self: Box<Self>, world: &mut World) -> SignalHandle

Register this signal task with the world and return its handle.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§