Struct slog_extlog::stats::Buckets
source · pub struct Buckets {
pub method: BucketMethod,
pub label_name: &'static str,
/* private fields */
}
Expand description
A set of numerical buckets together with a method for sorting values into them.
Fields§
§method: BucketMethod
The method to use to sort values into buckets.
label_name: &'static str
Label name describing what the buckets measure.
Implementations§
source§impl Buckets
impl Buckets
sourcepub fn new(
method: BucketMethod,
label_name: &'static str,
limits: &[i64]
) -> Buckets
pub fn new( method: BucketMethod, label_name: &'static str, limits: &[i64] ) -> Buckets
Create a new Buckets instance.
sourcepub fn assign_buckets(&self, value: f64) -> Vec<usize>
pub fn assign_buckets(&self, value: f64) -> Vec<usize>
return a vector containing the indices of the buckets that should be updated
sourcepub fn get(&self, index: usize) -> Option<BucketLimit>
pub fn get(&self, index: usize) -> Option<BucketLimit>
Get the bound of an individual bucket by index.
Trait Implementations§
source§impl PartialEq for Buckets
impl PartialEq for Buckets
impl StructuralPartialEq for Buckets
Auto Trait Implementations§
impl RefUnwindSafe for Buckets
impl Send for Buckets
impl Sync for Buckets
impl Unpin for Buckets
impl UnwindSafe for Buckets
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