Expand description
A struct that bundles the options for creating a Histogram
metric. It is
mandatory to set Name and Help to a non-empty string. All other fields are
optional and can safely be left at their zero value.
Fields
common_opts: Opts
A container holding various options.
buckets: Vec<f64, Global>
Defines the buckets into which observations are counted. Each element in the slice is the upper inclusive bound of a bucket. The values must be sorted in strictly increasing order. There is no need to add a highest bucket with +Inf bound, it will be added implicitly. The default value is DefBuckets.
Implementations
sourceimpl HistogramOpts
impl HistogramOpts
sourcepub fn new<S1, S2>(name: S1, help: S2) -> HistogramOpts where
S1: Into<String>,
S2: Into<String>,
pub fn new<S1, S2>(name: S1, help: S2) -> HistogramOpts where
S1: Into<String>,
S2: Into<String>,
Create a HistogramOpts
with the name
and help
arguments.
sourcepub fn namespace<S>(self, namespace: S) -> HistogramOpts where
S: Into<String>,
pub fn namespace<S>(self, namespace: S) -> HistogramOpts where
S: Into<String>,
namespace
sets the namespace.
sourcepub fn subsystem<S>(self, subsystem: S) -> HistogramOpts where
S: Into<String>,
pub fn subsystem<S>(self, subsystem: S) -> HistogramOpts where
S: Into<String>,
subsystem
sets the sub system.
sourcepub fn const_labels(
self,
const_labels: HashMap<String, String, RandomState>
) -> HistogramOpts
pub fn const_labels(
self,
const_labels: HashMap<String, String, RandomState>
) -> HistogramOpts
const_labels
sets the const labels.
sourcepub fn const_label<S1, S2>(self, name: S1, value: S2) -> HistogramOpts where
S1: Into<String>,
S2: Into<String>,
pub fn const_label<S1, S2>(self, name: S1, value: S2) -> HistogramOpts where
S1: Into<String>,
S2: Into<String>,
const_label
adds a const label.
sourcepub fn variable_labels(
self,
variable_labels: Vec<String, Global>
) -> HistogramOpts
pub fn variable_labels(
self,
variable_labels: Vec<String, Global>
) -> HistogramOpts
variable_labels
sets the variable labels.
sourcepub fn variable_label<S>(self, name: S) -> HistogramOpts where
S: Into<String>,
pub fn variable_label<S>(self, name: S) -> HistogramOpts where
S: Into<String>,
variable_label
adds a variable label.
Trait Implementations
sourceimpl Clone for HistogramOpts
impl Clone for HistogramOpts
sourcepub fn clone(&self) -> HistogramOpts
pub fn clone(&self) -> HistogramOpts
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for HistogramOpts
impl Debug for HistogramOpts
sourceimpl Describer for HistogramOpts
impl Describer for HistogramOpts
sourceimpl From<Opts> for HistogramOpts
impl From<Opts> for HistogramOpts
sourcepub fn from(opts: Opts) -> HistogramOpts
pub fn from(opts: Opts) -> HistogramOpts
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for HistogramOpts
impl Send for HistogramOpts
impl Sync for HistogramOpts
impl Unpin for HistogramOpts
impl UnwindSafe for HistogramOpts
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more