Struct opentelemetry::metrics::InstrumentBuilder
source · pub struct InstrumentBuilder<'a, T> { /* private fields */ }
Expand description
Configuration for building a sync instrument.
Implementations§
source§impl<'a, T> InstrumentBuilder<'a, T>where
T: TryFrom<Self, Error = MetricsError>,
impl<'a, T> InstrumentBuilder<'a, T>where
T: TryFrom<Self, Error = MetricsError>,
sourcepub fn with_description<S: Into<Cow<'static, str>>>(
self,
description: S,
) -> Self
pub fn with_description<S: Into<Cow<'static, str>>>( self, description: S, ) -> Self
Set the description for this instrument
sourcepub fn with_unit<S: Into<Cow<'static, str>>>(self, unit: S) -> Self
pub fn with_unit<S: Into<Cow<'static, str>>>(self, unit: S) -> Self
Set the unit for this instrument.
Unit is case sensitive(kb
is not the same as kB
).
Unit must be:
- ASCII string
- No longer than 63 characters
Trait Implementations§
source§impl<T> Debug for InstrumentBuilder<'_, T>
impl<T> Debug for InstrumentBuilder<'_, T>
source§impl TryFrom<InstrumentBuilder<'_, UpDownCounter<f64>>> for UpDownCounter<f64>
impl TryFrom<InstrumentBuilder<'_, UpDownCounter<f64>>> for UpDownCounter<f64>
§type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
source§fn try_from(
builder: InstrumentBuilder<'_, UpDownCounter<f64>>,
) -> Result<Self, Self::Error>
fn try_from( builder: InstrumentBuilder<'_, UpDownCounter<f64>>, ) -> Result<Self, Self::Error>
Performs the conversion.
source§impl TryFrom<InstrumentBuilder<'_, UpDownCounter<i64>>> for UpDownCounter<i64>
impl TryFrom<InstrumentBuilder<'_, UpDownCounter<i64>>> for UpDownCounter<i64>
§type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
source§fn try_from(
builder: InstrumentBuilder<'_, UpDownCounter<i64>>,
) -> Result<Self, Self::Error>
fn try_from( builder: InstrumentBuilder<'_, UpDownCounter<i64>>, ) -> Result<Self, Self::Error>
Performs the conversion.
Auto Trait Implementations§
impl<'a, T> Freeze for InstrumentBuilder<'a, T>
impl<'a, T> !RefUnwindSafe for InstrumentBuilder<'a, T>
impl<'a, T> !Send for InstrumentBuilder<'a, T>
impl<'a, T> !Sync for InstrumentBuilder<'a, T>
impl<'a, T> Unpin for InstrumentBuilder<'a, T>where
T: Unpin,
impl<'a, T> !UnwindSafe for InstrumentBuilder<'a, T>
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