From 333d0d29e351ea8569e9fe5f5a1f101e5a30d2d6 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 d0ec17be..cbd06a61 100644 --- a/lib/src/entry.rs +++ b/lib/src/entry.rs @@ -1014,6 +1014,36 @@ impl NormalEntry { &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 {