Skip to main content

sim_lib_music_serial/
report.rs

1//! Practice reports over named serial readings.
2
3use crate::{InvariantLedger, PracticeId, PracticeRuleId, SerialReading};
4
5/// Reproducible serial-practice report for one named reading.
6#[derive(Clone, Debug, PartialEq, Eq)]
7pub struct SerialPracticeReport {
8    /// Practice identity.
9    pub practice_id: PracticeId,
10    /// Reading that produced this report.
11    pub reading: SerialReading,
12    /// Invariant ledger for the reading.
13    pub ledger: InvariantLedger<PracticeRuleId>,
14}
15
16impl SerialPracticeReport {
17    /// Returns whether any invariant remains violated after considering waivers.
18    pub fn has_unwaived_violations(&self) -> bool {
19        self.ledger
20            .entries()
21            .iter()
22            .any(|entry| matches!(entry.status, crate::InvariantStatus::Violated))
23    }
24}