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§
Sourcefn 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.