pub trait MemoryMappedMetric<T> {
type State;
// Required methods
fn init_state(&self) -> Self::State;
fn process_chunk(
&self,
state: &mut Self::State,
chunkidx: usize,
chunk: &[T],
) -> Result<()>;
fn finalize(&self, state: &Self::State) -> Result<f64>;
}Expand description
Trait for memory-mapped metrics computation
This trait allows metrics to be computed on very large datasets that don’t fit in memory by processing them in a streaming fashion.
Required Associated Types§
Required Methods§
Sourcefn init_state(&self) -> Self::State
fn init_state(&self) -> Self::State
Initialize the state