pub struct HyperLogLog8Builder<H, const BETA: bool = true> { /* private fields */ }Expand description
Builder for HyperLogLog8 cardinality-estimation logic.
The builder lets you configure:
- the number of registers, either directly
(
log2_num_regs) or via a target relative standard deviation (rsd); - the hash function (
build_hasher); - whether LogLog-β bias correction is
enabled (
beta).
Call build to obtain the configured HyperLogLog8
logic.
Implementations§
Source§impl HyperLogLog8Builder<BuildHasherDefault<DefaultHasher>>
impl HyperLogLog8Builder<BuildHasherDefault<DefaultHasher>>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new builder for a HyperLogLog8 logic.
Source§impl<H, const BETA: bool> HyperLogLog8Builder<H, BETA>
impl<H, const BETA: bool> HyperLogLog8Builder<H, BETA>
Sourcepub fn rsd(self, rsd: f64) -> Self
pub fn rsd(self, rsd: f64) -> Self
Sets the desired relative standard deviation.
This is a high-level alternative to Self::log2_num_regs. Calling one
after the other invalidates the work done by the first one.
§Arguments
rsd: the relative standard deviation to be attained.
§Panics
If the resulting number of registers is less than 16 (i.e., rsd is
too large).
Sourcepub const fn log2_num_regs(self, log2_num_regs: u32) -> Self
pub const fn log2_num_regs(self, log2_num_regs: u32) -> Self
Sourcepub fn beta<const BETA2: bool>(self) -> HyperLogLog8Builder<H, BETA2>
pub fn beta<const BETA2: bool>(self) -> HyperLogLog8Builder<H, BETA2>
Enables or disables the LogLog-β bias correction in the estimate.
See HyperLogLog8 for details.
Sourcepub fn build_hasher<H2>(self, build_hasher: H2) -> HyperLogLog8Builder<H2, BETA>
pub fn build_hasher<H2>(self, build_hasher: H2) -> HyperLogLog8Builder<H2, BETA>
Sets the BuildHasher to use.
Using this method you can select a specific hasher based on one or more seeds.
Sourcepub fn build<T>(self) -> HyperLogLog8<T, H, BETA>
pub fn build<T>(self) -> HyperLogLog8<T, H, BETA>
Builds the logic.
The type of objects the estimators keep track of is defined here by T,
but it is usually inferred by the compiler.
Trait Implementations§
Source§impl<H: Clone, const BETA: bool> Clone for HyperLogLog8Builder<H, BETA>
impl<H: Clone, const BETA: bool> Clone for HyperLogLog8Builder<H, BETA>
Source§fn clone(&self) -> HyperLogLog8Builder<H, BETA>
fn clone(&self) -> HyperLogLog8Builder<H, BETA>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more