pub trait MiddlewareHandlerFromFn<'r, T, S>: Sized {
    type Future: Future<Output = Response> + Send + 'r;

    // Required method
    fn call(
        &self,
        cx: &'r mut HttpContext,
        req: Incoming,
        state: &'r S,
        next: Next
    ) -> Self::Future;
}

Required Associated Types§

source

type Future: Future<Output = Response> + Send + 'r

Required Methods§

source

fn call( &self, cx: &'r mut HttpContext, req: Incoming, state: &'r S, next: Next ) -> Self::Future

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'r, F, Fut, Res, M, S, T1> MiddlewareHandlerFromFn<'r, (M, T1), S> for F
where F: Fn(&'r mut HttpContext, T1, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2> MiddlewareHandlerFromFn<'r, (M, T1, T2), S> for F
where F: Fn(T1, &'r mut HttpContext, T2, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3), S> for F
where F: Fn(T1, T2, &'r mut HttpContext, T3, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4), S> for F
where F: Fn(T1, T2, T3, &'r mut HttpContext, T4, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4, T5> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4, T5), S> for F
where F: Fn(T1, T2, T3, T4, &'r mut HttpContext, T5, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromContext<S> + Send + 'r, T5: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4, T5, T6> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4, T5, T6), S> for F
where F: Fn(T1, T2, T3, T4, T5, &'r mut HttpContext, T6, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromContext<S> + Send + 'r, T5: FromContext<S> + Send + 'r, T6: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4, T5, T6, T7> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4, T5, T6, T7), S> for F
where F: Fn(T1, T2, T3, T4, T5, T6, &'r mut HttpContext, T7, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromContext<S> + Send + 'r, T5: FromContext<S> + Send + 'r, T6: FromContext<S> + Send + 'r, T7: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4, T5, T6, T7, T8> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4, T5, T6, T7, T8), S> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, &'r mut HttpContext, T8, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromContext<S> + Send + 'r, T5: FromContext<S> + Send + 'r, T6: FromContext<S> + Send + 'r, T7: FromContext<S> + Send + 'r, T8: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4, T5, T6, T7, T8, T9> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4, T5, T6, T7, T8, T9), S> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, &'r mut HttpContext, T9, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromContext<S> + Send + 'r, T5: FromContext<S> + Send + 'r, T6: FromContext<S> + Send + 'r, T7: FromContext<S> + Send + 'r, T8: FromContext<S> + Send + 'r, T9: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), S> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, &'r mut HttpContext, T10, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromContext<S> + Send + 'r, T5: FromContext<S> + Send + 'r, T6: FromContext<S> + Send + 'r, T7: FromContext<S> + Send + 'r, T8: FromContext<S> + Send + 'r, T9: FromContext<S> + Send + 'r, T10: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), S> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, &'r mut HttpContext, T11, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromContext<S> + Send + 'r, T5: FromContext<S> + Send + 'r, T6: FromContext<S> + Send + 'r, T7: FromContext<S> + Send + 'r, T8: FromContext<S> + Send + 'r, T9: FromContext<S> + Send + 'r, T10: FromContext<S> + Send + 'r, T11: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12), S> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, &'r mut HttpContext, T12, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromContext<S> + Send + 'r, T5: FromContext<S> + Send + 'r, T6: FromContext<S> + Send + 'r, T7: FromContext<S> + Send + 'r, T8: FromContext<S> + Send + 'r, T9: FromContext<S> + Send + 'r, T10: FromContext<S> + Send + 'r, T11: FromContext<S> + Send + 'r, T12: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13), S> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, &'r mut HttpContext, T13, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromContext<S> + Send + 'r, T5: FromContext<S> + Send + 'r, T6: FromContext<S> + Send + 'r, T7: FromContext<S> + Send + 'r, T8: FromContext<S> + Send + 'r, T9: FromContext<S> + Send + 'r, T10: FromContext<S> + Send + 'r, T11: FromContext<S> + Send + 'r, T12: FromContext<S> + Send + 'r, T13: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14), S> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, &'r mut HttpContext, T14, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromContext<S> + Send + 'r, T5: FromContext<S> + Send + 'r, T6: FromContext<S> + Send + 'r, T7: FromContext<S> + Send + 'r, T8: FromContext<S> + Send + 'r, T9: FromContext<S> + Send + 'r, T10: FromContext<S> + Send + 'r, T11: FromContext<S> + Send + 'r, T12: FromContext<S> + Send + 'r, T13: FromContext<S> + Send + 'r, T14: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15), S> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, &'r mut HttpContext, T15, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromContext<S> + Send + 'r, T5: FromContext<S> + Send + 'r, T6: FromContext<S> + Send + 'r, T7: FromContext<S> + Send + 'r, T8: FromContext<S> + Send + 'r, T9: FromContext<S> + Send + 'r, T10: FromContext<S> + Send + 'r, T11: FromContext<S> + Send + 'r, T12: FromContext<S> + Send + 'r, T13: FromContext<S> + Send + 'r, T14: FromContext<S> + Send + 'r, T15: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>

source§

impl<'r, F, Fut, Res, M, S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> MiddlewareHandlerFromFn<'r, (M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16), S> for F
where F: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, &'r mut HttpContext, T16, Next) -> Fut + Copy + Send + Sync + 'static, Fut: Future<Output = Res> + Send + 'r, Res: IntoResponse + 'r, S: Send + Sync + 'r, T1: FromContext<S> + Send + 'r, T2: FromContext<S> + Send + 'r, T3: FromContext<S> + Send + 'r, T4: FromContext<S> + Send + 'r, T5: FromContext<S> + Send + 'r, T6: FromContext<S> + Send + 'r, T7: FromContext<S> + Send + 'r, T8: FromContext<S> + Send + 'r, T9: FromContext<S> + Send + 'r, T10: FromContext<S> + Send + 'r, T11: FromContext<S> + Send + 'r, T12: FromContext<S> + Send + 'r, T13: FromContext<S> + Send + 'r, T14: FromContext<S> + Send + 'r, T15: FromContext<S> + Send + 'r, T16: FromRequest<S, M> + Send + 'r,

§

type Future = ResponseFuture<'r, Response<RespBody>>