evobench_tools/resolution_unit.rs
1//! Trait to attach a physical unit to a type
2
3/// Attach a physical unit (or "count" or similar) to a type.
4pub trait ResolutionUnit: Into<u64> {
5 /// The physical unit for 1 increment of the resolution of the
6 /// type (i.e. the unit for the result of the conversion into u64)
7 const RESOLUTION_UNIT_SHORT: &str;
8}
9
10impl ResolutionUnit for u64 {
11 const RESOLUTION_UNIT_SHORT: &str = "occurrences";
12}