pub trait EventHandler<S, A, Id, Ctx>: 'staticwhere
Id: ComponentId,
Ctx: BindingContext,{
// Required method
fn handle(
&mut self,
event: RoutedEvent<'_, Id, Ctx>,
state: &S,
) -> HandlerResponse<A>;
}Expand description
Trait for event handlers registered with the bus.
Required Methods§
fn handle( &mut self, event: RoutedEvent<'_, Id, Ctx>, state: &S, ) -> HandlerResponse<A>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".