pub trait EventHandler:
Send
+ Sync
+ Debug {
// Required methods
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 dyn Event,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn name(&self) -> &str;
fn event_types(&self) -> Vec<&'static str>;
// Provided methods
fn is_wildcard(&self) -> bool { ... }
fn priority(&self) -> i32 { ... }
}
Expand description
Event handler trait for processing events
Required Methods§
Sourcefn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 dyn Event,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 dyn Event,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle an event
Sourcefn event_types(&self) -> Vec<&'static str>
fn event_types(&self) -> Vec<&'static str>
Get event types this handler is interested in
Provided Methods§
Sourcefn is_wildcard(&self) -> bool
fn is_wildcard(&self) -> bool
Whether this handler should receive all events (wildcard)