pub struct BrotliCodec { /* private fields */ }Expand description
Brotli codec combining compression and decompression.
Implementations§
Source§impl BrotliCodec
impl BrotliCodec
Sourcepub fn new() -> BrotliCodec
pub fn new() -> BrotliCodec
Create a new Brotli codec with default settings.
Sourcepub fn with_level(level: CompressionLevel) -> BrotliCodec
pub fn with_level(level: CompressionLevel) -> BrotliCodec
Create with compression level.
Trait Implementations§
Source§impl Clone for BrotliCodec
impl Clone for BrotliCodec
Source§fn clone(&self) -> BrotliCodec
fn clone(&self) -> BrotliCodec
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 moreSource§impl Codec for BrotliCodec
impl Codec for BrotliCodec
Source§fn new() -> BrotliCodec
fn new() -> BrotliCodec
Create a new codec with default settings.
Source§fn with_level(level: CompressionLevel) -> BrotliCodec
fn with_level(level: CompressionLevel) -> BrotliCodec
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 BrotliCodec
impl Compressor for BrotliCodec
Source§fn level(&self) -> CompressionLevel
fn level(&self) -> CompressionLevel
Get the configured compression level.
Source§fn compress(&self, input: &[u8]) -> Result<Vec<u8>, Error>
fn compress(&self, input: &[u8]) -> Result<Vec<u8>, Error>
Compress data in one shot. Read more
Source§fn compress_to(&self, input: &[u8], output: &mut [u8]) -> Result<usize, Error>
fn compress_to(&self, input: &[u8], output: &mut [u8]) -> Result<usize, Error>
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.
Source§impl Debug for BrotliCodec
impl Debug for BrotliCodec
Source§impl Decompressor for BrotliCodec
impl Decompressor for BrotliCodec
Source§fn decompress(&self, input: &[u8]) -> Result<Vec<u8>, Error>
fn decompress(&self, input: &[u8]) -> Result<Vec<u8>, Error>
Decompress data in one shot. Read more
Source§fn decompress_to(&self, input: &[u8], output: &mut [u8]) -> Result<usize, Error>
fn decompress_to(&self, input: &[u8], output: &mut [u8]) -> Result<usize, Error>
Decompress data into existing buffer. Read more
Source§fn stats(&self) -> Option<CompressionStats>
fn stats(&self) -> Option<CompressionStats>
Get decompression statistics after operation.
Source§impl Default for BrotliCodec
impl Default for BrotliCodec
Source§fn default() -> BrotliCodec
fn default() -> BrotliCodec
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Forget for BrotliCodec
impl Freeze for BrotliCodec
impl RefUnwindSafe for BrotliCodec
impl Send for BrotliCodec
impl Sync for BrotliCodec
impl Unpin for BrotliCodec
impl UnsafeUnpin for BrotliCodec
impl UnwindSafe for BrotliCodec
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