pub struct Counter<T>(/* private fields */);
Available on crate feature
metrics
only.Expand description
A metric that accumulates values.
Implementations§
Source§impl<T> Counter<T>
impl<T> Counter<T>
Sourcepub fn bind(&self, attributes: &[KeyValue]) -> BoundCounter<T>
pub fn bind(&self, attributes: &[KeyValue]) -> BoundCounter<T>
Creates a bound instrument for this counter. The attributes are associated with values recorded via subsequent calls to record.
Sourcepub fn measurement(&self, value: T) -> Measurement
pub fn measurement(&self, value: T) -> Measurement
Creates a Measurement for use with batch recording.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Counter<T>
impl<T> !RefUnwindSafe for Counter<T>
impl<T> Send for Counter<T>where
T: Send,
impl<T> Sync for Counter<T>where
T: Sync,
impl<T> Unpin for Counter<T>where
T: Unpin,
impl<T> !UnwindSafe for Counter<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§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.