/// The wrapper for zlib's `compress` function.
///
/// Compresses the `src` parameter into the `dest` parameter and returning the
/// number of bytes written. If the compression fails for some reason, Err is
/// returned. In this case, the `dest` buffer may or may not be modified.
The wrapper for zlib's `compress` function.
Compresses the `src` parameter into the `dest` parameter and returning the
number of bytes written. If the compression fails for some reason, Err is
returned. In this case, the `dest` buffer may or may not be modified.
The wrapper for zlib ' s ` compress ` function . Compresses the ` src ` parameter into the ` dest ` parameter and returning the number of bytes written . If the compression fails for some reason Err is returned . In this case the ` dest ` buffer may or may not be modified .
pub fn compress(dest: &mut [u8], src: &[u8]) -> Result<usize, Error> {
    let mut output_size = dest.len() as c_ulong;
    Error::from_raw(unsafe {
        raw::compress(dest.as_mut_ptr(), &mut output_size,
                      src.as_ptr(), src.len() as c_ulong)
    }).map(|()| output_size as usize)
}
pub fn compress ( dest : & mut [ u8 ] , src : & [ u8 ] ) -> Result < usize , Error > { let mut output_size = dest . len ( ) as c_ulong ; Error :: from_raw ( unsafe { raw :: compress ( dest . as_mut_ptr ( ) , & mut output_size , src . as_ptr ( ) , src . len ( ) as c_ulong ) } ) . map ( | ( ) | output_size as usize ) }
The wrapper for zlib's `compress` function.
The wrapper for zlib ' s ` compress ` function .
dest
&mut [u8]
src
&[u8]