Struct prometheus_client::encoding::MetricEncoder
source · pub struct MetricEncoder<'a, 'b>(_);
Expand description
Encoder for a metric.
Implementations§
source§impl<'a, 'b> MetricEncoder<'a, 'b>
impl<'a, 'b> MetricEncoder<'a, 'b>
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<'c, 'd, S: EncodeLabelSet>(
&'c mut self,
label_set: &'d S
) -> Result<MetricEncoder<'c, 'd>, Error>
pub fn encode_family<'c, 'd, S: EncodeLabelSet>( &'c mut self, label_set: &'d S ) -> Result<MetricEncoder<'c, 'd>, Error>
Encode a metric family.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'b> !RefUnwindSafe for MetricEncoder<'a, 'b>
impl<'a, 'b> !Send for MetricEncoder<'a, 'b>
impl<'a, 'b> !Sync for MetricEncoder<'a, 'b>
impl<'a, 'b> Unpin for MetricEncoder<'a, 'b>
impl<'a, 'b> !UnwindSafe for MetricEncoder<'a, 'b>
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