Skip to main content

EventHandler

Trait EventHandler 

Source
pub trait EventHandler<E> {
    type Output;
    type Error;

    // Required method
    fn handle(&self, event: E) -> Result<Self::Output, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn handle(&self, event: E) -> Result<Self::Output, Self::Error>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<E, F, Output, Error> EventHandler<E> for F
where F: Fn(E) -> Result<Output, Error>,

Source§

type Output = Output

Source§

type Error = Error