pub struct InstrumentBuilder<'a, T> { /* private fields */ }Available on crate feature
metrics only.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(self, unit: Unit) -> Self
pub fn with_unit(self, unit: Unit) -> 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>
Source§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>
Source§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>where
T: Send,
impl<'a, T> Sync for InstrumentBuilder<'a, T>where
T: Sync,
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
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> ⓘ
Available on crate feature
trace only.Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Available on crate feature
trace only.