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§
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> Handler<I> for MapInToResponse<H>
impl<H, I, O> Handler<I> for MapInToResponse<H>
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, 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 params
and otel
and otel-metrics
only.
impl<H, O> Handler<Request<Body>> for MetricsMiddleware<H>
Available on crate features
params
and otel
and otel-metrics
only.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 params
and otel
and otel-tracing
only.
impl<H, O, T> Handler<Request<Body>> for TracingMiddleware<H, T>
Available on crate features
params
and otel
and otel-tracing
only.