pub trait Handler<E>: Send {
// Required method
fn run(&mut self, world: &mut World, event: E);
// Provided method
fn name(&self) -> &'static str { ... }
}Expand description
Object-safe dispatch trait for event handlers.
Analogous to Bevy’s System trait.
Enables Box<dyn Handler<E>> for type-erased heterogeneous dispatch.
Storage and scheduling are the driver’s responsibility — this trait
only defines the dispatch interface.
Send is required because handlers live in World (via driver
storage like timer wheels), and World is Send. All concrete
handler types (Callback, HandlerFn) satisfy this automatically
for typical usage (function pointers, ResourceId state, Send context).
Takes &mut World — drivers call this directly in their poll loop.