#[non_exhaustive]pub struct BucketOptions {
pub options: Option<Options>,
/* private fields */
}
Expand description
BucketOptions
describes the bucket boundaries used to create a histogram
for the distribution. The buckets can be in a linear sequence, an
exponential sequence, or each bucket can be specified explicitly.
BucketOptions
does not include the number of values in each bucket.
A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.options: Option<Options>
Exactly one of these three fields must be set.
Implementations§
Source§impl BucketOptions
impl BucketOptions
pub fn new() -> Self
Sourcepub fn set_options<T: Into<Option<Options>>>(self, v: T) -> Self
pub fn set_options<T: Into<Option<Options>>>(self, v: T) -> Self
Sets the value of options.
Note that all the setters affecting options
are mutually
exclusive.
Sourcepub fn linear_buckets(&self) -> Option<&Box<Linear>>
pub fn linear_buckets(&self) -> Option<&Box<Linear>>
The value of options
if it holds a LinearBuckets
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_linear_buckets<T: Into<Box<Linear>>>(self, v: T) -> Self
pub fn set_linear_buckets<T: Into<Box<Linear>>>(self, v: T) -> Self
Sets the value of options
to hold a LinearBuckets
.
Note that all the setters affecting options
are
mutually exclusive.
Sourcepub fn exponential_buckets(&self) -> Option<&Box<Exponential>>
pub fn exponential_buckets(&self) -> Option<&Box<Exponential>>
The value of options
if it holds a ExponentialBuckets
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_exponential_buckets<T: Into<Box<Exponential>>>(self, v: T) -> Self
pub fn set_exponential_buckets<T: Into<Box<Exponential>>>(self, v: T) -> Self
Sets the value of options
to hold a ExponentialBuckets
.
Note that all the setters affecting options
are
mutually exclusive.
Trait Implementations§
Source§impl Clone for BucketOptions
impl Clone for BucketOptions
Source§fn clone(&self) -> BucketOptions
fn clone(&self) -> BucketOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more