Skip to main content

Processor

Trait Processor 

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

Collects events as the algorithm runs and mutates the composition’s state.

Required Methods§

Source

fn process<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, state: &'life1 mut S, event: Event<'life2>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Process an event, accumulating facts into state. Request-bearing events (Event::Request, Event::Decision) may also be rewritten in place.

Implementors§

Source§

impl<S> Processor<S> for AffinityRouter
where S: Send + 'static,

Source§

impl<S: Send> Processor<S> for SystemPromptProcessor