Struct cmsketch::CMSketchU64
source · pub struct CMSketchU64 { /* private fields */ }
Implementations§
source§impl CMSketchU64
impl CMSketchU64
sourcepub fn new(eps: f64, confidence: f64) -> Self
pub fn new(eps: f64, confidence: f64) -> Self
2 / w = eps; w = 2 / eps 1 / 2^depth <= 1 - confidence; depth >= -log2(1 - confidence)
estimate confidence => depth:
0.5 => 1 0.6 => 2 0.7 => 2 0.8 => 3 0.9 => 4 0.95 => 5 0.995 => 8
pub fn inc(&mut self, hash: u64)
pub fn inc_by(&mut self, hash: u64, count: u64)
pub fn dec(&mut self, hash: u64)
pub fn dec_by(&mut self, hash: u64, count: u64)
pub fn estimate(&self, hash: u64) -> u64
pub fn clear(&mut self)
pub fn halve(&mut self)
pub fn decay(&mut self, decay: f64)
pub fn width(&self) -> usize
pub fn depth(&self) -> usize
pub fn capacity(&self) -> u64
pub fn memory(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CMSketchU64
impl RefUnwindSafe for CMSketchU64
impl Send for CMSketchU64
impl Sync for CMSketchU64
impl Unpin for CMSketchU64
impl UnwindSafe for CMSketchU64
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