Encoder

Trait Encoder 

Source
pub trait Encoder {
    // Required methods
    fn encode(&self, _: &[MetricFamily], _: &mut dyn Write) -> Result<()>;
    fn format_type(&self) -> &str;
}

Required Methods§

Source

fn encode(&self, _: &[MetricFamily], _: &mut dyn Write) -> Result<()>

encode converts a slice of MetricFamily proto messages into target format and writes the resulting lines to writer. It returns the number of bytes written and any error encountered. This function does not perform checks on the content of the metric and label names, i.e. invalid metric or label names will result in invalid text format output.

Source

fn format_type(&self) -> &str

format_type returns target format.

Implementors§