1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! # unsafe-budget
//!
//! an unsafe code budget gate for ci pipelines.
//!
//! this library provides the core functionality for tracking unsafe code usage
//! in rust and go projects, comparing against baselines, and enforcing budgets.
//!
//! ## quick example
//!
//! ```no_run
//! use unsafe_budget::analyzer::detect_analyzer;
//! use unsafe_budget::model::ScanOpts;
//!
//! let opts = ScanOpts::default();
//! let analyzer = detect_analyzer(&opts).unwrap();
//! let result = analyzer.run(&opts).unwrap();
//!
//! println!("total unsafe: {}", result.totals.overall_unsafe);
//! for unit in &result.units {
//! println!(" {}: {}", unit.name, unit.unsafe_count);
//! }
//! ```
//!
//! ## modules
//!
//! - [`analyzer`] - analyzer trait and built-in implementations
//! - [`budget`] - budget comparison engine (ratchet and caps modes)
//! - [`config`] - configuration and baseline file handling
//! - [`model`] - core data types (ScanResult, Unit, etc.)
//! - [`output`] - text and json formatters