Struct cmsketch::CMSketchU32
source · pub struct CMSketchU32 { /* private fields */ }
Implementations§
source§impl CMSketchU32
impl CMSketchU32
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: u32)
pub fn dec(&mut self, hash: u64)
pub fn dec_by(&mut self, hash: u64, count: u32)
pub fn estimate(&self, hash: u64) -> u32
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) -> u32
pub fn memory(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for CMSketchU32
impl Send for CMSketchU32
impl Sync for CMSketchU32
impl Unpin for CMSketchU32
impl UnwindSafe for CMSketchU32
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