pub struct ZipFileEntry {
pub file_name: String,
pub compression_method: CompressionMethod,
pub compressed_size: u64,
pub uncompressed_size: u64,
pub crc32: u32,
pub lfh_offset: u64,
pub last_mod_time: u16,
pub last_mod_date: u16,
pub is_directory: bool,
}Expand description
Parsed ZIP file entry information.
This structure contains all the metadata needed to extract a file from a ZIP archive, parsed from the Central Directory.
§Example
for entry in extractor.list_files().await? {
println!("{}: {} bytes (compressed: {})",
entry.file_name,
entry.uncompressed_size,
entry.compressed_size
);
}Fields§
§file_name: StringThe file name (may include path components)
compression_method: CompressionMethodCompression method used for this entry
compressed_size: u64Size of compressed data in bytes
uncompressed_size: u64Size of uncompressed data in bytes
crc32: u32CRC-32 checksum of uncompressed data
lfh_offset: u64Offset to Local File Header from start of archive
last_mod_time: u16Last modification time in DOS format
last_mod_date: u16Last modification date in DOS format
is_directory: boolTrue if this entry represents a directory
Implementations§
Source§impl ZipFileEntry
impl ZipFileEntry
Sourcepub fn mod_date(&self) -> (u16, u8, u8)
pub fn mod_date(&self) -> (u16, u8, u8)
Parse the modification date from DOS format.
DOS date format packs year, month, and day into 16 bits:
- Bits 0-4: Day (1-31)
- Bits 5-8: Month (1-12)
- Bits 9-15: Year offset from 1980
§Returns
A tuple of (year, month, day).
§Example
let (year, month, day) = entry.mod_date();
println!("Modified: {}-{:02}-{:02}", year, month, day);Sourcepub fn mod_time(&self) -> (u8, u8, u8)
pub fn mod_time(&self) -> (u8, u8, u8)
Parse the modification time from DOS format.
DOS time format packs hour, minute, and second into 16 bits:
- Bits 0-4: Second / 2 (0-29, representing 0-58 seconds)
- Bits 5-10: Minute (0-59)
- Bits 11-15: Hour (0-23)
§Returns
A tuple of (hour, minute, second).
§Example
let (hour, minute, second) = entry.mod_time();
println!("Time: {:02}:{:02}:{:02}", hour, minute, second);Trait Implementations§
Source§impl Clone for ZipFileEntry
impl Clone for ZipFileEntry
Source§fn clone(&self) -> ZipFileEntry
fn clone(&self) -> ZipFileEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more