Struct prometheus::local::AFLocalCounter[][src]

pub struct AFLocalCounter<T: 'static + MayFlush, V: CounterWithValueType, D: CounterDelegator<T, V>> { /* fields omitted */ }

Auto flush-able local counter

Implementations

impl<T: 'static + MayFlush, V: CounterWithValueType, D: CounterDelegator<T, V>> AFLocalCounter<T, V, D>[src]

pub fn new(delegator: D) -> AFLocalCounter<T, V, D>[src]

Construct a new AFLocalCounter from delegator.

impl<T: 'static + MayFlush, V: CounterWithValueType, D: CounterDelegator<T, V>> AFLocalCounter<T, V, D>[src]

Auto flush-able local counter

pub fn inc_by(&self, v: <V::ValueType as Atomic>::T)[src]

Increase the given value to the local counter, and try to flush to global

Panics

Panics in debug build if the value is < 0.

pub fn inc(&self)[src]

Increase the local counter by 1, and try to flush to global.

pub fn get(&self) -> <V::ValueType as Atomic>::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]

trigger flush of LocalKey

Trait Implementations

impl<T: Debug + 'static + MayFlush, V: Debug + CounterWithValueType, D: Debug + CounterDelegator<T, V>> Debug for AFLocalCounter<T, V, D>[src]

Auto Trait Implementations

impl<T, V, D> !RefUnwindSafe for AFLocalCounter<T, V, D>

impl<T, V, D> Send for AFLocalCounter<T, V, D> where
    D: Send,
    T: Send,
    V: Send

impl<T, V, D> Sync for AFLocalCounter<T, V, D> where
    D: Sync,
    T: Send,
    V: Send

impl<T, V, D> Unpin for AFLocalCounter<T, V, D> where
    D: Unpin,
    T: Unpin,
    V: Unpin

impl<T, V, D> UnwindSafe for AFLocalCounter<T, V, D> where
    D: UnwindSafe,
    T: UnwindSafe,
    V: 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, 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.