pub trait Handler<Input>:
Send
+ Sync
+ 'static {
type Output;
// Required method
fn call<'life0, 'async_trait>(
&'life0 self,
input: Input,
) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A simplified asynchronous interface for handling input and output.
Composable request handlers.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl<H, F, I, O, R> Handler<I> for CatchUnwind<H, F>where
I: Send + 'static,
H: Handler<I, Output = Result<O>>,
O: IntoResponse + Send,
F: Handler<Box<dyn Any + Send>, Output = R>,
R: IntoResponse,
impl<H, F, I, O, R> Handler<I> for CatchUnwind<H, F>where
I: Send + 'static,
H: Handler<I, Output = Result<O>>,
O: IntoResponse + Send,
F: Handler<Box<dyn Any + Send>, Output = R>,
R: IntoResponse,
Source§impl<H, I, O, F, E, R> Handler<I> for CatchError<H, F, E, R>where
I: Send + 'static,
H: Handler<I, Output = Result<O>>,
O: IntoResponse + Send,
E: Error + Send + 'static,
F: Handler<E, Output = R>,
R: IntoResponse + 'static,
impl<H, I, O, F, E, R> Handler<I> for CatchError<H, F, E, R>where
I: Send + 'static,
H: Handler<I, Output = Result<O>>,
O: IntoResponse + Send,
E: Error + Send + 'static,
F: Handler<E, Output = R>,
R: IntoResponse + 'static,
Source§impl<H, I, O> Handler<I> for MapInToResponse<H>
impl<H, I, O> Handler<I> for MapInToResponse<H>
Source§impl<H, O, S, G, V> Handler<Request<Body>> for CsrfMiddleware<H, S, G, V>
Available on crate feature csrf only.
impl<H, O, S, G, V> Handler<Request<Body>> for CsrfMiddleware<H, S, G, V>
Available on crate feature
csrf only.Source§impl<H, O, S, G, V> Handler<Request<Body>> for SessionMiddleware<H, S, G, V>
Available on crate feature session only.
impl<H, O, S, G, V> Handler<Request<Body>> for SessionMiddleware<H, S, G, V>
Available on crate feature
session only.Source§impl<H, O, T> Handler<Request<Body>> for TracingMiddleware<H, T>
Available on crate features otel-tracing and otel and params only.
impl<H, O, T> Handler<Request<Body>> for TracingMiddleware<H, T>
Available on crate features
otel-tracing and otel and params only.Source§impl<H, O> Handler<Request<Body>> for CompressionMiddleware<H>
Available on crate feature compression only.
impl<H, O> Handler<Request<Body>> for CompressionMiddleware<H>
Available on crate feature
compression only.Source§impl<H, O> Handler<Request<Body>> for CookieMiddleware<H>
Available on crate feature cookie only.
impl<H, O> Handler<Request<Body>> for CookieMiddleware<H>
Available on crate feature
cookie only.Source§impl<H, O> Handler<Request<Body>> for LimitsMiddleware<H>
Available on crate feature limits only.
impl<H, O> Handler<Request<Body>> for LimitsMiddleware<H>
Available on crate feature
limits only.Source§impl<H, O> Handler<Request<Body>> for MetricsMiddleware<H>
Available on crate features otel-metrics and otel and params only.
impl<H, O> Handler<Request<Body>> for MetricsMiddleware<H>
Available on crate features
otel-metrics and otel and params only.