Struct async_zip2::ZipEntry
source · pub struct ZipEntry { /* private fields */ }
Expand description
An immutable store of data about a ZIP entry.
This type cannot be directly constructed so instead, the ZipEntryBuilder
must be used. Internally this builder
stores a ZipEntry
so conversions between these two types via the From
implementations will be
non-allocating.
Implementations§
source§impl ZipEntry
impl ZipEntry
sourcepub fn filename(&self) -> &ZipString
pub fn filename(&self) -> &ZipString
Returns the entry’s filename.
Note
This will return the raw filename stored during ZIP creation. If calling this method on entries retrieved from untrusted ZIP files, the filename should be sanitised before being used as a path to prevent directory traversal attacks.
sourcepub fn compression(&self) -> Compression
pub fn compression(&self) -> Compression
Returns the entry’s compression method.
sourcepub fn uncompressed_size(&self) -> u64
pub fn uncompressed_size(&self) -> u64
Returns the entry’s uncompressed size.
sourcepub fn compressed_size(&self) -> u64
pub fn compressed_size(&self) -> u64
Returns the entry’s compressed size.
sourcepub fn attribute_compatibility(&self) -> AttributeCompatibility
pub fn attribute_compatibility(&self) -> AttributeCompatibility
Returns the entry’s attribute’s host compatibility.
sourcepub fn last_modification_date(&self) -> &ZipDateTime
pub fn last_modification_date(&self) -> &ZipDateTime
Returns the entry’s last modification time & date.
sourcepub fn internal_file_attribute(&self) -> u16
pub fn internal_file_attribute(&self) -> u16
Returns the entry’s internal file attribute.
sourcepub fn external_file_attribute(&self) -> u32
pub fn external_file_attribute(&self) -> u32
Returns the entry’s external file attribute
sourcepub fn extra_fields(&self) -> &[ExtraField]
pub fn extra_fields(&self) -> &[ExtraField]
Returns the entry’s extra field data.
sourcepub fn unix_permissions(&self) -> Option<u16>
pub fn unix_permissions(&self) -> Option<u16>
Returns the entry’s integer-based UNIX permissions.
Note
This will return None if the attribute host compatibility is not listed as Unix.