pub trait Handler: Send + Sync {
type RespBody: Body;
type Error: Into<Box<dyn Error + Send + Sync>>;
type Fut<'fut>: Future<Output = Result<Response<Self::RespBody>, Self::Error>>
where Self: 'fut;
// Required method
fn call(&self, req: Request<ReqBody>) -> Self::Fut<'_>;
}Required Associated Types§
type RespBody: Body
type Error: Into<Box<dyn Error + Send + Sync>>
type Fut<'fut>: Future<Output = Result<Response<Self::RespBody>, Self::Error>> where Self: 'fut
Required Methods§
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.