[][src]Struct zstd_seekable::Seekable

pub struct Seekable<'a, R> { /* fields omitted */ }

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]

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

impl<'a, R> Drop for Seekable<'a, R>[src]

impl<R> Send for Seekable<'static, R>[src]

Auto Trait Implementations

impl<'a, R> RefUnwindSafe for Seekable<'a, R> where
    R: RefUnwindSafe
[src]

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]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.