Trait async_middleware::Transform
source · [−]pub trait Transform<Args, T, O>: Send + Sync + 'static {
fn transform<'life0, 'async_trait>(
&'life0 self,
input: T
) -> Pin<Box<dyn Future<Output = O> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Middleware that transforms around an input to output type.
Required Methods
Implementors
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
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
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,
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)