ChunkedMetric

Trait ChunkedMetric 

Source
pub trait ChunkedMetric<T> {
    type State: Send + Sync;

    // Required methods
    fn init_state(&self) -> Self::State;
    fn process_chunk(&self, state: &mut Self::State, chunk: &[T]) -> Result<()>;
    fn finalize(&self, state: &Self::State) -> Result<f64>;
}
Expand description

Trait for defining chunked metric operations

Required Associated Types§

Source

type State: Send + Sync

Type for intermediate state

Required Methods§

Source

fn init_state(&self) -> Self::State

Initialize state

Source

fn process_chunk(&self, state: &mut Self::State, chunk: &[T]) -> Result<()>

Process a chunk and update state

Source

fn finalize(&self, state: &Self::State) -> Result<f64>

Finalize computation from state

Implementors§