Trait lamedh_runtime::Handler[][src]

pub trait Handler<A, B> {
    type Error;
    type Fut: Future<Output = Result<B, Self::Error>>;
    fn call(&mut self, event: A, context: Context) -> Self::Fut;
}

A trait describing an asynchronous function A to B.

Associated Types

type Error[src]

Errors returned by this handler.

type Fut: Future<Output = Result<B, Self::Error>>[src]

Response of this handler.

Loading content...

Required methods

fn call(&mut self, event: A, context: Context) -> Self::Fut[src]

Handle the incoming event.

Loading content...

Implementors

impl<F, A, B, Error, Fut> Handler<A, B> for HandlerFn<F> where
    F: Fn(A, Context) -> Fut,
    Fut: Future<Output = Result<B, Error>> + Send,
    Error: Into<Box<dyn Error + Send + Sync + 'static>> + Display
[src]

type Error = Error

type Fut = Fut

Loading content...