[−][src]Struct libdeflater::Compressor
A libdeflate
compressor that can compress arbitrary data into
DEFLATE, zlib, or gzip formats.
Implementations
impl Compressor
[src]
pub fn new(lvl: CompressionLvl) -> Compressor
[src]
Returns a newly constructed Compressor
that compresses data
with the supplied
CompressionLvl
pub fn deflate_compress_bound(&mut self, n_bytes: usize) -> usize
[src]
Returns the maximum number of bytes required to encode
n_bytes
as deflate
data. This is a hard upper-bound that assumes the worst
possible compression ratio (i.e. assumes the data cannot be
compressed), format overhead, etc.
pub fn deflate_compress(
&mut self,
in_raw_data: &[u8],
out_deflate_data: &mut [u8]
) -> Result<usize, CompressionError>
[src]
&mut self,
in_raw_data: &[u8],
out_deflate_data: &mut [u8]
) -> Result<usize, CompressionError>
Compresses in_raw_data
as
deflate
data, writing
the data into out_deflate_data
. Returns the number of bytes
written into out_deflate_data
.
pub fn zlib_compress_bound(&mut self, n_bytes: usize) -> usize
[src]
Returns the maximum number of bytes required to encode
n_bytes
as zlib
data. This is a hard upper-bound that assumes the worst
possible compression ratio (i.e. assumes the data cannot be
compressed), format overhead, etc.
pub fn zlib_compress(
&mut self,
in_raw_data: &[u8],
out_zlib_data: &mut [u8]
) -> Result<usize, CompressionError>
[src]
&mut self,
in_raw_data: &[u8],
out_zlib_data: &mut [u8]
) -> Result<usize, CompressionError>
Compresses in_raw_data
as
zlib
data, writing
the data into out_zlib_data
. Returns the number of bytes
written into out_zlib_data
.
pub fn gzip_compress_bound(&mut self, n_bytes: usize) -> usize
[src]
Returns the maximum number of bytes required to encode
n_bytes
as gzip
data. This is a hard upper-bound that assumes the worst
possible compression ratio (i.e. assumes the data cannot be
compressed), format overhead, etc.
pub fn gzip_compress(
&mut self,
in_raw_data: &[u8],
out_gzip_data: &mut [u8]
) -> Result<usize, CompressionError>
[src]
&mut self,
in_raw_data: &[u8],
out_gzip_data: &mut [u8]
) -> Result<usize, CompressionError>
Compresses in_raw_data
as
gzip
data, writing
the data into out_gzip_data
. Returns the number of bytes
written into out_gzip_data
.
Trait Implementations
impl Drop for Compressor
[src]
Auto Trait Implementations
impl RefUnwindSafe for Compressor
impl !Send for Compressor
impl !Sync for Compressor
impl Unpin for Compressor
impl UnwindSafe for Compressor
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,