pub struct AdaptiveCompressor { /* private fields */ }Expand description
Adaptive compressor that selects strategy based on data
Implementations§
Source§impl AdaptiveCompressor
impl AdaptiveCompressor
Sourcepub fn new(level: CompressionLevel) -> Self
pub fn new(level: CompressionLevel) -> Self
Create new adaptive compressor
Sourcepub fn compress(&self, data: &[u8]) -> Result<(Bytes, CompressionStrategy)>
pub fn compress(&self, data: &[u8]) -> Result<(Bytes, CompressionStrategy)>
Compress data with auto-selected strategy
Sourcepub fn decompress(
&self,
data: &[u8],
strategy: CompressionStrategy,
) -> Result<Bytes>
pub fn decompress( &self, data: &[u8], strategy: CompressionStrategy, ) -> Result<Bytes>
Decompress data with specified strategy
Auto Trait Implementations§
impl Freeze for AdaptiveCompressor
impl RefUnwindSafe for AdaptiveCompressor
impl Send for AdaptiveCompressor
impl Sync for AdaptiveCompressor
impl Unpin for AdaptiveCompressor
impl UnsafeUnpin for AdaptiveCompressor
impl UnwindSafe for AdaptiveCompressor
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