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 Nov 21, 2024
1 parent 0095b41 commit 333d0d2
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 @@ -1014,6 +1014,36 @@ impl<T> NormalEntry<T> {
&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 333d0d2

Please sign in to comment.