Struct zstd_seekable::SeekableCStream
source · pub struct SeekableCStream { /* private fields */ }
Expand description
The type of seekable compressors.
Implementations§
source§impl SeekableCStream
impl SeekableCStream
sourcepub fn new(level: usize, frame_size: usize) -> Result<Self, Error>
pub fn new(level: usize, frame_size: usize) -> Result<Self, Error>
Create a compressor with the given level and frame size. When seeking in the file, frames are decompressed one by one, so this should be chosen of a size similar to the chunks that will be decompressed.
sourcepub fn compress(
&mut self,
output: &mut [u8],
input: &[u8]
) -> Result<(usize, usize), Error>
pub fn compress( &mut self, output: &mut [u8], input: &[u8] ) -> Result<(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 two integers (out_pos, in_pos)
, where out_pos
is the number of bytes written in output
, and in_pos
is the number of input bytes consumed.
Trait Implementations§
source§impl Drop for SeekableCStream
impl Drop for SeekableCStream
impl Send for SeekableCStream
Auto Trait Implementations§
impl RefUnwindSafe for SeekableCStream
impl !Sync for SeekableCStream
impl Unpin for SeekableCStream
impl UnwindSafe for SeekableCStream
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