usenum_traits::Num;/// A trait for common methods required by all counters.
pubtraitCounter<T: Num> {/// Returns the current value of the counter.
fncounter(&self)->&T;/// Resets the counter to its initial values.
fnreset(&mutself);/// Updates the counter with a new value.
fnupdate(&mutself, n: T);}