pub struct CompressionBombDetector { /* private fields */ }Expand description
High-level compression bomb detector
Implementations§
Source§impl CompressionBombDetector
impl CompressionBombDetector
Sourcepub fn new(config: CompressionBombConfig) -> Self
pub fn new(config: CompressionBombConfig) -> Self
Create new detector with configuration
Sourcepub fn validate_pre_decompression(&self, compressed_size: usize) -> Result<()>
pub fn validate_pre_decompression(&self, compressed_size: usize) -> Result<()>
Validate compressed data before decompression
Sourcepub fn protect_reader<R: Read>(
&self,
reader: R,
compressed_size: usize,
) -> CompressionBombProtector<R> ⓘ
pub fn protect_reader<R: Read>( &self, reader: R, compressed_size: usize, ) -> CompressionBombProtector<R> ⓘ
Create protected reader for safe decompression
Sourcepub fn protect_nested_reader<R: Read>(
&self,
reader: R,
compressed_size: usize,
depth: usize,
) -> Result<CompressionBombProtector<R>>
pub fn protect_nested_reader<R: Read>( &self, reader: R, compressed_size: usize, depth: usize, ) -> Result<CompressionBombProtector<R>>
Create protected reader with compression depth tracking
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompressionBombDetector
impl RefUnwindSafe for CompressionBombDetector
impl Send for CompressionBombDetector
impl Sync for CompressionBombDetector
impl Unpin for CompressionBombDetector
impl UnwindSafe for CompressionBombDetector
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more