Skip to main content

HyperLogLog8Builder

Struct HyperLogLog8Builder 

Source
pub struct HyperLogLog8Builder<H, const BETA: bool = true> { /* private fields */ }
Expand description

Builder for HyperLogLog8 cardinality-estimation logic.

The builder lets you configure:

Call build to obtain the configured HyperLogLog8 logic.

Implementations§

Source§

impl HyperLogLog8Builder<BuildHasherDefault<DefaultHasher>>

Source

pub const fn new() -> Self

Creates a new builder for a HyperLogLog8 logic.

Source§

impl<H, const BETA: bool> HyperLogLog8Builder<H, BETA>

Source

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).

Source

pub const fn log2_num_regs(self, log2_num_regs: u32) -> Self

Sets the base-2 logarithm of the number of registers.

This is a low-level alternative to Self::rsd. Calling one after the other invalidates the work done by the first one.

§Arguments
  • log2_num_regs: the logarithm of the number of registers per estimator.
§Panics

If log2_num_regs is less than 4.

Source

pub fn beta<const BETA2: bool>(self) -> HyperLogLog8Builder<H, BETA2>

Enables or disables the LogLog-β bias correction in the estimate.

See HyperLogLog8 for details.

Source

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.

Source

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>

Source§

fn clone(&self) -> HyperLogLog8Builder<H, BETA>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<H: Debug, const BETA: bool> Debug for HyperLogLog8Builder<H, BETA>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HyperLogLog8Builder<BuildHasherDefault<DefaultHasher>>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<H, const BETA: bool> Freeze for HyperLogLog8Builder<H, BETA>
where H: Freeze,

§

impl<H, const BETA: bool> RefUnwindSafe for HyperLogLog8Builder<H, BETA>
where H: RefUnwindSafe,

§

impl<H, const BETA: bool> Send for HyperLogLog8Builder<H, BETA>
where H: Send,

§

impl<H, const BETA: bool> Sync for HyperLogLog8Builder<H, BETA>
where H: Sync,

§

impl<H, const BETA: bool> Unpin for HyperLogLog8Builder<H, BETA>
where H: Unpin,

§

impl<H, const BETA: bool> UnsafeUnpin for HyperLogLog8Builder<H, BETA>
where H: UnsafeUnpin,

§

impl<H, const BETA: bool> UnwindSafe for HyperLogLog8Builder<H, BETA>
where H: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.