Trait Middleware

Source
pub trait Middleware<I, O>:
    Send
    + Sync
    + 'static {
    // Required method
    fn call<'life0, 'async_trait>(
        &'life0 self,
        input: I,
    ) -> Pin<Box<dyn Future<Output = O> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Middleware that performs an operation.

Required Methods§

Source

fn call<'life0, 'async_trait>( &'life0 self, input: I, ) -> Pin<Box<dyn Future<Output = O> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

Source§

impl<T, Args, I, O> Middleware<I, O> for Pied<T, Args, I, O>
where T: Send + Sync + 'static, Args: Send + Sync + 'static, I: Send + Sync + 'static, O: Send + Sync + 'static,

Implements the middleware trait for the main Pied structure

Source§

impl<T, T2, A, B, C> Middleware<A, C> for ConvertMiddleware<T, T2, A, B, C>
where T: Send + Sync + 'static, T2: Send + Sync + 'static, A: Send + Sync + 'static, B: Send + Sync + 'static, C: Send + Sync + 'static,

Implements the middleware trait on the conversion middleware to make it A -> C