EventHandler

Trait EventHandler 

Source
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§

Source

fn handle_event(&self, event: &ComponentEvent, target: &str) -> SklResult<()>

Handle an event for a specific component

Source

fn handler_id(&self) -> &str

Get handler identifier

Source

fn can_handle(&self, event_type: &str) -> bool

Check if handler can process the event type

Implementors§