Struct StoredZipEntry

Source
pub struct StoredZipEntry { /* private fields */ }
Expand description

An immutable store of data about how a ZIP entry is stored within a specific archive.

Besides storing archive independent information like the size and timestamp it can also be used to query information about how the entry is stored in an archive.

Implementations§

Source§

impl StoredZipEntry

Source

pub fn header_offset(&self) -> u64

Returns the offset in bytes to where the header of the entry starts.

Source

pub fn header_size(&self) -> u64

Returns the combined size in bytes of the header, the filename, and any extra fields.

Note: This uses the extra field length stored in the central directory, which may differ from that stored in the local file header. See specification: https://github.com/Majored/rs-async-zip/blob/main/SPECIFICATION.md#732

Methods from Deref<Target = ZipEntry>§

Source

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.

Source

pub fn compression(&self) -> Compression

Returns the entry’s compression method.

Source

pub fn crc32(&self) -> u32

Returns the entry’s CRC32 value.

Source

pub fn uncompressed_size(&self) -> u64

Returns the entry’s uncompressed size.

Source

pub fn compressed_size(&self) -> u64

Returns the entry’s compressed size.

Source

pub fn attribute_compatibility(&self) -> AttributeCompatibility

Returns the entry’s attribute’s host compatibility.

Source

pub fn last_modification_date(&self) -> &ZipDateTime

Returns the entry’s last modification time & date.

Source

pub fn internal_file_attribute(&self) -> u16

Returns the entry’s internal file attribute.

Source

pub fn external_file_attribute(&self) -> u32

Returns the entry’s external file attribute

Source

pub fn extra_fields(&self) -> &[ExtraField]

Returns the entry’s extra field data.

Source

pub fn comment(&self) -> &ZipString

Returns the entry’s file comment.

Source

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.

Source

pub fn dir(&self) -> Result<bool>

Returns whether or not the entry represents a directory.

Trait Implementations§

Source§

impl Clone for StoredZipEntry

Source§

fn clone(&self) -> StoredZipEntry

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Deref for StoredZipEntry

Source§

type Target = ZipEntry

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.