Skip to main content

zip/read/
config.rs

1//! Read Config
2
3/// Configuration for reading ZIP archives.
4#[repr(transparent)]
5#[derive(Debug, Default, Clone, Copy)]
6pub struct Config {
7    /// An offset into the reader to use to find the start of the archive.
8    pub archive_offset: ArchiveOffset,
9}
10
11/// The offset of the start of the archive from the beginning of the reader.
12#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
13pub enum ArchiveOffset {
14    /// Detect the archive offset automatically by searching for the central directory's actual
15    /// location and the location specified by the End of Central Directory (EOCD) record.
16    #[default]
17    Detect,
18    /// Specify a fixed archive offset.
19    Known(u64),
20}