capability_skeleton_validation/
skeleton_validation_report.rs

1// ---------------- [ File: capability-skeleton-validation/src/skeleton_validation_report.rs ]
2crate::ix!();
3
4/// The overall validation result, containing zero or more `DeviationFlag`s.
5#[derive(Debug, Clone, PartialEq)] // <--- Removed Eq because we have f32 fields
6pub struct SkeletonValidationReport {
7    flags: Vec<DeviationFlag>,
8}
9
10impl SkeletonValidationReport {
11    pub fn new() -> Self {
12        Self { flags: vec![] }
13    }
14
15    /// Returns true if no deviation flags => skeleton fully matches config.
16    pub fn is_clean(&self) -> bool {
17        self.flags.is_empty()
18    }
19
20    /// Add a new flag.
21    pub fn push(&mut self, flag: DeviationFlag) {
22        self.flags.push(flag);
23    }
24
25    /// Convenience to append multiple flags at once.
26    pub fn append(&mut self, other: &mut Vec<DeviationFlag>) {
27        self.flags.append(other);
28    }
29
30    /// Access flags.
31    pub fn flags(&self) -> &[DeviationFlag] {
32        &self.flags
33    }
34}