#[non_exhaustive]pub enum EntryCompression {
Unknown,
Entry(u64),
SolidBlockStart(SolidBlock),
SolidBlockMember,
}Expand description
How an archive entry’s data is compressed.
Solid 7z members share one compressed stream, so only the block as a whole has a meaningful ratio; encoding that here keeps a per-file ratio from being computed for them.
§Examples
use exarch_core::EntryCompression;
assert_eq!(EntryCompression::Entry(40).compressed_size(), Some(40));
assert_eq!(EntryCompression::Unknown.compressed_size(), None);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unknown
The format does not expose a compressed size (TAR) or the entry has no data stream (empty 7z files)
Entry(u64)
The entry owns this many compressed bytes (ZIP, 7z single-file block)
SolidBlockStart(SolidBlock)
First file of a solid block; carries the totals of the whole block
SolidBlockMember
Later file of a solid block; its data is accounted to the block start
Implementations§
Source§impl EntryCompression
impl EntryCompression
Sourcepub const fn compressed_size(&self) -> Option<u64>
pub const fn compressed_size(&self) -> Option<u64>
Compressed size to report for the entry: the entry’s own size, or the whole block’s size for a solid block start.
Sourcepub const fn entry_compressed_size(&self) -> Option<u64>
pub const fn entry_compressed_size(&self) -> Option<u64>
Compressed size owned by the entry alone, for per-file ratio checks.
Trait Implementations§
Source§impl Clone for EntryCompression
impl Clone for EntryCompression
impl Copy for EntryCompression
Source§impl Debug for EntryCompression
impl Debug for EntryCompression
impl Eq for EntryCompression
Source§impl PartialEq for EntryCompression
impl PartialEq for EntryCompression
impl StructuralPartialEq for EntryCompression
Auto Trait Implementations§
impl Freeze for EntryCompression
impl RefUnwindSafe for EntryCompression
impl Send for EntryCompression
impl Sync for EntryCompression
impl Unpin for EntryCompression
impl UnsafeUnpin for EntryCompression
impl UnwindSafe for EntryCompression
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.