Struct rc_zip_sync::SyncStoredEntry
source · pub struct SyncStoredEntry<'a, F> { /* private fields */ }Expand description
A zip entry, read synchronously from a file or other I/O resource.
Implementations§
Methods from Deref<Target = StoredEntry>§
sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the entry’s name. See also sanitized_name(), which returns a sanitized version of the name.
This should be a relative path, separated by /. However, there are zip
files in the wild with all sorts of evil variants, so, be conservative
in what you accept.
sourcepub fn sanitized_name(&self) -> Option<&str>
pub fn sanitized_name(&self) -> Option<&str>
Returns a sanitized version of the entry’s name, if it seems safe. In particular, if this method feels like the entry name is trying to do a zip slip (cf. https://snyk.io/research/zip-slip-vulnerability), it’ll return None.
Other than that, it will strip any leading slashes on non-Windows OSes.
sourcepub fn comment(&self) -> Option<&str>
pub fn comment(&self) -> Option<&str>
The entry’s comment, if any.
When reading a zip file, an empty comment results in None.
sourcepub fn modified(&self) -> DateTime<Utc>
pub fn modified(&self) -> DateTime<Utc>
This entry’s “last modified” timestamp - with caveats
Due to the history of the ZIP file format, this may be inaccurate. It may be offset by a few hours, if there is no extended timestamp information. It may have a resolution as low as two seconds, if only MSDOS timestamps are present. It may default to the Unix epoch, if something went really wrong.
If you’re reading this after the year 2038, or after the year 2108, godspeed.
sourcepub fn created(&self) -> Option<&DateTime<Utc>>
pub fn created(&self) -> Option<&DateTime<Utc>>
This entry’s “created” timestamp, if available.
See StoredEntry::modified() for caveats.
sourcepub fn accessed(&self) -> Option<&DateTime<Utc>>
pub fn accessed(&self) -> Option<&DateTime<Utc>>
This entry’s “last accessed” timestamp, if available.
See StoredEntry::modified() for caveats.
sourcepub fn contents(&self) -> EntryContents
pub fn contents(&self) -> EntryContents
Determine EntryContents of this entry based on its mode.