Struct opentelemetry::metrics::ObservableCounter
source · pub struct ObservableCounter<T>(/* private fields */);
Available on crate feature
metrics
only.Expand description
An async instrument that records increasing values.
Implementations§
source§impl<T> ObservableCounter<T>
impl<T> ObservableCounter<T>
sourcepub fn new(inner: Arc<dyn AsyncInstrument<T>>) -> Self
pub fn new(inner: Arc<dyn AsyncInstrument<T>>) -> Self
Create a new observable counter.
source§impl<T> ObservableCounter<T>
impl<T> ObservableCounter<T>
Trait Implementations§
source§impl<T> AsyncInstrument<T> for ObservableCounter<T>
impl<T> AsyncInstrument<T> for ObservableCounter<T>
source§impl<T: Clone> Clone for ObservableCounter<T>
impl<T: Clone> Clone for ObservableCounter<T>
source§fn clone(&self) -> ObservableCounter<T>
fn clone(&self) -> ObservableCounter<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T> Debug for ObservableCounter<T>
impl<T> Debug for ObservableCounter<T>
source§impl TryFrom<AsyncInstrumentBuilder<'_, ObservableCounter<f64>, f64>> for ObservableCounter<f64>
impl TryFrom<AsyncInstrumentBuilder<'_, ObservableCounter<f64>, f64>> for ObservableCounter<f64>
§type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
source§fn try_from(
builder: AsyncInstrumentBuilder<'_, ObservableCounter<f64>, f64>,
) -> Result<Self, Self::Error>
fn try_from( builder: AsyncInstrumentBuilder<'_, ObservableCounter<f64>, f64>, ) -> Result<Self, Self::Error>
Performs the conversion.
source§impl TryFrom<AsyncInstrumentBuilder<'_, ObservableCounter<u64>, u64>> for ObservableCounter<u64>
impl TryFrom<AsyncInstrumentBuilder<'_, ObservableCounter<u64>, u64>> for ObservableCounter<u64>
§type Error = MetricsError
type Error = MetricsError
The type returned in the event of a conversion error.
source§fn try_from(
builder: AsyncInstrumentBuilder<'_, ObservableCounter<u64>, u64>,
) -> Result<Self, Self::Error>
fn try_from( builder: AsyncInstrumentBuilder<'_, ObservableCounter<u64>, u64>, ) -> Result<Self, Self::Error>
Performs the conversion.
Auto Trait Implementations§
impl<T> Freeze for ObservableCounter<T>
impl<T> !RefUnwindSafe for ObservableCounter<T>
impl<T> Send for ObservableCounter<T>
impl<T> Sync for ObservableCounter<T>
impl<T> Unpin for ObservableCounter<T>
impl<T> !UnwindSafe for ObservableCounter<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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.