Struct prometheus::local::AFLocalCounter [−][src]
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,
D: Send,
T: Send,
V: Send,
impl<T, V, D> Sync for AFLocalCounter<T, V, D> where
D: Sync,
T: Send,
V: Send,
D: Sync,
T: Send,
V: Send,
impl<T, V, D> Unpin for AFLocalCounter<T, V, D> where
D: Unpin,
T: Unpin,
V: Unpin,
D: Unpin,
T: Unpin,
V: Unpin,
impl<T, V, D> UnwindSafe for AFLocalCounter<T, V, D> where
D: UnwindSafe,
T: UnwindSafe,
V: UnwindSafe,
D: UnwindSafe,
T: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,