Skip to main content

Operation

Trait Operation 

Source
pub trait Operation<T: Interceptable>: Send + Sync {
    // Required method
    fn execute<'a>(
        &'a self,
        input: &'a T::Input,
    ) -> Pin<Box<dyn Future<Output = T::Output> + Send + 'a>>
       where T::Input: Sync;
}
Expand description

The final operation to execute after all interceptors.

This is object-safe to allow storing different operation types.

Required Methods§

Source

fn execute<'a>( &'a self, input: &'a T::Input, ) -> Pin<Box<dyn Future<Output = T::Output> + Send + 'a>>
where T::Input: Sync,

Execute the operation.

Implementors§

Source§

impl<T, F> Operation<T> for FnOperation<T, F>
where T: Interceptable, F: Fn(&T::Input) -> Pin<Box<dyn Future<Output = T::Output> + Send + '_>> + Send + Sync,