Trait bonsaidb_server::api::Handler
source · [−]pub trait Handler<B: Backend, Api: Api>: Send + Sync {
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
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,
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.