[−][src]Struct amadeus_streaming::HyperLogLog
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
impl<V: ?Sized> HyperLogLog<V> where
V: Hash,
[src]
V: Hash,
pub fn new(error_rate: f64) -> Self
[src]
Create an empty HyperLogLog
data structure with the specified error tolerance.
pub fn new_from(hll: &Self) -> Self
[src]
Create an empty HyperLogLog
data structure, copying the error tolerance from hll
.
pub fn push(&mut self, value: &V)
[src]
"Visit" an element.
pub fn len(&self) -> f64
[src]
Retrieve an estimate of the carginality of the stream.
pub fn is_empty(&self) -> bool
[src]
Returns true if empty.
pub fn union(&mut self, src: &Self)
[src]
Merge another HyperLogLog data structure into self
.
This is the same as an HLL approximating cardinality of the union of two multisets.
pub fn intersect(&mut self, src: &Self)
[src]
Intersect another HyperLogLog data structure into self
.
Note: This is different to an HLL approximating cardinality of the intersection of two multisets.
pub fn clear(&mut self)
[src]
Clears the HyperLogLog
data structure, as if it was new.
Trait Implementations
impl<'a, V: ?Sized> AddAssign<&'a HyperLogLog<V>> for HyperLogLog<V> where
V: Hash,
[src]
V: Hash,
fn add_assign(&mut self, rhs: &'a Self)
[src]
impl<'a, V: ?Sized> AddAssign<&'a V> for HyperLogLog<V> where
V: Hash,
[src]
V: Hash,
fn add_assign(&mut self, rhs: &'a V)
[src]
impl<V: ?Sized> Clone for HyperLogLog<V>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<V: ?Sized> Debug for HyperLogLog<V> where
V: Hash,
[src]
V: Hash,
impl<'de, V: ?Sized> Deserialize<'de> for HyperLogLog<V>
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<V: ?Sized> Intersect for HyperLogLog<V> where
V: Hash,
[src]
V: Hash,
fn intersect<'a>(iter: impl Iterator<Item = &'a Self>) -> Option<Self> where
Self: Sized + 'a,
[src]
Self: Sized + 'a,
impl<V: ?Sized> IntersectPlusUnionIsPlus for HyperLogLog<V>
[src]
impl<V: ?Sized> New for HyperLogLog<V> where
V: Hash,
[src]
V: Hash,
type Config = f64
The type of data required to instantiate a new Self
.
fn new(config: &Self::Config) -> Self
[src]
impl<V: ?Sized> Serialize for HyperLogLog<V>
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'a, V: ?Sized> UnionAssign<&'a HyperLogLog<V>> for HyperLogLog<V> where
V: Hash,
[src]
V: Hash,
fn union_assign(&mut self, rhs: &'a Self)
[src]
Auto Trait Implementations
impl<V: ?Sized> RefUnwindSafe for HyperLogLog<V>
impl<V: ?Sized> Send for HyperLogLog<V>
impl<V: ?Sized> Sync for HyperLogLog<V>
impl<V: ?Sized> Unpin for HyperLogLog<V>
impl<V: ?Sized> UnwindSafe for HyperLogLog<V>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,