Trait Transform

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

Middleware that transforms around an input to output type.

Required Methods§

Source

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

Asynchronously execute this handler to modify state

Implementors§

Source§

impl<Func, Fut, O> Transform<(), (), O> for Func
where Func: Send + Sync + 'static + Fn() -> Fut, Fut: Future<Output = O> + Send + Sync + 'static, O: Send + Sync + 'static,

Middleware implementation for an async function that produces an output

Source§

impl<Func, Fut, T, O> Transform<(T, O), T, O> for Func
where Func: Send + Sync + 'static + Fn(T) -> Fut, Fut: Future<Output = O> + Send + Sync + 'static, T: Send + Sync + 'static, O: Send + Sync + 'static,

Middleware implementation for an async function that returns nothing

Source§

impl<T, Args, I, O> Transform<(I, O), 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,

Source§

impl<T, T2, A, B, C> Transform<(A, C), 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 transform trait on the conversion middleware (for downstream)