Struct cmsketch::CMSketchU8

source ·
pub struct CMSketchU8 { /* private fields */ }

Implementations§

source§

impl CMSketchU8

source

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

source

pub fn inc(&mut self, hash: u64)

source

pub fn inc_by(&mut self, hash: u64, count: u8)

source

pub fn dec(&mut self, hash: u64)

source

pub fn dec_by(&mut self, hash: u64, count: u8)

source

pub fn estimate(&self, hash: u64) -> u8

source

pub fn clear(&mut self)

source

pub fn halve(&mut self)

source

pub fn decay(&mut self, decay: f64)

source

pub fn width(&self) -> usize

source

pub fn depth(&self) -> usize

source

pub fn capacity(&self) -> u8

source

pub fn memory(&self) -> usize

Trait Implementations§

source§

impl Debug for CMSketchU8

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.