Skip to main content

Handler

Trait Handler 

Source
pub trait Handler<T, S>:
    Clone
    + Send
    + Sync
    + 'static {
    // Required method
    fn call(self, req: Request<Body>, state: Arc<S>) -> BoxedFuture;
}
Expand description

Trait for types that can handle an HTTP request.

This is blanket-implemented for both async fns (which are marked with AsyncHandler) and synchronous fn/closures (which are marked with SyncHandler).

§Performance & Zero-Allocation Routing

  • Arity-0 handlers (no extractors) take the fast path: synchronous ones return ResponseFuture::Ready directly with zero box allocations; async ones are eagerly polled once (the same future instance is kept and reused if it turns out to be pending, never re-invoked, so any side effects before the first .await still run exactly once) and only fall back to a boxed future (ResponseFuture::Boxed) if they actually yield (i.e. genuinely await something).
  • Handlers with ≥1 extractor always go through ResponseFuture::Boxed, sync or async. This is because the last extractor implements FromRequest, which is async (bodies may be streamed in rather than already buffered — see crate::routing::extract::BodyStream), so it can’t be resolved before deciding Ready vs. Boxed.

§⚠️ Thread Starvation & Blocking Warning

Because Tachyon runs on a cooperative async thread pool (Tokio), blocking any worker thread with long-running synchronous code (e.g. std::fs::read or blocking database calls) will stall the event loop.

  • DO: Use sync handlers ONLY for instant CPU operations (e.g., formatting data, static templates, or simple state reads).
  • DON’T: Do heavy or blocking I/O synchronously inside sync handlers. Instead, use async versions or offload blocking calls to tokio::task::spawn_blocking.

Required Methods§

Source

fn call(self, req: Request<Body>, state: Arc<S>) -> BoxedFuture

Consume self and produce a future that resolves to the response.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16> Handler<AsyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequestParts<S> + Send + 'static, A11: FromRequestParts<S> + Send + 'static, A12: FromRequestParts<S> + Send + 'static, A13: FromRequestParts<S> + Send + 'static, A14: FromRequestParts<S> + Send + 'static, A15: FromRequestParts<S> + Send + 'static, A16: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15> Handler<AsyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequestParts<S> + Send + 'static, A11: FromRequestParts<S> + Send + 'static, A12: FromRequestParts<S> + Send + 'static, A13: FromRequestParts<S> + Send + 'static, A14: FromRequestParts<S> + Send + 'static, A15: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14> Handler<AsyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequestParts<S> + Send + 'static, A11: FromRequestParts<S> + Send + 'static, A12: FromRequestParts<S> + Send + 'static, A13: FromRequestParts<S> + Send + 'static, A14: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> Handler<AsyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequestParts<S> + Send + 'static, A11: FromRequestParts<S> + Send + 'static, A12: FromRequestParts<S> + Send + 'static, A13: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12> Handler<AsyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequestParts<S> + Send + 'static, A11: FromRequestParts<S> + Send + 'static, A12: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11> Handler<AsyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequestParts<S> + Send + 'static, A11: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> Handler<AsyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9> Handler<AsyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4, A5, A6, A7, A8> Handler<AsyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4, A5, A6, A7> Handler<AsyncHandler<(A1, A2, A3, A4, A5, A6, A7)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4, A5, A6> Handler<AsyncHandler<(A1, A2, A3, A4, A5, A6)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4, A5> Handler<AsyncHandler<(A1, A2, A3, A4, A5)>, S> for F
where F: Fn(A1, A2, A3, A4, A5) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3, A4> Handler<AsyncHandler<(A1, A2, A3, A4)>, S> for F
where F: Fn(A1, A2, A3, A4) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2, A3> Handler<AsyncHandler<(A1, A2, A3)>, S> for F
where F: Fn(A1, A2, A3) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1, A2> Handler<AsyncHandler<(A1, A2)>, S> for F
where F: Fn(A1, A2) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res, A1> Handler<AsyncHandler<(A1,)>, S> for F
where F: Fn(A1) -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, A1: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, Fut, S, Res> Handler<AsyncHandler<()>, S> for F
where F: Fn() -> Fut + Clone + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'static, Res: IntoResponse + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16> Handler<SyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequestParts<S> + Send + 'static, A11: FromRequestParts<S> + Send + 'static, A12: FromRequestParts<S> + Send + 'static, A13: FromRequestParts<S> + Send + 'static, A14: FromRequestParts<S> + Send + 'static, A15: FromRequestParts<S> + Send + 'static, A16: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15> Handler<SyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequestParts<S> + Send + 'static, A11: FromRequestParts<S> + Send + 'static, A12: FromRequestParts<S> + Send + 'static, A13: FromRequestParts<S> + Send + 'static, A14: FromRequestParts<S> + Send + 'static, A15: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14> Handler<SyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequestParts<S> + Send + 'static, A11: FromRequestParts<S> + Send + 'static, A12: FromRequestParts<S> + Send + 'static, A13: FromRequestParts<S> + Send + 'static, A14: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> Handler<SyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequestParts<S> + Send + 'static, A11: FromRequestParts<S> + Send + 'static, A12: FromRequestParts<S> + Send + 'static, A13: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12> Handler<SyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequestParts<S> + Send + 'static, A11: FromRequestParts<S> + Send + 'static, A12: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11> Handler<SyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequestParts<S> + Send + 'static, A11: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> Handler<SyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequestParts<S> + Send + 'static, A10: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4, A5, A6, A7, A8, A9> Handler<SyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8, A9)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8, A9) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequestParts<S> + Send + 'static, A9: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4, A5, A6, A7, A8> Handler<SyncHandler<(A1, A2, A3, A4, A5, A6, A7, A8)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7, A8) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequestParts<S> + Send + 'static, A8: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4, A5, A6, A7> Handler<SyncHandler<(A1, A2, A3, A4, A5, A6, A7)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6, A7) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequestParts<S> + Send + 'static, A7: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4, A5, A6> Handler<SyncHandler<(A1, A2, A3, A4, A5, A6)>, S> for F
where F: Fn(A1, A2, A3, A4, A5, A6) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequestParts<S> + Send + 'static, A6: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4, A5> Handler<SyncHandler<(A1, A2, A3, A4, A5)>, S> for F
where F: Fn(A1, A2, A3, A4, A5) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequestParts<S> + Send + 'static, A5: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3, A4> Handler<SyncHandler<(A1, A2, A3, A4)>, S> for F
where F: Fn(A1, A2, A3, A4) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequestParts<S> + Send + 'static, A4: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2, A3> Handler<SyncHandler<(A1, A2, A3)>, S> for F
where F: Fn(A1, A2, A3) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequestParts<S> + Send + 'static, A3: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1, A2> Handler<SyncHandler<(A1, A2)>, S> for F
where F: Fn(A1, A2) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequestParts<S> + Send + 'static, A2: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res, A1> Handler<SyncHandler<(A1,)>, S> for F
where F: Fn(A1) -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, A1: FromRequest<S> + Send + 'static, S: Send + Sync + 'static,

Source§

impl<F, S, Res> Handler<SyncHandler<()>, S> for F
where F: Fn() -> Res + Clone + Send + Sync + 'static, Res: IntoResponse + Send + 'static, S: Send + Sync + 'static,

Source§

impl<Svc, RespBody, S> Handler<TowerServiceMarker, S> for ServiceHandler<Svc>
where S: Send + Sync + 'static, Svc: Service<Request<Bytes>, Response = Response<RespBody>> + Clone + Send + Sync + 'static, Svc::Future: Send + 'static, Svc::Error: Into<Error> + Send, RespBody: Body<Data = Bytes> + Send + 'static, RespBody::Error: Into<Error>,