Struct opentelemetry::metrics::InstrumentBuilder
source · [−]pub struct InstrumentBuilder<'a, T> { /* private fields */ }
metrics
only.Expand description
Configuration for building an instrument.
Implementations
sourceimpl<'a, T> InstrumentBuilder<'a, T>where
T: TryFrom<InstrumentBuilder<'a, T>, Error = MetricsError>,
impl<'a, T> InstrumentBuilder<'a, T>where
T: TryFrom<InstrumentBuilder<'a, T>, Error = MetricsError>,
sourcepub fn with_description<S>(self, description: S) -> InstrumentBuilder<'a, T>where
S: Into<String>,
pub fn with_description<S>(self, description: S) -> InstrumentBuilder<'a, T>where
S: Into<String>,
Set the description for this counter
sourcepub fn with_unit(self, unit: Unit) -> InstrumentBuilder<'a, T>
pub fn with_unit(self, unit: Unit) -> InstrumentBuilder<'a, T>
Set the unit for this counter.
sourcepub fn try_init(self) -> Result<T, MetricsError>
pub fn try_init(self) -> Result<T, MetricsError>
Creates a new counter instrument.
Trait Implementations
sourceimpl<T> Debug for InstrumentBuilder<'_, T>
impl<T> Debug for InstrumentBuilder<'_, T>
sourceimpl TryFrom<InstrumentBuilder<'_, ObservableCounter<f64>>> for ObservableCounter<f64>
impl TryFrom<InstrumentBuilder<'_, ObservableCounter<f64>>> for ObservableCounter<f64>
type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
sourcefn try_from(
builder: InstrumentBuilder<'_, ObservableCounter<f64>>
) -> Result<ObservableCounter<f64>, <ObservableCounter<f64> as TryFrom<InstrumentBuilder<'_, ObservableCounter<f64>>>>::Error>
fn try_from(
builder: InstrumentBuilder<'_, ObservableCounter<f64>>
) -> Result<ObservableCounter<f64>, <ObservableCounter<f64> as TryFrom<InstrumentBuilder<'_, ObservableCounter<f64>>>>::Error>
Performs the conversion.
sourceimpl TryFrom<InstrumentBuilder<'_, ObservableCounter<u64>>> for ObservableCounter<u64>
impl TryFrom<InstrumentBuilder<'_, ObservableCounter<u64>>> for ObservableCounter<u64>
type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
sourcefn try_from(
builder: InstrumentBuilder<'_, ObservableCounter<u64>>
) -> Result<ObservableCounter<u64>, <ObservableCounter<u64> as TryFrom<InstrumentBuilder<'_, ObservableCounter<u64>>>>::Error>
fn try_from(
builder: InstrumentBuilder<'_, ObservableCounter<u64>>
) -> Result<ObservableCounter<u64>, <ObservableCounter<u64> as TryFrom<InstrumentBuilder<'_, ObservableCounter<u64>>>>::Error>
Performs the conversion.
sourceimpl TryFrom<InstrumentBuilder<'_, ObservableGauge<f64>>> for ObservableGauge<f64>
impl TryFrom<InstrumentBuilder<'_, ObservableGauge<f64>>> for ObservableGauge<f64>
type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
sourcefn try_from(
builder: InstrumentBuilder<'_, ObservableGauge<f64>>
) -> Result<ObservableGauge<f64>, <ObservableGauge<f64> as TryFrom<InstrumentBuilder<'_, ObservableGauge<f64>>>>::Error>
fn try_from(
builder: InstrumentBuilder<'_, ObservableGauge<f64>>
) -> Result<ObservableGauge<f64>, <ObservableGauge<f64> as TryFrom<InstrumentBuilder<'_, ObservableGauge<f64>>>>::Error>
Performs the conversion.
sourceimpl TryFrom<InstrumentBuilder<'_, ObservableGauge<i64>>> for ObservableGauge<i64>
impl TryFrom<InstrumentBuilder<'_, ObservableGauge<i64>>> for ObservableGauge<i64>
type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
sourcefn try_from(
builder: InstrumentBuilder<'_, ObservableGauge<i64>>
) -> Result<ObservableGauge<i64>, <ObservableGauge<i64> as TryFrom<InstrumentBuilder<'_, ObservableGauge<i64>>>>::Error>
fn try_from(
builder: InstrumentBuilder<'_, ObservableGauge<i64>>
) -> Result<ObservableGauge<i64>, <ObservableGauge<i64> as TryFrom<InstrumentBuilder<'_, ObservableGauge<i64>>>>::Error>
Performs the conversion.
sourceimpl TryFrom<InstrumentBuilder<'_, ObservableGauge<u64>>> for ObservableGauge<u64>
impl TryFrom<InstrumentBuilder<'_, ObservableGauge<u64>>> for ObservableGauge<u64>
type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
sourcefn try_from(
builder: InstrumentBuilder<'_, ObservableGauge<u64>>
) -> Result<ObservableGauge<u64>, <ObservableGauge<u64> as TryFrom<InstrumentBuilder<'_, ObservableGauge<u64>>>>::Error>
fn try_from(
builder: InstrumentBuilder<'_, ObservableGauge<u64>>
) -> Result<ObservableGauge<u64>, <ObservableGauge<u64> as TryFrom<InstrumentBuilder<'_, ObservableGauge<u64>>>>::Error>
Performs the conversion.
sourceimpl TryFrom<InstrumentBuilder<'_, ObservableUpDownCounter<f64>>> for ObservableUpDownCounter<f64>
impl TryFrom<InstrumentBuilder<'_, ObservableUpDownCounter<f64>>> for ObservableUpDownCounter<f64>
type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
sourcefn try_from(
builder: InstrumentBuilder<'_, ObservableUpDownCounter<f64>>
) -> Result<ObservableUpDownCounter<f64>, <ObservableUpDownCounter<f64> as TryFrom<InstrumentBuilder<'_, ObservableUpDownCounter<f64>>>>::Error>
fn try_from(
builder: InstrumentBuilder<'_, ObservableUpDownCounter<f64>>
) -> Result<ObservableUpDownCounter<f64>, <ObservableUpDownCounter<f64> as TryFrom<InstrumentBuilder<'_, ObservableUpDownCounter<f64>>>>::Error>
Performs the conversion.
sourceimpl TryFrom<InstrumentBuilder<'_, ObservableUpDownCounter<i64>>> for ObservableUpDownCounter<i64>
impl TryFrom<InstrumentBuilder<'_, ObservableUpDownCounter<i64>>> for ObservableUpDownCounter<i64>
type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
sourcefn try_from(
builder: InstrumentBuilder<'_, ObservableUpDownCounter<i64>>
) -> Result<ObservableUpDownCounter<i64>, <ObservableUpDownCounter<i64> as TryFrom<InstrumentBuilder<'_, ObservableUpDownCounter<i64>>>>::Error>
fn try_from(
builder: InstrumentBuilder<'_, ObservableUpDownCounter<i64>>
) -> Result<ObservableUpDownCounter<i64>, <ObservableUpDownCounter<i64> as TryFrom<InstrumentBuilder<'_, ObservableUpDownCounter<i64>>>>::Error>
Performs the conversion.
sourceimpl 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.
sourcefn try_from(
builder: InstrumentBuilder<'_, UpDownCounter<f64>>
) -> Result<UpDownCounter<f64>, <UpDownCounter<f64> as TryFrom<InstrumentBuilder<'_, UpDownCounter<f64>>>>::Error>
fn try_from(
builder: InstrumentBuilder<'_, UpDownCounter<f64>>
) -> Result<UpDownCounter<f64>, <UpDownCounter<f64> as TryFrom<InstrumentBuilder<'_, UpDownCounter<f64>>>>::Error>
Performs the conversion.
sourceimpl 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.
sourcefn try_from(
builder: InstrumentBuilder<'_, UpDownCounter<i64>>
) -> Result<UpDownCounter<i64>, <UpDownCounter<i64> as TryFrom<InstrumentBuilder<'_, UpDownCounter<i64>>>>::Error>
fn try_from(
builder: InstrumentBuilder<'_, UpDownCounter<i64>>
) -> Result<UpDownCounter<i64>, <UpDownCounter<i64> as TryFrom<InstrumentBuilder<'_, UpDownCounter<i64>>>>::Error>
Performs the conversion.
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more