Skip to main content

unsafe_budget/
lib.rs

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