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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so 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.