pub trait CardinalitySketch: Sketch {
// Required methods
fn estimate(&self) -> f64;
fn error_bounds(&self, confidence: f64) -> ErrorBounds;
fn relative_error(&self) -> f64;
// Provided method
fn estimate_with_bounds(&self) -> ErrorBounds { ... }
}Expand description
Cardinality (distinct count) estimation sketches
Required Methods§
Sourcefn error_bounds(&self, confidence: f64) -> ErrorBounds
fn error_bounds(&self, confidence: f64) -> ErrorBounds
Get error bounds at given confidence level (0.0 to 1.0)
Sourcefn relative_error(&self) -> f64
fn relative_error(&self) -> f64
Relative standard error (RSE) of the estimate
RSE = standard_error / true_value ≈ 1.04 / sqrt(m) for HLL
Provided Methods§
Sourcefn estimate_with_bounds(&self) -> ErrorBounds
fn estimate_with_bounds(&self) -> ErrorBounds
Estimate with default 95% confidence bounds
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl CardinalitySketch for HyperLogLog
Available on crate feature
cardinality only.