pub trait Handler<Api: Api, B: Backend = NoBackend>: Send + Sync {
    // Required method
    fn handle<'life0, 'async_trait>(
        session: HandlerSession<'life0, B>,
        request: Api
    ) -> Pin<Box<dyn Future<Output = HandlerResult<Api>> + Send + 'async_trait>>
       where 'life0: 'async_trait;
}
Expand description

A trait that can dispatch requests for a [Api].

Required Methods§

source

fn handle<'life0, 'async_trait>( session: HandlerSession<'life0, B>, request: Api ) -> Pin<Box<dyn Future<Output = HandlerResult<Api>> + Send + 'async_trait>>where 'life0: 'async_trait,

Returns a dispatcher to handle custom api requests. The parameters are provided so that they can be cloned if needed during the processing of requests.

Implementors§