pub struct Config { /* private fields */ }
Expand description
A configuration struct for building custom Histogram
s.
Implementations§
Source§impl Config
impl Config
Sourcepub fn precision(self, precision: u32) -> Self
pub fn precision(self, precision: u32) -> Self
set HistogramConfig precision
§Example
let mut c = Histogram::configure();
c.precision(4); // set to 4 significant figures
Sourcepub fn max_memory(self, bytes: u32) -> Self
pub fn max_memory(self, bytes: u32) -> Self
set HistogramConfig memory limit
§Example
let mut c = Histogram::configure();
c.max_memory(1024*1024); // cap Histogram at 1MB of data
Sourcepub fn max_value(self, max: u64) -> Self
pub fn max_value(self, max: u64) -> Self
set HistogramConfig value limit
§Example
let mut c = Histogram::configure();
c.max_value(1000); // values above 1000 will not be stored
Sourcepub fn build(self) -> Option<Histogram>
pub fn build(self) -> Option<Histogram>
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§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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