#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum Messtyp {
Slp,
Rlm,
IMsys,
}
impl Messtyp {
pub const ALL: [Self; 3] = [Self::Slp, Self::Rlm, Self::IMsys];
#[must_use]
pub const fn as_str(self) -> &'static str {
match self {
Self::Slp => "SLP",
Self::Rlm => "RLM",
Self::IMsys => "I_MSYS",
}
}
#[must_use]
pub fn supports_spitzenleistung(&self) -> bool {
matches!(self, Messtyp::Rlm | Messtyp::IMsys)
}
#[must_use]
pub fn supports_dynamic_tariff(&self) -> bool {
matches!(self, Messtyp::IMsys)
}
}
crate::ids::codes::string_codes! {
Messtyp;
}