papergrid/estimation/mod.rs
1///! The module contains an [`Estimate`] trait and its implementations.
2use crate::GridConfig;
3
4pub mod height;
5pub mod width;
6mod width_func;
7
8/// An Evaluator of an metric of a [`Grid`]
9///
10/// [`Grid`]: crate::Grid
11pub trait Estimate<R> {
12 /// Estimates a metric.
13 fn estimate(&mut self, records: R, cfg: &GridConfig);
14 /// Gets a metric by index.
15 fn get(&self, i: usize) -> Option<usize>;
16 /// Calculates a sum of metrics.
17 fn total(&self) -> usize;
18}