Skip to main content

Processor

Trait Processor 

Source
pub trait Processor: Send + Sync {
    // Required method
    fn process<'life0, 'life1, 'async_trait>(
        &'life0 self,
        exchange: &'life1 mut Exchange,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

The central abstraction. Processors are composed into pipelines; they transform the Exchange in place (or route it elsewhere) and return Ok(()) to let the pipeline continue, or an error to trigger the error handler.

Required Methods§

Source

fn process<'life0, 'life1, 'async_trait>( &'life0 self, exchange: &'life1 mut Exchange, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§

Source§

impl<F> Processor for FnProcessor<F>
where F: Fn(&mut Exchange) -> Result<()> + Send + Sync + 'static,