pub struct Bundle {
pub pack: File,
pub index: File,
}
Expand description
A bundle of pack data and the corresponding pack index
Fields§
§pack: File
The pack file corresponding to index
index: File
The index file corresponding to pack
Implementations§
source§impl Bundle
impl Bundle
Initialization
sourcepub fn at(path: impl AsRef<Path>, object_hash: Kind) -> Result<Self, Error>
pub fn at(path: impl AsRef<Path>, object_hash: Kind) -> Result<Self, Error>
Create a Bundle
from path
, which is either a pack file (*.pack) or an index file (*.idx).
The corresponding complementary file is expected to be present.
The object_hash
is a way to read (and write) the same file format with different hashes, as the hash kind
isn’t stored within the file format itself.
source§impl Bundle
impl Bundle
source§impl Bundle
impl Bundle
sourcepub fn verify_integrity<C, P, F>(
&self,
progress: P,
should_interrupt: &AtomicBool,
options: Options<F>
) -> Result<Outcome<P>, Error<Error>>where
P: Progress,
C: DecodeEntry,
F: Fn() -> C + Send + Clone,
pub fn verify_integrity<C, P, F>( &self, progress: P, should_interrupt: &AtomicBool, options: Options<F> ) -> Result<Outcome<P>, Error<Error>>where P: Progress, C: DecodeEntry, F: Fn() -> C + Send + Clone,
Similar to crate::index::File::verify_integrity()
but more convenient to call as the presence of the
pack file is a given.