pub fn compress_partial(src: &[u8], dst: &mut [u8], level: i32) -> Result<(usize, usize)> {
    if src.is_empty() || dst.is_empty() {
        return Ok((0, 0));
    }
    Ok(ExtState::with(|state, _| {
        api::compress_dest_size(&mut state.borrow_mut(), src, dst, level)
    }))
}
/// Compresses data until the destination slice fills up.
///
/// The first `usize` of the returned value represents the number of bytes read from the
/// source buffer, and the other represents the number of bytes written into the destination buffer.
///
/// # Example
///
/// ```
/// use lzzzz::{lz4, lz4_hc};
///
/// let data = b"The quick brown fox jumps over the lazy dog.";
/// let mut buf = [0u8; 16];
///
/// let (src_len, dst_len) = lz4_hc::compress_partial(data, &mut buf, lz4_hc::CLEVEL_DEFAULT)?;
/// let compressed = &buf[..dst_len];
///
/// # let mut buf = [0u8; 256];
/// # let len = lz4::decompress(
/// #     compressed,
/// #     &mut buf[..data.len()],
/// # )?;
/// # assert_eq!(&buf[..len], &data[..src_len]);
/// # Ok::<(), std::io::Error>(())
/// ```
Compresses data until the destination slice fills up.
The first `usize` of the returned value represents the number of bytes read from the
source buffer, and the other represents the number of bytes written into the destination buffer.
Compresses data until the destination slice fills up . The first ` usize ` of the returned value represents the number of bytes read from the source buffer and the other represents the number of bytes written into the destination buffer .
pub fn compress_partial(src: &[u8], dst: &mut [u8], level: i32) -> Result<(usize, usize)> {
    if src.is_empty() || dst.is_empty() {
        return Ok((0, 0));
    }
    Ok(ExtState::with(|state, _| {
        api::compress_dest_size(&mut state.borrow_mut(), src, dst, level)
    }))
}
pub fn compress_partial ( src : & [ u8 ] , dst : & mut [ u8 ] , level : i32 ) -> Result < ( usize , usize ) > { if src . is_empty ( ) || dst . is_empty ( ) { return Ok ( ( 0 , 0 ) ) ; } Ok ( ExtState :: with ( | state , _ | { api :: compress_dest_size ( & mut state . borrow_mut ( ) , src , dst , level ) } ) ) }
Compresses data until the destination slice fills up.
Compresses data until the destination slice fills up .
src
&[u8]
dst
&mut [u8]
level
i32
src
&[u8]
dst
&mut [u8]
level
i32
example


let data = b"The quick brown fox jumps over the lazy dog.";
let mut buf = [0u8; 16].

let (src_len, dst_len) = lz4_hc::compress_partial(data, &mut buf, lz4_hc::CLEVEL_DEFAULT)?;
let compressed = &buf[..dst_len].
let data = b " The quick brown fox jumps over the lazy dog . " ; let mut buf = [ 0u8 ; 16 ] . let ( src_len dst_len ) = lz4_hc :: compress_partial ( data &mut buf lz4_hc :: CLEVEL_DEFAULT ) ? ; let compressed = &buf [ .. dst_len ] .
let mut buf = [0u8; 256];
None
let len = lz4::decompress(
None
compressed,
None
&mut buf[..data.len()],
None
)?;
None
assert_eq!(&buf[..len], &data[..src_len]);
None
ok::<(), std::io::error>(())
None