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]

Increments the generation counter.

fn get_generation(&self) -> Generation[src]

Gets the current generation counter.

fn get_inner(&self) -> &H[src]

Gets a reference to the inner type.

Provided methods

fn initial(inner: H) -> Self[src]

Creates a default initialized wrapper around inner.

Implementors

impl<H> Generational<H> for NotTracked<H>[src]

fn increment_generation(&self)[src]

Increments the generation counter.

fn get_generation(&self) -> Generation[src]

Gets the current generation counter.

fn get_inner(&self) -> &H[src]

Gets a reference to the inner type.

impl<H> Generational<H> for Tracked<H>[src]

fn increment_generation(&self)[src]

Increments the generation counter.

fn get_generation(&self) -> Generation[src]

Gets the current generation counter.

fn get_inner(&self) -> &H[src]

Gets a reference to the inner type.