pub trait PrometheusMetric:
Collector
+ Clone
+ Send
+ Sync
+ 'static {
// Required method
fn with_opts(opts: Opts) -> Result<Self, Error>
where Self: Sized;
// Provided methods
fn with_histogram_opts_and_buckets(
_opts: HistogramOpts,
_buckets: Option<Vec<f64>>,
) -> Result<Self, Error>
where Self: Sized { ... }
fn with_opts_and_label_names(
_opts: Opts,
_label_names: &[&str],
) -> Result<Self, Error>
where Self: Sized { ... }
}
Expand description
Trait that defines common behavior for Prometheus metric types
Required Methods§
Provided Methods§
Sourcefn with_histogram_opts_and_buckets(
_opts: HistogramOpts,
_buckets: Option<Vec<f64>>,
) -> Result<Self, Error>where
Self: Sized,
fn with_histogram_opts_and_buckets(
_opts: HistogramOpts,
_buckets: Option<Vec<f64>>,
) -> Result<Self, Error>where
Self: Sized,
Create a new metric with histogram options and custom buckets This is a default implementation that will panic for non-histogram metrics
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.