pub struct HyperLogLog<V: ?Sized> { /* private fields */ }
Expand description
An implementation of the HyperLogLog data structure with bias correction.
See HyperLogLog: the analysis of a near-optimal cardinality estimation algorithm and HyperLogLog in Practice: Algorithmic Engineering of a State of The Art Cardinality Estimation Algorithm for background on HyperLogLog with bias correction.
Implementations§
Source§impl<V> HyperLogLog<V>
impl<V> HyperLogLog<V>
Sourcepub fn new(error_rate: f64) -> Self
pub fn new(error_rate: f64) -> Self
Create an empty HyperLogLog
data structure with the specified error tolerance.
Sourcepub fn new_from(hll: &Self) -> Self
pub fn new_from(hll: &Self) -> Self
Create an empty HyperLogLog
data structure, copying the error tolerance from hll
.
Sourcepub fn union(&mut self, src: &Self)
pub fn union(&mut self, src: &Self)
Merge another HyperLogLog data structure into self
.
This is the same as an HLL approximating cardinality of the union of two multisets.
Trait Implementations§
Source§impl<'a, V> AddAssign<&'a HyperLogLog<V>> for HyperLogLog<V>
impl<'a, V> AddAssign<&'a HyperLogLog<V>> for HyperLogLog<V>
Source§fn add_assign(&mut self, rhs: &'a Self)
fn add_assign(&mut self, rhs: &'a Self)
Performs the
+=
operation. Read moreSource§impl<'a, V> AddAssign<&'a V> for HyperLogLog<V>
impl<'a, V> AddAssign<&'a V> for HyperLogLog<V>
Source§fn add_assign(&mut self, rhs: &'a V)
fn add_assign(&mut self, rhs: &'a V)
Performs the
+=
operation. Read moreSource§impl<V: ?Sized> Clone for HyperLogLog<V>
impl<V: ?Sized> Clone for HyperLogLog<V>
Source§impl<V> Debug for HyperLogLog<V>
impl<V> Debug for HyperLogLog<V>
Source§impl<'de, V: ?Sized> Deserialize<'de> for HyperLogLog<V>
impl<'de, V: ?Sized> Deserialize<'de> for HyperLogLog<V>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<V> Intersect for HyperLogLog<V>
impl<V> Intersect for HyperLogLog<V>
Source§impl<V: ?Sized> IntersectPlusUnionIsPlus for HyperLogLog<V>
impl<V: ?Sized> IntersectPlusUnionIsPlus for HyperLogLog<V>
Source§impl<V> New for HyperLogLog<V>
impl<V> New for HyperLogLog<V>
Source§impl<V: ?Sized> Serialize for HyperLogLog<V>
impl<V: ?Sized> Serialize for HyperLogLog<V>
Source§impl<'a, V> UnionAssign<&'a HyperLogLog<V>> for HyperLogLog<V>
impl<'a, V> UnionAssign<&'a HyperLogLog<V>> for HyperLogLog<V>
Source§fn union_assign(&mut self, rhs: &'a Self)
fn union_assign(&mut self, rhs: &'a Self)
Union.
Auto Trait Implementations§
impl<V> Freeze for HyperLogLog<V>where
V: ?Sized,
impl<V> RefUnwindSafe for HyperLogLog<V>where
V: ?Sized,
impl<V> Send for HyperLogLog<V>where
V: ?Sized,
impl<V> Sync for HyperLogLog<V>where
V: ?Sized,
impl<V> Unpin for HyperLogLog<V>where
V: ?Sized,
impl<V> UnwindSafe for HyperLogLog<V>where
V: ?Sized,
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
Mutably borrows from an owned value. Read more