Trait HyperLogLog

Source
pub trait HyperLogLog<H: Hash + ?Sized> {
    // Required methods
    fn add(&mut self, value: &H);
    fn insert<Q>(&mut self, value: &Q)
       where H: Borrow<Q>,
             Q: Hash + ?Sized;
    fn count(&mut self) -> f64;
}
Expand description

A trait that should be implemented by any HyperLogLog variant.

Required Methods§

Source

fn add(&mut self, value: &H)

👎Deprecated since 0.3.0: use insert() function instead.

Adds a new value to the multiset.

Source

fn insert<Q>(&mut self, value: &Q)
where H: Borrow<Q>, Q: Hash + ?Sized,

Inserts a new value to the multiset.

Source

fn count(&mut self) -> f64

Estimates the cardinality of the multiset.

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§

Source§

impl<H, B> HyperLogLog<H> for HyperLogLogPF<H, B>
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<H, B> HyperLogLog<H> for HyperLogLogPlus<H, B>
where H: Hash + ?Sized, B: BuildHasher,