pub struct CountMinSketch<K: ?Sized, C: New> { /* private fields */ }Expand description
An implementation of a count-min sketch data structure with conservative updating for increased accuracy.
This data structure is also known as a counting Bloom filter.
See An Improved Data Stream Summary: The Count-Min Sketch and its Applications and New Directions in Traffic Measurement and Accounting for background on the count-min sketch with conservative updating.
Implementations§
Source§impl<K, C> CountMinSketch<K, C>
impl<K, C> CountMinSketch<K, C>
Sourcepub fn new(probability: f64, tolerance: f64, config: C::Config) -> Self
pub fn new(probability: f64, tolerance: f64, config: C::Config) -> Self
Create an empty CountMinSketch data structure with the specified error tolerance.
Sourcepub fn union_assign<Q>(&mut self, key: &Q, value: &C)
pub fn union_assign<Q>(&mut self, key: &Q, value: &C)
Union the aggregated value for key with value.
Trait Implementations§
Source§impl<'de, K: ?Sized, C> Deserialize<'de> for CountMinSketch<K, C>
impl<'de, K: ?Sized, C> Deserialize<'de> for CountMinSketch<K, C>
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
Auto Trait Implementations§
impl<K, C> Freeze for CountMinSketch<K, C>
impl<K, C> RefUnwindSafe for CountMinSketch<K, C>
impl<K, C> Send for CountMinSketch<K, C>
impl<K, C> Sync for CountMinSketch<K, C>
impl<K, C> Unpin for CountMinSketch<K, C>
impl<K, C> UnwindSafe for CountMinSketch<K, C>
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