Trait metrics_util::Generational [−][src]
pub trait Generational<H>: From<H> {
fn increment_generation(&self);
fn get_generation(&self) -> Generation;
fn get_inner(&self) -> &H;
fn initial(inner: H) -> Self { ... }
}
Expand description
A trait that defines generational semantics for wrapper types.
Used to provide compile-time generation tracking where the choice is encoded in which type is
used (i.e. Tracked
vs NotTracked
), which necessitates a trait to mediate usage.
Required methods
fn increment_generation(&self)
fn increment_generation(&self)
Increments the generation counter.
fn get_generation(&self) -> Generation
fn get_generation(&self) -> Generation
Gets the current generation counter.