pub struct CStream { /* private fields */ }Expand description
The type of compressors.
Implementations§
Source§impl CStream
impl CStream
pub fn new(level: usize) -> Result<Self, Error>
pub fn in_size() -> usize
pub fn out_size() -> usize
Sourcepub fn compress(
&mut self,
output: &mut [u8],
input: &[u8],
) -> Result<(usize, usize, usize), Error>
pub fn compress( &mut self, output: &mut [u8], input: &[u8], ) -> Result<(usize, usize, usize), Error>
Compress one chunk of input, and write it into the output. The output array must be large enough to hold the result. If successful, this function returns three integers (out_pos, in_pos, next_read_size), where out_pos is the number of bytes written in output, in_pos is the number of input bytes consumed, and next_read_size is a hint for the next read size.
pub fn compress2( &mut self, output: &mut [u8], input: &[u8], op: EndDirective, ) -> Result<(usize, usize, usize), Error>
pub fn flush(&mut self, output: &mut [u8]) -> Result<(usize, usize), Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CStream
impl RefUnwindSafe for CStream
impl !Send for CStream
impl !Sync for CStream
impl Unpin for CStream
impl UnwindSafe for CStream
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