bob/
lib.rs

1/*
2 * Copyright (c) 2026 Jonathan Perkin <jonathan@perkin.org.uk>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#![cfg_attr(not(doctest), doc = include_str!("../README.md"))]
18
19pub mod action;
20pub mod build;
21pub mod config;
22pub mod db;
23pub mod report;
24pub mod sandbox;
25pub mod scan;
26pub mod summary;
27
28// Internal modules - exposed for binary use but not primary API
29mod init;
30pub mod logging;
31mod tui;
32
33use std::sync::Arc;
34use std::sync::atomic::AtomicBool;
35
36/// Shared context for a build or scan run.
37pub struct RunContext {
38    /// Flag to signal graceful shutdown.
39    pub shutdown: Arc<AtomicBool>,
40}
41
42impl RunContext {
43    pub fn new(shutdown: Arc<AtomicBool>) -> Self {
44        Self { shutdown }
45    }
46}
47
48// Re-export main types for convenience
49pub use action::{Action, ActionType, FSType};
50pub use build::{
51    Build, BuildCounts, BuildOptions, BuildOutcome, BuildResult, BuildSummary,
52};
53pub use config::{Config, Options, Pkgsrc, PkgsrcEnv, Sandboxes};
54pub use db::Database;
55pub use report::write_html_report;
56pub use sandbox::Sandbox;
57pub use scan::{
58    ResolvedPackage, Scan, ScanResult, ScanSummary, SkipReason, SkippedCounts,
59};
60pub use summary::generate_pkg_summary;
61
62// Re-export init for CLI use
63pub use init::Init;