pub struct DecompressionLimit { /* private fields */ }Expand description
Limits applied during response body decompression.
Nested content encodings are additionally capped at 4 layers
(MAX_NESTING_DEPTH); max_decompression_ratio remains the primary
defense against large expansion ratios.
Implementations§
Source§impl DecompressionLimit
impl DecompressionLimit
Sourcepub fn is_unlimited(&self) -> bool
pub fn is_unlimited(&self) -> bool
Returns true if neither limit is set.
Sourcepub fn max_decoded_body_size(&self) -> Option<usize>
pub fn max_decoded_body_size(&self) -> Option<usize>
Returns the configured maximum decoded body size, if any.
Sourcepub fn max_decompression_ratio(&self) -> Option<f64>
pub fn max_decompression_ratio(&self) -> Option<f64>
Returns the configured maximum decompression ratio, if any.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate the decompression ratio.
§Errors
Returns Error::Decompression if max_decompression_ratio is not
finite and positive. This is the runtime counterpart to
Self::try_new for limits constructed via struct literal.
Trait Implementations§
Source§impl Clone for DecompressionLimit
impl Clone for DecompressionLimit
Source§fn clone(&self) -> DecompressionLimit
fn clone(&self) -> DecompressionLimit
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 DecompressionLimit
Source§impl Debug for DecompressionLimit
impl Debug for DecompressionLimit
Source§impl Default for DecompressionLimit
impl Default for DecompressionLimit
Source§fn default() -> DecompressionLimit
fn default() -> DecompressionLimit
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DecompressionLimit
impl RefUnwindSafe for DecompressionLimit
impl Send for DecompressionLimit
impl Sync for DecompressionLimit
impl Unpin for DecompressionLimit
impl UnsafeUnpin for DecompressionLimit
impl UnwindSafe for DecompressionLimit
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