Skip to main content

TapReqHandler

Trait TapReqHandler 

Source
pub trait TapReqHandler<Args = ()>:
    Clone
    + Send
    + Sync
    + 'static {
    type Output;
    type Future: Future<Output = Self::Output> + Send;

    // Required method
    fn call(&self, req: HttpRequestMut, args: Args) -> Self::Future;
}
Expand description

Describes a generic [tap_req] middleware handler that could take 0 or N parameters and HttpRequestMut

Required Associated Types§

Source

type Output

Return type

Source

type Future: Future<Output = Self::Output> + Send

Tap handler future

Required Methods§

Source

fn call(&self, req: HttpRequestMut, args: Args) -> Self::Future

Calls the [tap_req] handler

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<Func, Fut> TapReqHandler for Func
where Func: Fn(HttpRequestMut) -> Fut + Send + Sync + Clone + 'static, Fut: Future + Send,

Available on crate feature di only.
Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, T1> TapReqHandler<(T1,)> for Func
where Func: Fn(HttpRequestMut, T1) -> Fut + Send + Sync + Clone + 'static, Fut: Future + Send,

Available on crate feature di only.
Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, T1, T2> TapReqHandler<(T1, T2)> for Func
where Func: Fn(HttpRequestMut, T1, T2) -> Fut + Send + Sync + Clone + 'static, Fut: Future + Send,

Available on crate feature di only.
Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, T1, T2, T3> TapReqHandler<(T1, T2, T3)> for Func
where Func: Fn(HttpRequestMut, T1, T2, T3) -> Fut + Send + Sync + Clone + 'static, Fut: Future + Send,

Available on crate feature di only.
Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, T1, T2, T3, T4> TapReqHandler<(T1, T2, T3, T4)> for Func
where Func: Fn(HttpRequestMut, T1, T2, T3, T4) -> Fut + Send + Sync + Clone + 'static, Fut: Future + Send,

Available on crate feature di only.
Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, T1, T2, T3, T4, T5> TapReqHandler<(T1, T2, T3, T4, T5)> for Func
where Func: Fn(HttpRequestMut, T1, T2, T3, T4, T5) -> Fut + Send + Sync + Clone + 'static, Fut: Future + Send,

Available on crate feature di only.
Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut