pub struct MetricEncoder<'a>(/* private fields */);Expand description
Encoder for a metric.
Implementations§
Source§impl MetricEncoder<'_>
impl MetricEncoder<'_>
Sourcepub fn encode_counter<S, CounterValue, ExemplarValue>(
&mut self,
v: &CounterValue,
exemplar: Option<&Exemplar<S, ExemplarValue>>,
) -> Result<(), Error>
pub fn encode_counter<S, CounterValue, ExemplarValue>( &mut self, v: &CounterValue, exemplar: Option<&Exemplar<S, ExemplarValue>>, ) -> Result<(), Error>
Encode a counter.
Sourcepub fn encode_gauge<GaugeValue>(&mut self, v: &GaugeValue) -> Result<(), Error>where
GaugeValue: EncodeGaugeValue,
pub fn encode_gauge<GaugeValue>(&mut self, v: &GaugeValue) -> Result<(), Error>where
GaugeValue: EncodeGaugeValue,
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>(
&mut self,
sum: f64,
count: u64,
buckets: &[(f64, u64)],
exemplars: Option<&HashMap<usize, Exemplar<S, f64>>>,
) -> Result<(), Error>where
S: EncodeLabelSet,
pub fn encode_histogram<S>(
&mut self,
sum: f64,
count: u64,
buckets: &[(f64, u64)],
exemplars: Option<&HashMap<usize, Exemplar<S, f64>>>,
) -> Result<(), Error>where
S: EncodeLabelSet,
Encode a histogram.
Sourcepub fn encode_family<'s, S>(
&'s mut self,
label_set: &'s S,
) -> Result<MetricEncoder<'s>, Error>where
S: EncodeLabelSet,
pub fn encode_family<'s, S>(
&'s mut self,
label_set: &'s S,
) -> Result<MetricEncoder<'s>, Error>where
S: EncodeLabelSet,
Encode a metric family.
Trait Implementations§
Source§impl<'a> Debug for MetricEncoder<'a>
impl<'a> Debug for MetricEncoder<'a>
Source§impl<'a> From<MetricEncoder<'a>> for MetricEncoder<'a>
impl<'a> From<MetricEncoder<'a>> for MetricEncoder<'a>
Source§fn from(e: MetricEncoder<'a>) -> MetricEncoder<'a>
fn from(e: MetricEncoder<'a>) -> MetricEncoder<'a>
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for MetricEncoder<'a>
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> UnsafeUnpin 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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more