Debian Codegraph @

third_party/rust/zip/src/read/config.rs

raw
1 /// Configuration for reading ZIP archives.
2 #[repr(transparent)]
3 #[derive(Debug, Default, Clone, Copy)]
4 pub struct Config {
5 /// An offset into the reader to use to find the start of the archive.
6 pub archive_offset: ArchiveOffset,
7 }
8
9 /// The offset of the start of the archive from the beginning of the reader.
10 #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
11 pub enum ArchiveOffset {
12 /// Try to detect the archive offset automatically.
13 ///
14 /// This will look at the central directory specified by `FromCentralDirectory` for a header.
15 /// If missing, this will behave as if `None` were specified.
16 #[default]
17 Detect,
18 /// Use the central directory length and offset to determine the start of the archive.
19 FromCentralDirectory,
20 /// Specify a fixed archive offset.
21 Known(u64),
22 }