[][src]Struct metrix::instruments::GaugeAdapter

pub struct GaugeAdapter<L> { /* fields omitted */ }

Methods

impl<L> GaugeAdapter<L> where
    L: Eq + Send + 'static, 
[src]

pub fn new(gauge: Gauge) -> Self[src]

Creates a new adapter which dispatches all observations to the Gauge

pub fn accept<F: Into<LabelFilter<L>>>(accept: F, gauge: Gauge) -> Self[src]

pub fn for_label(label: L, gauge: Gauge) -> Self[src]

Creates a new adapter which dispatches observations with the given label to the Gauge

pub fn for_labels(labels: Vec<L>, gauge: Gauge) -> Self[src]

Creates a new adapter which dispatches observations with the given labels to the Gauge

If labels is empty, no observations will be dispatched

pub fn for_labels_by_predicate<P>(label_predicate: P, gauge: Gauge) -> Self where
    P: Fn(&L) -> bool + Send + 'static, 
[src]

Creates a GaugeAdapter that makes this instrument react on observations with labels specified by the predicate.

pub fn deltas_only<F: Into<LabelFilter<L>>>(accept: F, gauge: Gauge) -> Self[src]

pub fn for_label_deltas_only(label: L, gauge: Gauge) -> Self[src]

Creates a new adapter which dispatches observations with the given label to the Gauge

The Gauge will only be dispatched message that increment or decrement the value

pub fn for_labels_deltas_only(labels: Vec<L>, gauge: Gauge) -> Self[src]

Creates a new adapter which dispatches observations with the given labels to the Gauge

If labels is empty, no observations will be dispatched

The Gauge will only be dispatched message that increment or decrement the value

pub fn for_labels_deltas_only_by_predicate<P>(
    label_predicate: P,
    gauge: Gauge
) -> Self where
    P: Fn(&L) -> bool + Send + 'static, 
[src]

Creates a GaugeAdapter that makes this instrument react on observations with labels specified by the predicate.

pub fn inc_dec_on<INCR: Into<LabelFilter<L>>, DECR: Into<LabelFilter<L>>>(
    accept_incr: INCR,
    accept_decr: DECR,
    gauge: Gauge
) -> Self
[src]

Creates a new adapter which dispatches observations with the given labels to the Gauge which only increment or decrement the Gauge

The Gauge will increment on any observation with label increment_on and decrement for any observation with label decrement_on.

increment_on is evaluated first so increment_on and decrement_on should not be the same label.

pub fn inc_dec_on_many(
    increment_on: Vec<L>,
    decrement_on: Vec<L>,
    gauge: Gauge
) -> Self
[src]

Creates a new adapter which dispatches observations with the given labels to the Gauge which only increment or decrement the Gauge

The Gauge will increment on any observation with a label in increment_on and decrement for any observation with a label in decrement_on.

increment_on is evaluated first so increment_on and decrement_on should share labels.

pub fn inc_dec_by_predicates<PINC, PDEC>(
    predicate_inc: PINC,
    predicate_dec: PDEC,
    gauge: Gauge
) -> Self where
    PINC: Fn(&L) -> bool + Send + 'static,
    PDEC: Fn(&L) -> bool + Send + 'static, 
[src]

Creates a GaugeAdapter that makes this instrument react on observations with labels specified by the predicate.

pub fn deaf(gauge: Gauge) -> Self[src]

Creates a new adapter which dispatches no observations to the Gauge

pub fn gauge(&self) -> &Gauge[src]

pub fn gauge_mut(&mut self) -> &mut Gauge[src]

pub fn into_inner(self) -> Gauge[src]

Trait Implementations

impl<L> From<Gauge> for GaugeAdapter<L> where
    L: Clone + Eq + Send + 'static, 
[src]

impl<L> HandlesObservations for GaugeAdapter<L> where
    L: Eq + Send + 'static, 
[src]

type Label = L

impl<L> PutsSnapshot for GaugeAdapter<L> where
    L: Send + 'static, 
[src]

Auto Trait Implementations

impl<L> !RefUnwindSafe for GaugeAdapter<L>

impl<L> Send for GaugeAdapter<L> where
    L: Send

impl<L> !Sync for GaugeAdapter<L>

impl<L> Unpin for GaugeAdapter<L> where
    L: Unpin

impl<L> !UnwindSafe for GaugeAdapter<L>

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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,