atlas_arch/
processor.rs

1use std::sync::Arc;
2
3use async_trait::async_trait;
4
5use crate::{error::IndexerResult, metrics::MetricsCollection};
6
7#[async_trait]
8/// Generic processing trait for transforming batches of inputs into an
9/// output, with access to metrics.
10pub trait Processor {
11    type InputType;
12    type OutputType;
13
14    /// Process a batch of inputs and optionally produce an output.
15    async fn process(
16        &mut self,
17        data: Vec<Self::InputType>,
18        metrics: Arc<MetricsCollection>,
19    ) -> IndexerResult<Self::OutputType>;
20}