pub trait Handler: Sync {
type Error: Error + Send + Sync + 'static;
type Body<B: ReadableBody>: ReadableBody;
// Required method
fn call<B: ReadableBody, I: InterimHandler>(
&self,
request: Request<B>,
interim: &mut InterimResponses<I>,
cancellation: &Cancellation,
) -> impl Future<Output = Result<Response<Self::Body<B>>, Self::Error>> + Send;
}Expand description
Generic bodies and hooks keep handlers independent of the HTTP wire version and scheduler. A returned body may retain the request body, including borrows.
Required Associated Types§
type Error: Error + Send + Sync + 'static
type Body<B: ReadableBody>: ReadableBody
Required Methods§
fn call<B: ReadableBody, I: InterimHandler>( &self, request: Request<B>, interim: &mut InterimResponses<I>, cancellation: &Cancellation, ) -> impl Future<Output = Result<Response<Self::Body<B>>, Self::Error>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".