Trait hdrhistogram::Counter

source ·
pub trait Counter: Num + ToPrimitive + FromPrimitive + Saturating + CheckedSub + CheckedAdd + Copy + PartialOrd<Self> + Debug {
    // Required methods
    fn as_f64(&self) -> f64;
    fn as_u64(&self) -> u64;
}
Expand description

This trait represents the operations a histogram must be able to perform on the underlying counter type. The ToPrimitive trait is needed to perform floating point operations on the counts (usually for quantiles). The FromPrimitive to convert back into an integer count. Partial ordering is used for threshholding, also usually in the context of quantiles.

Required Methods§

source

fn as_f64(&self) -> f64

Counter as a f64.

source

fn as_u64(&self) -> u64

Counter as a u64.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Counter for u8

source§

fn as_f64(&self) -> f64

source§

fn as_u64(&self) -> u64

source§

impl Counter for u16

source§

fn as_f64(&self) -> f64

source§

fn as_u64(&self) -> u64

source§

impl Counter for u32

source§

fn as_f64(&self) -> f64

source§

fn as_u64(&self) -> u64

source§

impl Counter for u64

source§

fn as_f64(&self) -> f64

source§

fn as_u64(&self) -> u64

Implementors§