From a115416b65ec59830f21283438869ae919d69714 Mon Sep 17 00:00:00 2001 From: ChanTsune <41658782+ChanTsune@users.noreply.github.com> Date: Wed, 10 Jul 2024 21:59:24 +0900 Subject: [PATCH] :zap: Add shorthand for `RegularEntry` header information --- lib/src/entry.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lib/src/entry.rs b/lib/src/entry.rs index 76eed33f..959dfaec 100644 --- a/lib/src/entry.rs +++ b/lib/src/entry.rs @@ -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 {