pub struct SecureCompressor { /* private fields */ }Expand description
Secure compression wrapper with bomb protection
Implementations§
Source§impl SecureCompressor
impl SecureCompressor
Sourcepub fn new(
detector: CompressionBombDetector,
strategy: CompressionStrategy,
) -> Self
pub fn new( detector: CompressionBombDetector, strategy: CompressionStrategy, ) -> Self
Create new secure compressor with detector and strategy
Sourcepub fn with_default_security(strategy: CompressionStrategy) -> Self
pub fn with_default_security(strategy: CompressionStrategy) -> Self
Create with default security settings
Sourcepub fn compress(&self, data: &[u8]) -> Result<SecureCompressedData>
pub fn compress(&self, data: &[u8]) -> Result<SecureCompressedData>
Compress data with security validation
Sourcepub fn decompress_protected(
&self,
compressed: &SecureCompressedData,
) -> Result<Vec<u8>>
pub fn decompress_protected( &self, compressed: &SecureCompressedData, ) -> Result<Vec<u8>>
Decompress data with bomb protection
Sourcepub fn decompress_nested(
&self,
compressed: &SecureCompressedData,
depth: usize,
) -> Result<Vec<u8>>
pub fn decompress_nested( &self, compressed: &SecureCompressedData, depth: usize, ) -> Result<Vec<u8>>
Decompress nested/chained compression with depth tracking
Auto Trait Implementations§
impl Freeze for SecureCompressor
impl RefUnwindSafe for SecureCompressor
impl Send for SecureCompressor
impl Sync for SecureCompressor
impl Unpin for SecureCompressor
impl UnwindSafe for SecureCompressor
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