ProcessingStepHandler

Trait ProcessingStepHandler 

Source
pub trait ProcessingStepHandler: Send + Sync {
    // Required methods
    fn handles(&self) -> ProcessingStepType;
    fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        step: &'life1 ProcessingStep,
        ctx: &'life2 ProcessingContext<'life3>,
    ) -> Pin<Box<dyn Future<Output = Result<ProcessingStepOutput>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn validate(&self, step: &ProcessingStep) -> Result<()>;
}
Expand description

Handler trait for processing phase steps

Currently implemented by:

  • ScoringStepHandler - Risk scoring based on indicators

Required Methods§

Source

fn handles(&self) -> ProcessingStepType

Which step type this handler processes

Source

fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, step: &'life1 ProcessingStep, ctx: &'life2 ProcessingContext<'life3>, ) -> Pin<Box<dyn Future<Output = Result<ProcessingStepOutput>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Execute the processing step

Processing steps:

  1. Read data from acquisition results via ctx.acquisition_results()
  2. Perform computation (scoring, aggregation, etc.)
  3. Write results to JSONL via ctx.writer(step_name)
  4. Return ProcessingStepOutput with ResultHandle
Source

fn validate(&self, step: &ProcessingStep) -> Result<()>

Validate step configuration

Implementors§