Trait EventHandler
pub trait EventHandler {
// Required method
fn handle_event(&self, event: Event) -> Result<(), ReplayEvent>;
}Expand description
A trait implemented for objects handling events from EventsProvider.
An async variation also exists for implementations of EventsProvider that support async
event handling. The async event handler should satisfy the generic bounds: F: core::future::Future<Output = Result<(), ReplayEvent>>, H: Fn(Event) -> F.
Required Methods§
fn handle_event(&self, event: Event) -> Result<(), ReplayEvent>
fn handle_event(&self, event: Event) -> Result<(), ReplayEvent>
Handles the given Event.
See EventsProvider for details that must be considered when implementing this method.