Skip to main content

provenant/
lib.rs

1// SPDX-FileCopyrightText: Provenant contributors
2// SPDX-License-Identifier: Apache-2.0
3
4//! # Provenant
5//!
6//! `provenant` is the library crate behind the `provenant` CLI. It
7//! provides ScanCode-compatible scanning, package parsing, and output-writing
8//! building blocks for Rust applications.
9//!
10//! The main entry points are:
11//!
12//! - [`workflow::scan_path`] and [`workflow::scan_paths`] for the supported high-level embedding flow
13//! - [`collect_paths`] to discover files in a directory tree when you need lower-level control
14//! - [`process_collected`] to scan collected files in parallel when you are assembling the pipeline manually
15//! - [`OutputFormat`], [`OutputWriter`], and [`write_output_file`] to serialize scan results
16//! - [`parsers`] and [`models`] for lower-level package parsing and result inspection
17//!
18//! High-level crate organization:
19//!
20//! - [`scanner`] orchestrates traversal, filtering, and scan execution
21//! - [`license_detection`] extracts license information from files
22//! - [`parsers`] extracts package metadata from ecosystem-specific inputs
23//! - [`copyright`] and [`finder`] extract text clues such as copyrights, emails, and URLs
24//! - [`output`] renders ScanCode-compatible and SBOM-oriented output formats
25//! - [`models`] defines the core scan result data structures
26//!
27//! User-facing installation, CLI usage, supported format coverage, and broader
28//! architecture notes live in the repository documentation. The crate-level
29//! rustdoc stays intentionally concise so fast-changing project details have a
30//! single source of truth outside this file.
31
32extern crate self as provenance;
33
34pub(crate) mod app;
35pub mod assembly;
36pub mod cache;
37pub mod cli;
38pub(crate) mod compare;
39pub mod copyright;
40pub mod finder;
41pub mod golden_maintenance;
42pub mod license_detection;
43pub mod models;
44pub mod output;
45pub mod output_schema;
46pub mod parsers;
47#[cfg(feature = "golden-tests")]
48pub mod post_processing;
49#[cfg(not(feature = "golden-tests"))]
50pub(crate) mod post_processing;
51pub mod progress;
52pub(crate) mod scan_result_shaping;
53pub mod scanner;
54pub(crate) mod serve;
55#[doc(hidden)]
56pub mod serve_api;
57#[cfg(test)]
58pub(crate) mod test_support;
59pub(crate) mod time;
60pub mod utils;
61pub mod version;
62pub mod workflow;
63
64pub use cli::ProcessMode;
65pub use models::{ExtraData, FileInfo, FileType, Header, Output, SystemEnvironment};
66pub use output::{
67    OutputFormat, OutputWriteConfig, OutputWriter, write_output_file, writer_for_format,
68};
69pub use parsers::{NpmParser, PackageParser};
70pub use progress::{ProgressMode, ScanProgress};
71pub use scanner::{
72    CollectedPaths, ProcessResult, TextDetectionOptions, collect_paths, process_collected,
73};