Struct prometheus_client::encoding::MetricEncoder
source · pub struct MetricEncoder<'a>(/* private fields */);
Expand description
Encoder for a metric.
Implementations§
source§impl MetricEncoder<'_>
impl MetricEncoder<'_>
sourcepub fn encode_counter<S: EncodeLabelSet, CounterValue: EncodeCounterValue, ExemplarValue: EncodeExemplarValue>(
&mut self,
v: &CounterValue,
exemplar: Option<&Exemplar<S, ExemplarValue>>
) -> Result<(), Error>
pub fn encode_counter<S: EncodeLabelSet, CounterValue: EncodeCounterValue, ExemplarValue: EncodeExemplarValue>( &mut self, v: &CounterValue, exemplar: Option<&Exemplar<S, ExemplarValue>> ) -> Result<(), Error>
Encode a counter.
sourcepub fn encode_gauge<GaugeValue: EncodeGaugeValue>(
&mut self,
v: &GaugeValue
) -> Result<(), Error>
pub fn encode_gauge<GaugeValue: EncodeGaugeValue>( &mut self, v: &GaugeValue ) -> Result<(), Error>
Encode a gauge.
sourcepub fn encode_info(
&mut self,
label_set: &impl EncodeLabelSet
) -> Result<(), Error>
pub fn encode_info( &mut self, label_set: &impl EncodeLabelSet ) -> Result<(), Error>
Encode an info.
sourcepub fn encode_histogram<S: EncodeLabelSet>(
&mut self,
sum: f64,
count: u64,
buckets: &[(f64, u64)],
exemplars: Option<&HashMap<usize, Exemplar<S, f64>>>
) -> Result<(), Error>
pub fn encode_histogram<S: EncodeLabelSet>( &mut self, sum: f64, count: u64, buckets: &[(f64, u64)], exemplars: Option<&HashMap<usize, Exemplar<S, f64>>> ) -> Result<(), Error>
Encode a histogram.
sourcepub fn encode_family<'s, S: EncodeLabelSet>(
&'s mut self,
label_set: &'s S
) -> Result<MetricEncoder<'s>, Error>
pub fn encode_family<'s, S: EncodeLabelSet>( &'s mut self, label_set: &'s S ) -> Result<MetricEncoder<'s>, Error>
Encode a metric family.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MetricEncoder<'a>
impl<'a> !Send for MetricEncoder<'a>
impl<'a> !Sync for MetricEncoder<'a>
impl<'a> Unpin for MetricEncoder<'a>
impl<'a> !UnwindSafe for MetricEncoder<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more