gix_pack/data/output/
mod.rs

1use gix_hash::ObjectId;
2
3///
4pub mod count;
5
6/// An item representing a future Entry in the leanest way possible.
7///
8/// One can expect to have one of these in memory when building big objects, so smaller is better here.
9/// They should contain everything of importance to generate a pack as fast as possible.
10#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
11#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12pub struct Count {
13    /// The hash of the object to write
14    pub id: ObjectId,
15    /// A way to locate a pack entry in the object database, only available if the object is in a pack.
16    pub entry_pack_location: count::PackLocation,
17}
18
19/// An entry to be written to a file.
20///
21/// Some of these will be in-flight and in memory while waiting to be written. Memory requirements depend on the amount of compressed
22/// data they hold.
23#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
24#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
25pub struct Entry {
26    /// The hash of the object to write
27    pub id: ObjectId,
28    /// The kind of entry represented by `data`. It's used alongside with it to complete the pack entry
29    /// at rest or in transit.
30    pub kind: entry::Kind,
31    /// The size in bytes needed once `data` gets decompressed
32    pub decompressed_size: usize,
33    /// The compressed data right behind the header
34    pub compressed_data: Vec<u8>,
35}
36
37///
38pub mod entry;
39
40///
41pub mod bytes;