bob/
lib.rs

1/*
2 * Copyright (c) 2025 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;
26
27// Internal modules - exposed for binary use but not primary API
28mod init;
29pub mod logging;
30mod tui;
31
32use std::sync::Arc;
33use std::sync::atomic::AtomicBool;
34
35/// Shared context for a build or scan run.
36pub struct RunContext {
37    /// Flag to signal graceful shutdown.
38    pub shutdown: Arc<AtomicBool>,
39}
40
41impl RunContext {
42    pub fn new(shutdown: Arc<AtomicBool>) -> Self {
43        Self { shutdown }
44    }
45}
46
47// Re-export main types for convenience
48pub use action::{Action, ActionType, FSType};
49pub use build::{Build, BuildOptions, BuildOutcome, BuildResult, BuildSummary};
50pub use config::{Config, Options, Pkgsrc, Sandboxes};
51pub use db::Database;
52pub use report::write_html_report;
53pub use sandbox::Sandbox;
54pub use scan::{
55    ResolvedIndex, Scan, ScanFailure, ScanResult, SkipReason, SkippedPackage,
56};
57
58// Re-export init for CLI use
59pub use init::Init;