[][src]Macro global_counter::global_default_counter

macro_rules! global_default_counter {
    ($name:ident, $type:ty) => { ... };
}

Creates a new generic, global counter, starting from its default value.

This macro will fail compilation if the given type is not Default.

Example

type CountedType = u32;
fn main(){
    global_default_counter!(COUNTER_NAME, CountedType);
    assert_eq!(COUNTER_NAME.get_cloned(), 0);
    COUNTER_NAME.inc();
    assert_eq!(COUNTER_NAME.get_cloned(), 1);
}