Adds a diagnostic to the collection. # Examples ``` use hashql_diagnostics::{Diagnostic, DiagnosticIssues, Label, Severity}; # use hashql_diagnostics::category::TerminalDiagnosticCategory; # const CATEGORY: TerminalDiagnosticCategory = TerminalDiagnosticCategory { # id: "example", name: "Example" # }; let mut issues = DiagnosticIssues::new(); issues .push(Diagnostic::new(CATEGORY, Severity:
(&mut self, diagnostic: Diagnostic<C, S, K>)
| 540 | /// assert_eq!(issues.critical(), 1); |
| 541 | /// ``` |
| 542 | pub fn push(&mut self, diagnostic: Diagnostic<C, S, K>) { |
| 543 | self.critical += usize::from(diagnostic.severity.is_critical()); |
| 544 | self.diagnostics.push(diagnostic); |
| 545 | } |
| 546 | |
| 547 | /// Removes and returns the last diagnostic. |
| 548 | /// |