Skip to main content

With

Trait With 

Source
pub trait With<Args>:
    Clone
    + Send
    + Sync
    + 'static {
    type Output;

    // Required method
    fn with(
        &self,
        args: Args,
        next: Next,
    ) -> impl Future<Output = Self::Output> + Send;
}
Expand description

Describes a generic middleware handler that could take 0 or N parameters and Next middleware

Required Associated Types§

Source

type Output

Return type

Required Methods§

Source

fn with( &self, args: Args, next: Next, ) -> impl Future<Output = Self::Output> + Send

Calls the middleware 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> With<()> for Func
where Func: Fn(Next) -> Fut + Send + Sync + Clone + 'static, Fut: Future + Send,

Source§

type Output = <Fut as Future>::Output

Source§

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

Source§

type Output = <Fut as Future>::Output

Source§

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

Source§

type Output = <Fut as Future>::Output

Source§

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

Source§

type Output = <Fut as Future>::Output

Source§

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

Source§

type Output = <Fut as Future>::Output

Source§

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

Source§

type Output = <Fut as Future>::Output

Source§

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

Source§

type Output = <Fut as Future>::Output

Source§

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

Source§

type Output = <Fut as Future>::Output

Source§

impl<Func, Fut, T1, T2, T3, T4, T5, T6, T7, T8> With<(T1, T2, T3, T4, T5, T6, T7, T8)> for Func
where Func: Fn(T1, T2, T3, T4, T5, T6, T7, T8, Next) -> Fut + Send + Sync + Clone + 'static, Fut: Future + Send,

Source§

type Output = <Fut as Future>::Output

Source§

impl<Func, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9> With<(T1, T2, T3, T4, T5, T6, T7, T8, T9)> for Func
where Func: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, Next) -> Fut + Send + Sync + Clone + 'static, Fut: Future + Send,

Source§

type Output = <Fut as Future>::Output

Source§

impl<Func, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> With<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> for Func
where Func: Fn(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Next) -> Fut + Send + Sync + Clone + 'static, Fut: Future + Send,

Source§

type Output = <Fut as Future>::Output