#[non_exhaustive]pub struct InflateLimits {
pub max_entry_bytes: u64,
pub max_ratio: u64,
pub max_dex_total_bytes: u64,
}Expand description
Caps on what reading an APK may inflate, against zip bombs. The default
only rejects what Deflate cannot produce; Limits::guarded is for
sweeping untrusted APKs in bulk.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_entry_bytes: u64Most bytes one entry may inflate to.
max_ratio: u64Most an entry may expand over its compressed payload.
max_dex_total_bytes: u64Most bytes all root DEX entries together may declare.
Implementations§
Source§impl Limits
impl Limits
Sourcepub const fn new() -> Limits
pub const fn new() -> Limits
The default: only what Deflate cannot produce is rejected. A
const fn, so that with the setters below limits can be constants.
Sourcepub const fn guarded() -> Limits
pub const fn guarded() -> Limits
Real DEX files are at most a few hundred MiB and compress 2-5:1.
Sourcepub const fn max_entry_bytes(self, bytes: u64) -> Limits
pub const fn max_entry_bytes(self, bytes: u64) -> Limits
These limits with at most bytes inflated per entry.
Sourcepub const fn max_ratio(self, ratio: u64) -> Limits
pub const fn max_ratio(self, ratio: u64) -> Limits
These limits with an entry expanding at most ratio times its
compressed payload.
Sourcepub const fn max_dex_total_bytes(self, bytes: u64) -> Limits
pub const fn max_dex_total_bytes(self, bytes: u64) -> Limits
These limits with at most bytes declared by all root DEX entries
together.
Trait Implementations§
impl Copy for Limits
impl Eq for Limits
impl StructuralPartialEq for Limits
Auto Trait Implementations§
impl Forget for Limits
impl Freeze for Limits
impl Move for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin for Limits
impl UnwindSafe for Limits
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