1 2 3 4 5 6 7 8 9 10 11
use std::fmt::Debug; use async_trait::async_trait; #[async_trait] pub trait EventHandler { type InputEvent; type OutputEvent; type Error: Debug; async fn handle_event(&mut self, input: Self::InputEvent) -> Result<Self::OutputEvent, Self::Error>; }