Trait Estimator

Source
pub trait Estimator<L: EstimationLogic + ?Sized>: AsRef<L::Backend> {
    type OwnedEstimator: EstimatorMut<L>;

    // Required methods
    fn logic(&self) -> &L;
    fn estimate(&self) -> f64;
    fn into_owned(self) -> Self::OwnedEstimator;
}
Expand description

An immutable estimator.

Immutable estimators are usually immutable views over some larger structure, or they contain some useful immutable state that can be reused.

An estimator must implement AsRef so to return a reference to its backend.

Required Associated Types§

Required Methods§

Source

fn logic(&self) -> &L

Returns the logic of the estimator.

Source

fn estimate(&self) -> f64

Returns an estimation of the number of distinct elements that have been added to the estimator so far.

Source

fn into_owned(self) -> Self::OwnedEstimator

Converts this estimator into an owned version capable of mutation.

Implementors§