Skip to main content

entrenar/quality/supply_chain/
audit_status.rs

1//! Audit status for dependencies.
2
3use serde::{Deserialize, Serialize};
4
5/// Audit status for a dependency
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
7pub enum AuditStatus {
8    /// No issues found
9    Clean,
10    /// Warnings present (license issues, yanked versions)
11    Warning,
12    /// Vulnerabilities found
13    Vulnerable,
14}
15
16impl AuditStatus {
17    /// Returns true if the status indicates a failure condition
18    pub fn is_failure(&self) -> bool {
19        matches!(self, Self::Vulnerable)
20    }
21
22    /// Returns true if the status indicates any issues
23    pub fn has_issues(&self) -> bool {
24        !matches!(self, Self::Clean)
25    }
26}