axum_codec::handler

Trait CodecHandler

Source
pub trait CodecHandler<T, I: Input, D, S>:
    Clone
    + Send
    + 'static {
    type Future: Future<Output = Response> + Send;

    // Required method
    fn call(self, req: Request, state: S) -> Self::Future;
}

Required Associated Types§

Source

type Future: Future<Output = Response> + Send

Required Methods§

Source

fn call(self, req: Request, state: S) -> Self::Future

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.

Implementors§

Source§

impl<F, Fut, Res, S> CodecHandler<((),), (), Res, S> for F
where F: FnOnce() -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, Res: IntoCodecResponse, S: Send + Sync + 'static,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1> CodecHandler<(M, T1), (T1,), Res, S> for F
where F: FnOnce(T1) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2> CodecHandler<(M, T1, T2), (T1, T2), Res, S> for F
where F: FnOnce(T1, T2) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3> CodecHandler<(M, T1, T2, T3), (T1, T2, T3), Res, S> for F
where F: FnOnce(T1, T2, T3) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4> CodecHandler<(M, T1, T2, T3, T4), (T1, T2, T3, T4), Res, S> for F
where F: FnOnce(T1, T2, T3, T4) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5> CodecHandler<(M, T1, T2, T3, T4, T5), (T1, T2, T3, T4, T5), Res, S> for F
where F: FnOnce(T1, T2, T3, T4, T5) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequestParts<S> + Send, T5: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6> CodecHandler<(M, T1, T2, T3, T4, T5, T6), (T1, T2, T3, T4, T5, T6), Res, S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequestParts<S> + Send, T5: Input + FromRequestParts<S> + Send, T6: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7> CodecHandler<(M, T1, T2, T3, T4, T5, T6, T7), (T1, T2, T3, T4, T5, T6, T7), Res, S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequestParts<S> + Send, T5: Input + FromRequestParts<S> + Send, T6: Input + FromRequestParts<S> + Send, T7: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8> CodecHandler<(M, T1, T2, T3, T4, T5, T6, T7, T8), (T1, T2, T3, T4, T5, T6, T7, T8), Res, S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequestParts<S> + Send, T5: Input + FromRequestParts<S> + Send, T6: Input + FromRequestParts<S> + Send, T7: Input + FromRequestParts<S> + Send, T8: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9> CodecHandler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9), (T1, T2, T3, T4, T5, T6, T7, T8, T9), Res, S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequestParts<S> + Send, T5: Input + FromRequestParts<S> + Send, T6: Input + FromRequestParts<S> + Send, T7: Input + FromRequestParts<S> + Send, T8: Input + FromRequestParts<S> + Send, T9: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> CodecHandler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), Res, S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequestParts<S> + Send, T5: Input + FromRequestParts<S> + Send, T6: Input + FromRequestParts<S> + Send, T7: Input + FromRequestParts<S> + Send, T8: Input + FromRequestParts<S> + Send, T9: Input + FromRequestParts<S> + Send, T10: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> CodecHandler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), Res, S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequestParts<S> + Send, T5: Input + FromRequestParts<S> + Send, T6: Input + FromRequestParts<S> + Send, T7: Input + FromRequestParts<S> + Send, T8: Input + FromRequestParts<S> + Send, T9: Input + FromRequestParts<S> + Send, T10: Input + FromRequestParts<S> + Send, T11: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> CodecHandler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12), (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12), Res, S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequestParts<S> + Send, T5: Input + FromRequestParts<S> + Send, T6: Input + FromRequestParts<S> + Send, T7: Input + FromRequestParts<S> + Send, T8: Input + FromRequestParts<S> + Send, T9: Input + FromRequestParts<S> + Send, T10: Input + FromRequestParts<S> + Send, T11: Input + FromRequestParts<S> + Send, T12: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> CodecHandler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13), (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13), Res, S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequestParts<S> + Send, T5: Input + FromRequestParts<S> + Send, T6: Input + FromRequestParts<S> + Send, T7: Input + FromRequestParts<S> + Send, T8: Input + FromRequestParts<S> + Send, T9: Input + FromRequestParts<S> + Send, T10: Input + FromRequestParts<S> + Send, T11: Input + FromRequestParts<S> + Send, T12: Input + FromRequestParts<S> + Send, T13: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> CodecHandler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14), (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14), Res, S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequestParts<S> + Send, T5: Input + FromRequestParts<S> + Send, T6: Input + FromRequestParts<S> + Send, T7: Input + FromRequestParts<S> + Send, T8: Input + FromRequestParts<S> + Send, T9: Input + FromRequestParts<S> + Send, T10: Input + FromRequestParts<S> + Send, T11: Input + FromRequestParts<S> + Send, T12: Input + FromRequestParts<S> + Send, T13: Input + FromRequestParts<S> + Send, T14: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> CodecHandler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15), (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15), Res, S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequestParts<S> + Send, T5: Input + FromRequestParts<S> + Send, T6: Input + FromRequestParts<S> + Send, T7: Input + FromRequestParts<S> + Send, T8: Input + FromRequestParts<S> + Send, T9: Input + FromRequestParts<S> + Send, T10: Input + FromRequestParts<S> + Send, T11: Input + FromRequestParts<S> + Send, T12: Input + FromRequestParts<S> + Send, T13: Input + FromRequestParts<S> + Send, T14: Input + FromRequestParts<S> + Send, T15: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Source§

impl<F, Fut, S, Res, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> CodecHandler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16), (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16), Res, S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) -> Fut + Clone + Send + 'static, Fut: Future<Output = Res> + Send, S: Send + Sync + 'static, Res: IntoCodecResponse, T1: Input + FromRequestParts<S> + Send, T2: Input + FromRequestParts<S> + Send, T3: Input + FromRequestParts<S> + Send, T4: Input + FromRequestParts<S> + Send, T5: Input + FromRequestParts<S> + Send, T6: Input + FromRequestParts<S> + Send, T7: Input + FromRequestParts<S> + Send, T8: Input + FromRequestParts<S> + Send, T9: Input + FromRequestParts<S> + Send, T10: Input + FromRequestParts<S> + Send, T11: Input + FromRequestParts<S> + Send, T12: Input + FromRequestParts<S> + Send, T13: Input + FromRequestParts<S> + Send, T14: Input + FromRequestParts<S> + Send, T15: Input + FromRequestParts<S> + Send, T16: Input + FromRequest<S, M> + Send,

Source§

type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>