pub trait MetricsSource: Send + 'static {
// Required method
fn encode_openmetrics(&self, writer: &mut impl Write) -> Result<(), Error>;
// Provided method
fn encode_openmetrics_to_string(&self) -> Result<String, Error> { ... }
}
Expand description
Helper trait to abstract over different ways to access metrics.
Required Methods§
Provided Methods§
Sourcefn encode_openmetrics_to_string(&self) -> Result<String, Error>
fn encode_openmetrics_to_string(&self) -> Result<String, Error>
Encodes the metrics in the OpenMetrics text format into a newly allocated string.
See also Self::encode_openmetrics
.
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.
Implementations on Foreign Types§
Source§impl MetricsSource for Arc<Registry>
Available on crate feature service
only.
impl MetricsSource for Arc<Registry>
Available on crate feature
service
only.Implementors§
impl MetricsSource for GlobalRegistry
Available on crate feature
static_core
only.impl MetricsSource for Registry
impl MetricsSource for RwLockRegistry
Available on crate feature
service
only.