Trait Histogram

Source
pub trait Histogram<P, L, F>
where P: HistogramParams,
{ // Required methods fn labels(&self, params: &P) -> Option<Box<dyn Iterator<Item = L>>>; fn frequency(&self, label: L, params: &P) -> Option<F>; fn total(&self) -> F; }
Expand description

Specifies the behaviors that are necessary to be a histogram. It is generic and parameterized by P, the type of parameters necessary, L, the type of the labels, and F, the type that stores the frequency. Both the labels and the frequencies need to be some sort of number.

Required Methods§

Source

fn labels(&self, params: &P) -> Option<Box<dyn Iterator<Item = L>>>

If possible, creates and returns an iterator for the labels for which the histogram has frequencies stored.

Source

fn frequency(&self, label: L, params: &P) -> Option<F>

If possible, returns the frequency of a particular label. The behavior need only be defined if the label is in the set of values returned from labels.

Source

fn total(&self) -> F

the total number of data-points in the histogram

Implementors§