Struct prometheus_client::encoding::text::Encoder
source · pub struct Encoder<'a, 'b> { /* private fields */ }Expand description
Helper type for EncodeMetric, see EncodeMetric::encode.
Implementations§
source§impl<'a, 'b> Encoder<'a, 'b>
impl<'a, 'b> Encoder<'a, 'b>
sourcepub fn encode_suffix(
&mut self,
suffix: &'static str
) -> Result<BucketEncoder<'_>, Error>
pub fn encode_suffix(
&mut self,
suffix: &'static str
) -> Result<BucketEncoder<'_>, Error>
Encode a metric suffix, e.g. in the case of Counter the suffic _total.
sourcepub fn no_suffix(&mut self) -> Result<BucketEncoder<'_>, Error>
pub fn no_suffix(&mut self) -> Result<BucketEncoder<'_>, Error>
Signal that the metric has no suffix.
sourcepub fn with_label_set<'c, 'd>(
&'c mut self,
label_set: &'d dyn Encode
) -> Encoder<'c, 'd>
pub fn with_label_set<'c, 'd>(
&'c mut self,
label_set: &'d dyn Encode
) -> Encoder<'c, 'd>
Encode a set of labels. Used by wrapper metric types like Family.