pub struct ZipLimits {
pub max_file_read_size: usize,
pub max_mimetype_size: usize,
pub strict: bool,
pub max_eocd_scan: usize,
}Expand description
Runtime-configurable ZIP safety limits.
Fields§
§max_file_read_size: usizeMaximum compressed or uncompressed file size allowed for reads.
max_mimetype_size: usizeMaximum allowed size for the required mimetype entry.
strict: boolWhether ZIP parsing should fail on strict structural issues.
max_eocd_scan: usizeMaximum bytes scanned from file tail while searching for EOCD.
Implementations§
Source§impl ZipLimits
impl ZipLimits
Sourcepub fn new(max_file_read_size: usize, max_mimetype_size: usize) -> Self
pub fn new(max_file_read_size: usize, max_mimetype_size: usize) -> Self
Create explicit ZIP limits.
Sourcepub fn with_strict(self, strict: bool) -> Self
pub fn with_strict(self, strict: bool) -> Self
Enable or disable strict ZIP parsing behavior.
Sourcepub fn with_max_eocd_scan(self, max_eocd_scan: usize) -> Self
pub fn with_max_eocd_scan(self, max_eocd_scan: usize) -> Self
Set a cap for EOCD tail scan bytes.
Trait Implementations§
impl Copy for ZipLimits
impl Eq for ZipLimits
impl StructuralPartialEq for ZipLimits
Auto Trait Implementations§
impl Freeze for ZipLimits
impl RefUnwindSafe for ZipLimits
impl Send for ZipLimits
impl Sync for ZipLimits
impl Unpin for ZipLimits
impl UnsafeUnpin for ZipLimits
impl UnwindSafe for ZipLimits
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