pub struct ExtractLimits {
pub max_entries: u64,
pub max_file_bytes: u64,
pub max_total_bytes: u64,
}Expand description
Resource limits enforced while extracting an archive, to defend against decompression bombs (an archive that is small on disk but expands to an enormous number of entries or bytes).
These bound disk usage and entry count; extraction memory is already a
fixed EXTRACT_CHUNK_SIZE buffer regardless of these values. The defaults
are generous enough for real mod and texture packs while still rejecting
pathological archives; tune them with extract_zip_with_limits when a
caller needs different bounds.
Fields§
§max_entries: u64Maximum number of entries (files + directories) an archive may contain.
max_file_bytes: u64Maximum uncompressed size of any single entry, in bytes.
max_total_bytes: u64Maximum total uncompressed size across all entries, in bytes.
Trait Implementations§
Source§impl Clone for ExtractLimits
impl Clone for ExtractLimits
Source§fn clone(&self) -> ExtractLimits
fn clone(&self) -> ExtractLimits
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ExtractLimits
Source§impl Debug for ExtractLimits
impl Debug for ExtractLimits
Auto Trait Implementations§
impl Freeze for ExtractLimits
impl RefUnwindSafe for ExtractLimits
impl Send for ExtractLimits
impl Sync for ExtractLimits
impl Unpin for ExtractLimits
impl UnsafeUnpin for ExtractLimits
impl UnwindSafe for ExtractLimits
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