1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use std::path::PathBuf;
use memmap2::Mmap;
#[derive(PartialEq, Eq, Ord, PartialOrd, Debug, Hash, Clone, Copy)]
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
#[allow(missing_docs)]
pub enum Version {
V1 = 1,
}
impl Default for Version {
fn default() -> Self {
Version::V1
}
}
pub type PackIndex = u32;
pub type EntryIndex = u32;
pub struct File {
data: Mmap,
path: std::path::PathBuf,
version: Version,
hash_len: usize,
object_hash: git_hash::Kind,
num_indices: u32,
num_objects: u32,
fan: [u32; 256],
index_names: Vec<PathBuf>,
lookup_ofs: usize,
offsets_ofs: usize,
large_offsets_ofs: Option<usize>,
}
pub mod write;
mod access;
pub mod verify;
pub mod chunk;
pub mod init;