pub struct CMSketchAtomicU8 { /* private fields */ }Expand description
Count-Min Sketch that stores u8 counters using atomics for concurrent updates.
Each bucket is backed by AtomicU8, allowing lock-free increments and decrements.
Implementations§
Source§impl CMSketchAtomicU8
impl CMSketchAtomicU8
Sourcepub fn new(eps: f64, confidence: f64) -> Self
pub fn new(eps: f64, confidence: f64) -> Self
Creates a new atomic sketch sized by error eps and confidence.
See CMSketchU32::new for the mapping between
confidence and depth.
§Panics
Panics if eps <= 0.0 or confidence <= 0.0.
Sourcepub fn inc_by(&self, hash: u64, count: u8)
pub fn inc_by(&self, hash: u64, count: u8)
Atomically increments the count associated with hash by count.
Saturates at the maximum value representable by the counter type and leaves the bucket unchanged if the update would overflow.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CMSketchAtomicU8
impl RefUnwindSafe for CMSketchAtomicU8
impl Send for CMSketchAtomicU8
impl Sync for CMSketchAtomicU8
impl Unpin for CMSketchAtomicU8
impl UnwindSafe for CMSketchAtomicU8
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