zip/read/
config.rs

1/// Configuration for reading ZIP archives.
2#[repr(transparent)]
3#[derive(Debug, Default, Clone, Copy)]
4pub 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)]
11pub 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    #[deprecated(since = "2.3.0", note = "use `Detect` instead")]
20    FromCentralDirectory,
21    /// Specify a fixed archive offset.
22    Known(u64),
23}