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)
[src]
fn increment_generation(&self)
[src]Increments the generation counter.
fn get_generation(&self) -> Generation
[src]
fn get_generation(&self) -> Generation
[src]Gets the current generation counter.
Provided methods
Implementors
impl<H> Generational<H> for NotTracked<H>
[src]
impl<H> Generational<H> for NotTracked<H>
[src]fn increment_generation(&self)
[src]
fn increment_generation(&self)
[src]Increments the generation counter.
fn get_generation(&self) -> Generation
[src]
fn get_generation(&self) -> Generation
[src]Gets the current generation counter.
impl<H> Generational<H> for Tracked<H>
[src]
impl<H> Generational<H> for Tracked<H>
[src]fn increment_generation(&self)
[src]
fn increment_generation(&self)
[src]Increments the generation counter.
fn get_generation(&self) -> Generation
[src]
fn get_generation(&self) -> Generation
[src]Gets the current generation counter.