gix_pack/multi_index/
mod.rs

1use std::path::PathBuf;
2
3use memmap2::Mmap;
4
5/// Known multi-index file versions
6#[derive(Default, PartialEq, Eq, Ord, PartialOrd, Debug, Hash, Clone, Copy)]
7#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8#[allow(missing_docs)]
9pub enum Version {
10    #[default]
11    V1 = 1,
12}
13
14/// An index into our [`File::index_names()`] array yielding the name of the index and by implication, its pack file.
15pub type PackIndex = u32;
16
17/// The type for referring to indices of an entry within the index file.
18pub type EntryIndex = u32;
19
20/// A representation of an index file for multiple packs at the same time, typically stored in a file
21/// named 'multi-pack-index'.
22pub struct File {
23    data: Mmap,
24    path: std::path::PathBuf,
25    version: Version,
26    hash_len: usize,
27    object_hash: gix_hash::Kind,
28    /// The amount of pack files contained within
29    num_indices: u32,
30    num_objects: u32,
31
32    fan: [u32; 256],
33    index_names: Vec<PathBuf>,
34    lookup_ofs: usize,
35    offsets_ofs: usize,
36    large_offsets_ofs: Option<usize>,
37}
38
39///
40pub mod write;
41
42///
43mod access;
44
45///
46pub mod verify;
47
48///
49pub mod chunk;
50
51///
52pub mod init;