use crate::{PlannedSerialEvent, SerialRole};
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum SerialReading {
StructuralPlan,
DeclaredRoles,
AllSounding,
}
impl SerialReading {
pub const fn as_str(self) -> &'static str {
match self {
Self::StructuralPlan => "structural-plan",
Self::DeclaredRoles => "declared-roles",
Self::AllSounding => "all-sounding",
}
}
pub(crate) const fn includes_event(self, event: &PlannedSerialEvent) -> bool {
match self {
Self::StructuralPlan => matches!(event.role, SerialRole::Structural),
Self::DeclaredRoles | Self::AllSounding => true,
}
}
}