pub struct ZstdCodec { /* private fields */ }Expand description
Zstandard codec combining compression and decompression.
Implementations§
Source§impl ZstdCodec
impl ZstdCodec
Sourcepub fn with_level(level: CompressionLevel) -> Self
pub fn with_level(level: CompressionLevel) -> Self
Create with compression level.
Trait Implementations§
Source§impl Codec for ZstdCodec
impl Codec for ZstdCodec
Source§fn with_level(level: CompressionLevel) -> Self
fn with_level(level: CompressionLevel) -> Self
Create a new codec with specified level.
Source§fn verify_roundtrip(&self, data: &[u8]) -> Result<bool, Error>
fn verify_roundtrip(&self, data: &[u8]) -> Result<bool, Error>
Round-trip test: compress then decompress.
Returns true if data matches.
Source§fn measure_ratio(&self, data: &[u8]) -> Result<CompressionRatio, Error>
fn measure_ratio(&self, data: &[u8]) -> Result<CompressionRatio, Error>
Get compression ratio for given data.
Source§impl Compressor for ZstdCodec
impl Compressor for ZstdCodec
Source§fn level(&self) -> CompressionLevel
fn level(&self) -> CompressionLevel
Get the configured compression level.
Source§fn compress_to(&self, input: &[u8], output: &mut [u8]) -> Result<usize>
fn compress_to(&self, input: &[u8], output: &mut [u8]) -> Result<usize>
Compress data into existing buffer. Read more
Source§fn max_compressed_size(&self, input_len: usize) -> usize
fn max_compressed_size(&self, input_len: usize) -> usize
Calculate maximum compressed size for input length.
Useful for pre-allocating output buffers.
Source§fn stats(&self) -> Option<CompressionStats>
fn stats(&self) -> Option<CompressionStats>
Get compression statistics after operation.
Auto Trait Implementations§
impl Freeze for ZstdCodec
impl RefUnwindSafe for ZstdCodec
impl Send for ZstdCodec
impl Sync for ZstdCodec
impl Unpin for ZstdCodec
impl UnwindSafe for ZstdCodec
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