Struct prometheus::core::GenericLocalCounter[][src]

pub struct GenericLocalCounter<P: Atomic> { /* fields omitted */ }

The underlying implementation for LocalCounter and LocalIntCounter.

Implementations

impl<P: Atomic> GenericLocalCounter<P>[src]

pub fn inc_by(&self, v: P::T)[src]

Increase the given value to the local counter.

Panics

Panics in debug build if the value is < 0.

pub fn inc(&self)[src]

Increase the local counter by 1.

pub fn get(&self) -> P::T[src]

Return the local counter value.

pub fn reset(&self)[src]

Restart the counter, resetting its value back to 0.

pub fn flush(&self)[src]

Flush the local metrics to the Counter.

Trait Implementations

impl<P: Atomic> Clone for GenericLocalCounter<P>[src]

impl<P: Atomic> CounterWithValueType for GenericLocalCounter<P>[src]

type ValueType = P

the exact type which implements Atomic

impl<P: Debug + Atomic> Debug for GenericLocalCounter<P> where
    P::T: Debug
[src]

impl<P: Atomic> LocalMetric for GenericLocalCounter<P>[src]

fn flush(&self)[src]

Flush the local metrics to the Counter.

Auto Trait Implementations

impl<P> !RefUnwindSafe for GenericLocalCounter<P>

impl<P> Send for GenericLocalCounter<P>

impl<P> !Sync for GenericLocalCounter<P>

impl<P> Unpin for GenericLocalCounter<P> where
    <P as Atomic>::T: Unpin

impl<P> UnwindSafe for GenericLocalCounter<P> where
    P: RefUnwindSafe,
    <P as Atomic>::T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.