pub trait EventHandler: Send + Sync {
// Required methods
fn handle_event(
&self,
event: &ComponentEvent,
target: &str,
) -> SklResult<()>;
fn handler_id(&self) -> &str;
fn can_handle(&self, event_type: &str) -> bool;
}Expand description
Event handler trait for processing events
Required Methods§
Sourcefn handle_event(&self, event: &ComponentEvent, target: &str) -> SklResult<()>
fn handle_event(&self, event: &ComponentEvent, target: &str) -> SklResult<()>
Handle an event for a specific component
Sourcefn handler_id(&self) -> &str
fn handler_id(&self) -> &str
Get handler identifier
Sourcefn can_handle(&self, event_type: &str) -> bool
fn can_handle(&self, event_type: &str) -> bool
Check if handler can process the event type