Trait kumo_prometheus::AtomicCounterEntry

source ·
pub trait AtomicCounterEntry: Send + Sync {
    // Required methods
    fn resolve(&self) -> Option<AtomicCounter>;
    fn make_storable(strong: &AtomicCounter) -> Self;
    fn needs_pruning() -> bool;
}
Expand description

This trait enables having prunable and non-pruning value types in the CounterRegistry.

Required Methods§

source

fn resolve(&self) -> Option<AtomicCounter>

resolve this entry to an AtomicCounter instance

source

fn make_storable(strong: &AtomicCounter) -> Self

Given a new strong AtomicCounter reference, return Self suitable for storing in the counter registry

source

fn needs_pruning() -> bool

Indicate whether this type of value requires pruning the containing counter registry

Object Safety§

This trait is not object safe.

Implementors§

source§

impl AtomicCounterEntry for AtomicCounter

AtomicCounter is a direct store of the underlying counter value. No pruning is required for this type of value.

source§

impl AtomicCounterEntry for WeakAtomicCounter

WeakAtomicCounter stores values as weak references and thus requires pruning.