Skip to content

Commit

Permalink
⚡ Add shorthand for RegularEntry header information
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanTsune committed Jul 10, 2024
1 parent 0c0f103 commit a115416
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lib/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,36 @@ impl RegularEntry {
&self.header
}

/// Path of the entry.
#[inline]
pub fn path(&self) -> &EntryName {
&self.header.path
}

/// Type of the entry.
#[inline]
pub const fn data_kind(&self) -> DataKind {
self.header.data_kind
}

/// Compression method of the entry.
#[inline]
pub const fn compression(&self) -> Compression {
self.header.compression
}

/// Encryption method of the entry.
#[inline]
pub const fn encryption(&self) -> Encryption {
self.header.encryption
}

/// Cipher mode of the entry's encryption method.
#[inline]
pub const fn cipher_mode(&self) -> CipherMode {
self.header.cipher_mode
}

/// Metadata of the entry.
#[inline]
pub fn metadata(&self) -> &Metadata {
Expand Down

0 comments on commit a115416

Please sign in to comment.