pub struct UpDownCounter<T>(/* private fields */);Expand description
An instrument that records increasing or decreasing values.
Implementations§
source§impl<T> UpDownCounter<T>
impl<T> UpDownCounter<T>
sourcepub fn new(
inner: Arc<dyn SyncUpDownCounter<T> + Sync + Send>,
) -> UpDownCounter<T>
pub fn new( inner: Arc<dyn SyncUpDownCounter<T> + Sync + Send>, ) -> UpDownCounter<T>
Create a new up down counter.
Trait Implementations§
source§impl<T> Clone for UpDownCounter<T>where
T: Clone,
impl<T> Clone for UpDownCounter<T>where
T: Clone,
source§fn clone(&self) -> UpDownCounter<T>
fn clone(&self) -> UpDownCounter<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 UpDownCounter<T>where
T: Debug,
impl<T> Debug for UpDownCounter<T>where
T: Debug,
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<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.
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<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<T> Freeze for UpDownCounter<T>
impl<T> !RefUnwindSafe for UpDownCounter<T>
impl<T> Send for UpDownCounter<T>
impl<T> Sync for UpDownCounter<T>
impl<T> Unpin for UpDownCounter<T>
impl<T> !UnwindSafe for UpDownCounter<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>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request