pub struct HyperLogLogBuilder<H, W = usize> { /* private fields */ }
Expand description
Builds a HyperLogLog
cardinality-estimator logic.
Implementations§
Source§impl HyperLogLogBuilder<BuildHasherDefault<DefaultHasher>, usize>
impl HyperLogLogBuilder<BuildHasherDefault<DefaultHasher>, usize>
Sourcepub fn new(n: usize) -> Self
pub fn new(n: usize) -> Self
Creates a new builder for a HyperLogLog
logic with a default word
type of usize
.
Source§impl<H, W: Word> HyperLogLogBuilder<H, W>
impl<H, W: Word> HyperLogLogBuilder<H, W>
Sourcepub fn rsd(self, rsd: f64) -> Self
pub fn rsd(self, rsd: f64) -> Self
Sets the desired relative standard deviation.
§Note
This is a high-level alternative to Self::log_2_num_reg
. Calling one
after the other invalidates the work done by the first one.
§Arguments
rsd
: the relative standard deviation to be attained.
Sourcepub fn log_2_num_reg(self, log_2_num_registers: usize) -> Self
pub fn log_2_num_reg(self, log_2_num_registers: usize) -> Self
Sourcepub fn word_type<W2>(self) -> HyperLogLogBuilder<H, W2>
pub fn word_type<W2>(self) -> HyperLogLogBuilder<H, W2>
Sets the type W
to use to represent backends.
See the logic documentation
for the limitations on the
choice of W2
.
Sourcepub fn num_elements(self, n: usize) -> Self
pub fn num_elements(self, n: usize) -> Self
Sets the upper bound on the number of elements.
Sourcepub fn build_hasher<H2>(self, build_hasher: H2) -> HyperLogLogBuilder<H2, W>
pub fn build_hasher<H2>(self, build_hasher: H2) -> HyperLogLogBuilder<H2, W>
Sets the BuildHasher
to use.
Using this method you can select a specific hashed based on one or more seeds.
Sourcepub fn build<T>(self) -> Result<HyperLogLog<T, H, W>>
pub fn build<T>(self) -> Result<HyperLogLog<T, H, W>>
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.
§Errors
Errors will be caused by consistency checks (at least 16 registers per
estimator, backend bits divisible exactly W::BITS
)
Trait Implementations§
Source§impl<H: Clone, W: Clone> Clone for HyperLogLogBuilder<H, W>
impl<H: Clone, W: Clone> Clone for HyperLogLogBuilder<H, W>
Source§fn clone(&self) -> HyperLogLogBuilder<H, W>
fn clone(&self) -> HyperLogLogBuilder<H, W>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<H, W> Freeze for HyperLogLogBuilder<H, W>where
H: Freeze,
impl<H, W> RefUnwindSafe for HyperLogLogBuilder<H, W>where
H: RefUnwindSafe,
W: RefUnwindSafe,
impl<H, W> Send for HyperLogLogBuilder<H, W>
impl<H, W> Sync for HyperLogLogBuilder<H, W>
impl<H, W> Unpin for HyperLogLogBuilder<H, W>
impl<H, W> UnwindSafe for HyperLogLogBuilder<H, W>where
H: UnwindSafe,
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more