Trait axum_starter::PrepareDecorator

source ·
pub trait PrepareDecorator: 'static {
    type OutFut<Fut, T>: Future<Output = Result<T, PrepareError>> + 'static
       where Fut: Future<Output = Result<T, PrepareError>> + 'static,
             T: 'static;

    // Required method
    fn decorator<Fut, T>(
        &self,
        src: &'static str,
        in_fut: Fut
    ) -> Self::OutFut<Fut, T>
       where Fut: Future<Output = Result<T, PrepareError>> + 'static,
             T: 'static;

    // Provided method
    fn prepare_decorator<C, P, Fut>(
        &self,
        in_fut: Fut
    ) -> Self::OutFut<Fut, P::Effect>
       where Fut: Future<Output = Result<P::Effect, PrepareError>> + 'static,
             P: Prepare<C>,
             C: 'static { ... }
}
Expand description

add decorator for each prepare ’s Future

It is useful for adding extra functional on original prepare task

Required Associated Types§

source

type OutFut<Fut, T>: Future<Output = Result<T, PrepareError>> + 'static where Fut: Future<Output = Result<T, PrepareError>> + 'static, T: 'static

Required Methods§

source

fn decorator<Fut, T>( &self, src: &'static str, in_fut: Fut ) -> Self::OutFut<Fut, T>
where Fut: Future<Output = Result<T, PrepareError>> + 'static, T: 'static,

Provided Methods§

source

fn prepare_decorator<C, P, Fut>( &self, in_fut: Fut ) -> Self::OutFut<Fut, P::Effect>
where Fut: Future<Output = Result<P::Effect, PrepareError>> + 'static, P: Prepare<C>, C: 'static,

Object Safety§

This trait is not object safe.

Implementors§