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>
 
impl MetricsSource for Arc<Registry>
Implementors§
impl MetricsSource for Decoder
impl MetricsSource for GlobalRegistry
Available on crate feature 
static_core only.