Skip to content

Commit

Permalink
fix doc for encode
Browse files Browse the repository at this point in the history
Signed-off-by: Han Xu <keepsimple@gmail.com>
  • Loading branch information
keepsimple1 committed Jan 25, 2022
1 parent ac86a26 commit cb5c901
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/encoder/mod.rs
Expand Up @@ -16,12 +16,11 @@ use crate::proto::MetricFamily;
/// An interface for encoding metric families into an underlying wire protocol.
pub trait Encoder {
/// `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
/// 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.
fn encode<W: Write>(&self, _: &[MetricFamily], _: &mut W) -> Result<()>;
fn encode<W: Write>(&self, mfs: &[MetricFamily], writer: &mut W) -> Result<()>;

/// `format_type` returns target format.
fn format_type(&self) -> &str;
Expand Down

0 comments on commit cb5c901

Please sign in to comment.