Trait cadence::CountedExt

source ·
pub trait CountedExt: Counted<i64> {
    // Provided methods
    fn incr(&self, key: &str) -> MetricResult<Counter> { ... }
    fn incr_with_tags<'a>(
        &'a self,
        key: &'a str
    ) -> MetricBuilder<'_, '_, Counter> { ... }
    fn decr(&self, key: &str) -> MetricResult<Counter> { ... }
    fn decr_with_tags<'a>(
        &'a self,
        key: &'a str
    ) -> MetricBuilder<'_, '_, Counter> { ... }
}
Expand description

Trait for convenience methods for counters

This trait specifically implements increment and decrement convenience methods for counters with i64 types.

Provided Methods§

source

fn incr(&self, key: &str) -> MetricResult<Counter>

Increment the counter by 1

source

fn incr_with_tags<'a>(&'a self, key: &'a str) -> MetricBuilder<'_, '_, Counter>

Increment the counter by 1 and return a MetricBuilder that can be used to add tags to the metric.

source

fn decr(&self, key: &str) -> MetricResult<Counter>

Decrement the counter by 1

source

fn decr_with_tags<'a>(&'a self, key: &'a str) -> MetricBuilder<'_, '_, Counter>

Decrement the counter by 1 and return a MetricBuilder that can be used to add tags to the metric.

Implementors§