1pub mod init;
3
4mod find;
5#[cfg(all(not(feature = "wasm"), feature = "streaming-input"))]
7pub mod write;
8
9pub mod verify {
11 use std::sync::atomic::AtomicBool;
12
13 use gix_features::progress::DynNestedProgress;
14
15 pub mod integrity {
17 pub struct Outcome {
19 pub actual_index_checksum: gix_hash::ObjectId,
21 pub pack_traverse_outcome: crate::index::traverse::Statistics,
23 }
24 }
25
26 use crate::Bundle;
27
28 impl Bundle {
29 pub fn verify_integrity<C, F>(
32 &self,
33 progress: &mut dyn DynNestedProgress,
34 should_interrupt: &AtomicBool,
35 options: crate::index::verify::integrity::Options<F>,
36 ) -> Result<integrity::Outcome, crate::index::traverse::Error<crate::index::verify::integrity::Error>>
37 where
38 C: crate::cache::DecodeEntry,
39 F: Fn() -> C + Send + Clone,
40 {
41 self.index
42 .verify_integrity(
43 Some(crate::index::verify::PackContext {
44 data: &self.pack,
45 options,
46 }),
47 progress,
48 should_interrupt,
49 )
50 .map(|o| integrity::Outcome {
51 actual_index_checksum: o.actual_index_checksum,
52 pack_traverse_outcome: o.pack_traverse_statistics.expect("pack is set"),
53 })
54 }
55 }
56}