#[non_exhaustive]pub struct ExponentialBuckets {
pub num_finite_buckets: i32,
pub growth_factor: f64,
pub scale: f64,
/* private fields */
}Expand description
Describing buckets with exponentially growing width.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.num_finite_buckets: i32The number of finite buckets. With the underflow and overflow buckets,
the total number of buckets is num_finite_buckets + 2.
See comments on bucket_options for details.
growth_factor: f64The i’th exponential bucket covers the interval [scale * growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to num_finite_buckets inclusive. Must be larger than 1.0.
scale: f64The i’th exponential bucket covers the interval [scale * growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to num_finite_buckets inclusive. Must be > 0.
Implementations§
Source§impl ExponentialBuckets
impl ExponentialBuckets
pub fn new() -> Self
Sourcepub fn set_num_finite_buckets<T: Into<i32>>(self, v: T) -> Self
pub fn set_num_finite_buckets<T: Into<i32>>(self, v: T) -> Self
Sets the value of num_finite_buckets.
§Example
ⓘ
let x = ExponentialBuckets::new().set_num_finite_buckets(42);Sourcepub fn set_growth_factor<T: Into<f64>>(self, v: T) -> Self
pub fn set_growth_factor<T: Into<f64>>(self, v: T) -> Self
Sets the value of growth_factor.
§Example
ⓘ
let x = ExponentialBuckets::new().set_growth_factor(42.0);Trait Implementations§
Source§impl Clone for ExponentialBuckets
impl Clone for ExponentialBuckets
Source§fn clone(&self) -> ExponentialBuckets
fn clone(&self) -> ExponentialBuckets
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExponentialBuckets
impl Debug for ExponentialBuckets
Source§impl Default for ExponentialBuckets
impl Default for ExponentialBuckets
Source§fn default() -> ExponentialBuckets
fn default() -> ExponentialBuckets
Returns the “default value” for a type. Read more
Source§impl Message for ExponentialBuckets
impl Message for ExponentialBuckets
Source§impl PartialEq for ExponentialBuckets
impl PartialEq for ExponentialBuckets
impl StructuralPartialEq for ExponentialBuckets
Auto Trait Implementations§
impl Freeze for ExponentialBuckets
impl RefUnwindSafe for ExponentialBuckets
impl Send for ExponentialBuckets
impl Sync for ExponentialBuckets
impl Unpin for ExponentialBuckets
impl UnwindSafe for ExponentialBuckets
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