pub struct ExtractionLimits { /* private fields */ }Expand description
Caller-chosen budget on the total inflated size of all archive entries.
Every package-loading entry point requires one; the caller decides whether
the input is trusted (ExtractionLimits::unbounded) or hostile network
bytes (ExtractionLimits::bounded).
Implementations§
Source§impl ExtractionLimits
impl ExtractionLimits
Sourcepub const fn bounded(max_inflated_bytes: u64) -> Self
pub const fn bounded(max_inflated_bytes: u64) -> Self
Caps the running total of inflated bytes across all archive entries
(manifest included) at max_inflated_bytes. Exceeding the budget
fails extraction loudly with
PackageError::InflatedSizeExceeded — entries are never truncated.
Sourcepub const fn unbounded() -> Self
pub const fn unbounded() -> Self
No inflate ceiling.
ONLY for trusted operator-local files (engine startup packages, CLI and build tooling reading archives they just wrote, test fixtures) — never for network input. A hostile archive under any upload ceiling can inflate ~1000:1 and exhaust memory if extracted unbounded.
Trait Implementations§
Source§impl Clone for ExtractionLimits
impl Clone for ExtractionLimits
Source§fn clone(&self) -> ExtractionLimits
fn clone(&self) -> ExtractionLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ExtractionLimits
Source§impl Debug for ExtractionLimits
impl Debug for ExtractionLimits
impl Eq for ExtractionLimits
Source§impl PartialEq for ExtractionLimits
impl PartialEq for ExtractionLimits
Source§fn eq(&self, other: &ExtractionLimits) -> bool
fn eq(&self, other: &ExtractionLimits) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ExtractionLimits
Auto Trait Implementations§
impl Freeze for ExtractionLimits
impl RefUnwindSafe for ExtractionLimits
impl Send for ExtractionLimits
impl Sync for ExtractionLimits
impl Unpin for ExtractionLimits
impl UnsafeUnpin for ExtractionLimits
impl UnwindSafe for ExtractionLimits
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
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
key and return true if they are equal.