[−][src]Struct zstd_seekable::Seekable
The type of decompressors.
Implementations
impl<'a> Seekable<'a, ()>
[src]
pub fn init_buf(input: &'a [u8]) -> Result<Self, Error>
[src]
Initialise a decompressor with an input buffer.
pub fn init_file(name_: &str) -> Result<Self, Error>
[src]
Initialise a decompressor with a file. This method opens the file, and dropping the resulting Seekable
closes the file.
impl<'a, R: Read + Seek> Seekable<'a, R>
[src]
pub fn init(r: Box<R>) -> Result<Self, Error>
[src]
Initialise a decompressor with a file. This method opens the file, and dropping the resulting Seekable
closes the file.
pub fn into_inner(self) -> Box<R>
[src]
impl<'a, R> Seekable<'a, R>
[src]
pub fn decompress(
&mut self,
out: &mut [u8],
offset: u64
) -> Result<usize, Error>
[src]
&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.
pub fn get_num_frames(&self) -> usize
[src]
Number of frames in the message.
pub fn get_frame_compressed_offset(&self, frame_index: usize) -> c_ulonglong
[src]
Offset of the frame in the compressed data.
pub fn get_frame_compressed_size(&self, frame_index: usize) -> usize
[src]
Size of the frame in the compressed data.
pub fn get_frame_decompressed_offset(&self, frame_index: usize) -> u64
[src]
Offset of the frame in the decompressed data.
pub fn get_frame_decompressed_size(&self, frame_index: usize) -> usize
[src]
Size of the frame in the decompressed data.
pub fn decompress_frame(&mut self, dest: &mut [u8], index: usize) -> usize
[src]
Decompress a single frame. This method internally calls decompress
, and dest
must be exactly the size of the uncompressed frame.
pub fn seekable_offset_to_frame_index(&mut self, offset: u64) -> usize
[src]
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,
[src]
R: RefUnwindSafe,
impl<'a, R> !Sync for Seekable<'a, R>
[src]
impl<'a, R> Unpin for Seekable<'a, R>
[src]
impl<'a, R> UnwindSafe for Seekable<'a, R> where
R: RefUnwindSafe,
[src]
R: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,