sea_core/
validation_result.rs1use crate::policy::{Severity, Violation};
2
3#[derive(Debug, Clone)]
7pub struct ValidationResult {
8 pub total_policies: usize,
10
11 pub violations: Vec<Violation>,
13
14 pub error_count: usize,
16}
17
18impl ValidationResult {
19 pub fn new(total: usize, violations: Vec<Violation>) -> Self {
20 let error_count = violations
21 .iter()
22 .filter(|v| v.severity == Severity::Error)
23 .count();
24 Self {
25 total_policies: total,
26 violations,
27 error_count,
28 }
29 }
30}