]> git.proxmox.com Git - rustc.git/blob - vendor/gix-pack/src/data/input/mod.rs
New upstream version 1.70.0+dfsg2
[rustc.git] / vendor / gix-pack / src / data / input / mod.rs
1 /// An item of the iteration produced by [`BytesToEntriesIter`]
2 #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
3 #[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
4 pub struct Entry {
5 /// The header of a pack entry
6 pub header: crate::data::entry::Header,
7 /// The amount of bytes used to encode the `header`. `pack_offset + header_size` is the beginning of
8 /// the compressed data in the pack.
9 pub header_size: u16,
10 /// The first byte of the entry at which the `header` can be read.
11 pub pack_offset: u64,
12 /// The bytes consumed while producing `decompressed`
13 /// These do not contain the header, which makes it possible to easily replace a RefDelta with offset deltas
14 /// when resolving thin packs.
15 /// Depends on `CompressionMode` when the iterator is initialized.
16 pub compressed: Option<Vec<u8>>,
17 /// The amount of bytes the compressed portion of the entry takes, i.e. the portion behind behind the header.
18 pub compressed_size: u64,
19 /// The CRC32 over the complete entry, that is encoded header and compressed object data.
20 /// Depends on `CompressionMode` when the iterator is initialized
21 pub crc32: Option<u32>,
22 /// The amount of decompressed bytes of the entry.
23 pub decompressed_size: u64,
24 /// Set for the last object in the iteration, providing the hash over all bytes of the iteration
25 /// for use as trailer in a pack or to verify it matches the trailer.
26 pub trailer: Option<gix_hash::ObjectId>,
27 }
28
29 mod entry;
30
31 mod types;
32 pub use types::{EntryDataMode, Error, Mode};
33
34 mod bytes_to_entries;
35 pub use bytes_to_entries::BytesToEntriesIter;
36
37 mod lookup_ref_delta_objects;
38 pub use lookup_ref_delta_objects::LookupRefDeltaObjectsIter;
39
40 mod entries_to_bytes;
41 pub use entries_to_bytes::EntriesToBytesIter;