Struct histogram::Config[][src]

pub struct Config { /* fields omitted */ }

A configuration struct for building custom Histograms.

Implementations

impl Config[src]

pub fn new() -> Config[src]

create a new Histogram Config with defaults

Example

let mut c = Histogram::configure();

pub fn precision(self, precision: u32) -> Self[src]

set HistogramConfig precision

Example

let mut c = Histogram::configure();
c.precision(4); // set to 4 significant figures

pub fn max_memory(self, bytes: u32) -> Self[src]

set HistogramConfig memory limit

Example

let mut c = Histogram::configure();
c.max_memory(1024*1024); // cap Histogram at 1MB of data

pub fn max_value(self, max: u64) -> Self[src]

set HistogramConfig value limit

Example

let mut c = Histogram::configure();
c.max_value(1000); // values above 1000 will not be stored

pub fn build(self) -> Option<Histogram>[src]

Build a new histogram based on the current configuration values. Return None if the new histogram would require more than the configured memory size.

Trait Implementations

impl Clone for Config[src]

impl Copy for Config[src]

impl Default for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.