Skip to main content

EventHandler

Trait EventHandler 

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

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

Required Associated Types§

type Output

type Error

Required Methods§

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

Implementors§

§

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

§

type Output = Output

§

type Error = Error