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§
sourcefn resolve(&self) -> Option<AtomicCounter>
fn resolve(&self) -> Option<AtomicCounter>
resolve this entry to an AtomicCounter instance
sourcefn make_storable(strong: &AtomicCounter) -> Self
fn make_storable(strong: &AtomicCounter) -> Self
Given a new strong AtomicCounter reference, return Self suitable for storing in the counter registry
sourcefn needs_pruning() -> bool
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§
impl AtomicCounterEntry for AtomicCounter
AtomicCounter is a direct store of the underlying counter value. No pruning is required for this type of value.
impl AtomicCounterEntry for WeakAtomicCounter
WeakAtomicCounter stores values as weak references and thus requires pruning.