Trait Compat

Source
pub trait Compat {
    // Required methods
    fn time_duration_with_tags<'a>(
        &'a self,
        key: &'a str,
        val: Duration,
    ) -> MetricBuilder<'_, '_, Timer>;
    fn gauge_f64_with_tags<'a>(
        &'a self,
        key: &'a str,
        val: f64,
    ) -> MetricBuilder<'_, '_, Gauge>;
    fn mark_with_tags<'a>(
        &'a self,
        key: &'a str,
    ) -> MetricBuilder<'_, '_, Meter>;
    fn histogram_duration_with_tags<'a>(
        &'a self,
        key: &'a str,
        val: Duration,
    ) -> MetricBuilder<'_, '_, Histogram>;

    // Provided methods
    fn time_duration(&self, key: &str, val: Duration) -> MetricResult<Timer> { ... }
    fn gauge_f64(&self, key: &str, val: f64) -> MetricResult<Gauge> { ... }
    fn mark(&self, key: &str) -> MetricResult<Meter> { ... }
    fn histogram_duration(
        &self,
        key: &str,
        val: Duration,
    ) -> MetricResult<Histogram> { ... }
}
Expand description

Backwards compatibility shim for removed and deprecated methods.

To allow people time to migrate, the removed methods are implemented here. These methods should be considered deprecated and not viable to use long-term (this trait will be removed in a future release).

For more information about how to migrate away from the methods in this trait, see the MIGRATION.md file in the root of the repository.

Required Methodsยง

Source

fn time_duration_with_tags<'a>( &'a self, key: &'a str, val: Duration, ) -> MetricBuilder<'_, '_, Timer>

๐Ÿ‘ŽDeprecated: Use client.time_with_tags(key, val)
Source

fn gauge_f64_with_tags<'a>( &'a self, key: &'a str, val: f64, ) -> MetricBuilder<'_, '_, Gauge>

๐Ÿ‘ŽDeprecated: Use client.gauge_with_tags(key, val)
Source

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

๐Ÿ‘ŽDeprecated: Use client.meter_with_tags(key, 1)
Source

fn histogram_duration_with_tags<'a>( &'a self, key: &'a str, val: Duration, ) -> MetricBuilder<'_, '_, Histogram>

๐Ÿ‘ŽDeprecated: Use client.histogram_with_tags(key, val)

Provided Methodsยง

Source

fn time_duration(&self, key: &str, val: Duration) -> MetricResult<Timer>

๐Ÿ‘ŽDeprecated: Use client.time(key, val)
Source

fn gauge_f64(&self, key: &str, val: f64) -> MetricResult<Gauge>

๐Ÿ‘ŽDeprecated: Use client.gauge(key, val)
Source

fn mark(&self, key: &str) -> MetricResult<Meter>

๐Ÿ‘ŽDeprecated: Use client.meter(key, 1)
Source

fn histogram_duration( &self, key: &str, val: Duration, ) -> MetricResult<Histogram>

๐Ÿ‘ŽDeprecated: Use client.histogram(key, val)

Implementorsยง