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