#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Unit {
Events,
Cycles,
Bytes,
Ratio,
Rate,
Percent,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Kind {
Accumulated,
Gauge,
Rate,
}
#[derive(Clone, Copy, Debug)]
pub struct Meta {
pub desc: &'static str,
pub unit: Unit,
pub kind: Kind,
}
impl Meta {
#[must_use]
pub const fn events(desc: &'static str) -> Self {
Self { desc, unit: Unit::Events, kind: Kind::Accumulated }
}
#[must_use]
pub const fn cycles(desc: &'static str) -> Self {
Self { desc, unit: Unit::Cycles, kind: Kind::Accumulated }
}
#[must_use]
pub const fn ratio(desc: &'static str) -> Self {
Self { desc, unit: Unit::Ratio, kind: Kind::Rate }
}
#[must_use]
pub const fn percent(desc: &'static str) -> Self {
Self { desc, unit: Unit::Percent, kind: Kind::Rate }
}
}