Struct zstd_seekable::Seekable
source · pub struct Seekable<'a, R> { /* private fields */ }
Expand description
The type of decompressors.
Implementations§
source§impl<'a, R> Seekable<'a, R>
impl<'a, R> Seekable<'a, R>
sourcepub fn decompress(
&mut self,
out: &mut [u8],
offset: u64
) -> Result<usize, Error>
pub fn decompress( &mut self, out: &mut [u8], offset: u64 ) -> Result<usize, Error>
Decompress starting from an offset. The length of out
must
be at most the size of the decompressed output.
This function finds the correct frame to start with, and takes care of decompressing multiple frames in a row.
sourcepub fn get_num_frames(&self) -> usize
pub fn get_num_frames(&self) -> usize
Number of frames in the message.
sourcepub fn get_frame_compressed_offset(&self, frame_index: usize) -> c_ulonglong
pub fn get_frame_compressed_offset(&self, frame_index: usize) -> c_ulonglong
Offset of the frame in the compressed data.
sourcepub fn get_frame_compressed_size(&self, frame_index: usize) -> usize
pub fn get_frame_compressed_size(&self, frame_index: usize) -> usize
Size of the frame in the compressed data.
sourcepub fn get_frame_decompressed_offset(&self, frame_index: usize) -> u64
pub fn get_frame_decompressed_offset(&self, frame_index: usize) -> u64
Offset of the frame in the decompressed data.
sourcepub fn get_frame_decompressed_size(&self, frame_index: usize) -> usize
pub fn get_frame_decompressed_size(&self, frame_index: usize) -> usize
Size of the frame in the decompressed data.
sourcepub fn decompress_frame(&mut self, dest: &mut [u8], index: usize) -> usize
pub fn decompress_frame(&mut self, dest: &mut [u8], index: usize) -> usize
Decompress a single frame. This method internally calls decompress
, and dest
must be exactly the size of the uncompressed frame.
sourcepub fn seekable_offset_to_frame_index(&mut self, offset: u64) -> usize
pub fn seekable_offset_to_frame_index(&mut self, offset: u64) -> usize
Perform a binary search to find the frame containing the offset.
Trait Implementations§
Auto Trait Implementations§
impl<'a, R> RefUnwindSafe for Seekable<'a, R>where R: RefUnwindSafe,
impl<'a, R> !Sync for Seekable<'a, R>
impl<'a, R> Unpin for Seekable<'a, R>
impl<'a, R> UnwindSafe for Seekable<'a, R>where R: RefUnwindSafe,
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