pub trait EventHandler {
type HandleFuture<'a>: Future<Output = ApplicationResult<()>> + Send + 'a
where Self: 'a;
// Required method
fn handle_event(&self, event: &DomainEvent) -> Self::HandleFuture<'_>;
}Expand description
Zero-cost event handler trait with stack allocation
Required Associated Types§
type HandleFuture<'a>: Future<Output = ApplicationResult<()>> + Send + 'a where Self: 'a
Required Methods§
fn handle_event(&self, event: &DomainEvent) -> Self::HandleFuture<'_>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.