Trait Handler

Source
pub trait Handler<Input: DeserializeOwned> {
    type Response;
    type Error;
    type Future: Future<Output = Result<Self::Response, Self::Error>>;

    // Required method
    fn handle(&mut self, source: String, event: Input) -> Self::Future;
}

Required Associated Types§

Source

type Response

Source

type Error

Source

type Future: Future<Output = Result<Self::Response, Self::Error>>

Required Methods§

Source

fn handle(&mut self, source: String, event: Input) -> Self::Future

Implementors§

Source§

impl<T, F, Input, R, E> Handler<Input> for HandlerFn<T>
where T: FnMut(String, Input) -> F, F: Future<Output = Result<R, E>>, Input: DeserializeOwned,