pub trait Encoder {
// Required methods
fn encode<W: Write>(
&self,
mfs: &[MetricFamily],
writer: &mut W,
) -> Result<()>;
fn format_type(&self) -> &str;
}Expand description
An interface for encoding metric families into an underlying wire protocol.
Required Methods§
Sourcefn encode<W: Write>(&self, mfs: &[MetricFamily], writer: &mut W) -> Result<()>
fn encode<W: Write>(&self, mfs: &[MetricFamily], writer: &mut W) -> Result<()>
encode converts a slice of MetricFamily proto messages into target
format and writes the resulting lines to writer. This function does not
perform checks on the content of the metrics and label names,
i.e. invalid metrics or label names will result in invalid text format
output.
Sourcefn format_type(&self) -> &str
fn format_type(&self) -> &str
format_type returns target format.
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.