mod consult;
mod error;
mod inventory;
pub mod manifest;
mod mark;
mod metadata;
mod report;
mod stats;
#[cfg(test)]
mod test_support;
#[cfg(test)]
#[path = "stats_tests.rs"]
mod stats_tests;
#[cfg(test)]
#[path = "refusal_tests.rs"]
mod refusal_tests;
#[cfg(test)]
#[path = "metadata_tests.rs"]
mod metadata_tests;
#[cfg(test)]
#[path = "codec_corpus_tests.rs"]
mod codec_corpus_tests;
#[cfg(test)]
#[path = "access_tests.rs"]
mod access_tests;
#[cfg(test)]
#[path = "guard_tests.rs"]
mod guard_tests;
use std::path::PathBuf;
pub use error::{MarkSourceId, VacuumError};
pub use report::{
EntryKind, MalformedEntry, ManifestEntryReport, ManifestReport, MarkTallies, MetadataOrigin,
MetadataReport, MetadataSourceKind, MetadataSourceReport, NodeTotals, ShardPresence,
ShardReport, SweepBlocker, UninventoriedEntry, VacuumMode, VacuumReport,
};
pub const CANONICAL_REFS_DIR: &str = "branches";
pub const CANONICAL_SNAPSHOT_REGISTRY: &str = "snapshots.hsr";
#[derive(Debug, Clone)]
pub struct VacuumOptions {
pub data_dir: PathBuf,
pub refs_dirs: Vec<PathBuf>,
pub snapshot_files: Vec<PathBuf>,
pub attest_metadata_complete: bool,
}
impl VacuumOptions {
pub const fn new(data_dir: PathBuf) -> Self {
Self {
data_dir,
refs_dirs: Vec::new(),
snapshot_files: Vec::new(),
attest_metadata_complete: false,
}
}
}
pub fn vacuum_stats(options: &VacuumOptions) -> Result<VacuumReport, VacuumError> {
stats::run(options)
}