ArchiveEntry

Struct ArchiveEntry 

Source
pub struct ArchiveEntry {
Show 17 fields pub name: String, pub has_stream: bool, pub is_directory: bool, pub is_anti_item: bool, pub has_creation_date: bool, pub has_last_modified_date: bool, pub has_access_date: bool, pub creation_date: NtTime, pub last_modified_date: NtTime, pub access_date: NtTime, pub has_windows_attributes: bool, pub windows_attributes: u32, pub has_crc: bool, pub crc: u64, pub compressed_crc: u64, pub size: u64, pub compressed_size: u64,
}
Expand description

Represents a single file or directory entry within a 7z archive.

Contains metadata about the entry including name, timestamps, attributes, and size information.

Fields§

§name: String

Name/path of the entry within the archive.

§has_stream: bool

Whether this entry has associated data stream.

§is_directory: bool

Whether this entry is a directory.

§is_anti_item: bool

Whether this is an anti-item (used for deletion in updates).

§has_creation_date: bool

Whether creation date is present.

§has_last_modified_date: bool

Whether last modified date is present.

§has_access_date: bool

Whether access date is present.

§creation_date: NtTime

Creation date and time.

§last_modified_date: NtTime

Last modified date and time.

§access_date: NtTime

Last access date and time.

§has_windows_attributes: bool

Whether Windows file attributes are present.

§windows_attributes: u32

Windows file attributes.

§has_crc: bool

Whether CRC is present.

§crc: u64

CRC32 checksum of uncompressed data.

§compressed_crc: u64

CRC32 checksum of compressed data.

§size: u64

Uncompressed size in bytes.

§compressed_size: u64

Compressed size in bytes.

Implementations§

Source§

impl ArchiveEntry

Source

pub fn new() -> Self

Creates a new default archive entry.

Source

pub fn new_file(entry_name: &str) -> Self

Creates a new archive entry representing a file.

§Arguments
  • entry_name - The name/path of the file within the archive
Source

pub fn new_directory(entry_name: &str) -> Self

Creates a new archive entry representing a directory.

§Arguments
  • entry_name - The name/path of the directory within the archive
Source

pub fn from_path(path: impl AsRef<Path>, entry_name: String) -> Self

Creates a new archive entry from a filesystem path.

Automatically extracts metadata like timestamps and attributes from the filesystem. On Windows, backslashes in the entry name are converted to forward slashes.

§Arguments
  • path - The filesystem path to extract metadata from
  • entry_name - The name/path to use for this entry within the archive
Source

pub fn name(&self) -> &str

Returns the name/path of this entry within the archive.

Source

pub fn is_directory(&self) -> bool

Returns whether this entry is a directory.

Source

pub fn has_stream(&self) -> bool

Returns whether this entry has an associated data stream.

Source

pub fn creation_date(&self) -> NtTime

Returns the creation date of this entry.

Source

pub fn last_modified_date(&self) -> NtTime

Returns the last modified date of this entry.

Source

pub fn size(&self) -> u64

Returns the uncompressed size of this entry in bytes.

Source

pub fn windows_attributes(&self) -> u32

Returns the Windows file attributes of this entry.

Source

pub fn access_date(&self) -> NtTime

Returns the last access date of this entry.

Source

pub fn is_anti_item(&self) -> bool

Returns whether this entry is an anti-item (used for deletion in updates).

Trait Implementations§

Source§

impl Clone for ArchiveEntry

Source§

fn clone(&self) -> ArchiveEntry

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 Debug for ArchiveEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ArchiveEntry

Source§

fn default() -> ArchiveEntry

Returns the “default value” for a type. Read more

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<T> Same for T

Source§

type Output = T

Should always be Self
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.