Struct ParallelBlockDecompressor

pub struct ParallelBlockDecompressor<R: ChunksReader> { /* private fields */ }

Decompress the chunks in a file in parallel.

The first call to next will fill the thread pool with jobs, starting to decompress the next few blocks. These jobs will finish, even if you stop reading more blocks. Implements iterator.

Implementations

impl<R: ChunksReader> ParallelBlockDecompressor<R>

fn new(chunks: R, pedantic: bool) -> Result<Self, R>

Create a new decompressor. Does not immediately spawn any tasks. Decompression starts after the first call to next. Returns the chunks if parallel decompression should not be used. Use new_with_thread_pool to customize the threadpool.

fn new_with_thread_pool<CreatePool>(chunks: R, pedantic: bool, try_create_thread_pool: CreatePool) -> Result<Self, R>
where
    CreatePool: FnOnce() -> Result<ThreadPool, ThreadPoolBuildError>,

Create a new decompressor. Does not immediately spawn any tasks. Decompression starts after the first call to next. Returns the chunks if parallel decompression should not be used.

fn decompress_next_block(&mut self) -> Option<Result<UncompressedBlock>>

Fill the pool with decompression jobs. Returns the first job that finishes.

fn meta_data(&self) -> &MetaData

The extracted meta data of the image file.

Trait Implementations

impl<R: ChunksReader> ExactSizeIterator for ParallelBlockDecompressor<R>

impl<R: ChunksReader> Iterator for ParallelBlockDecompressor<R>

type Item = Result<UncompressedBlock, Error>;
fn next(&mut self) -> Option<Self::Item>
fn size_hint(&self) -> (usize, Option<usize>)

impl<R: Debug + ChunksReader> Debug for ParallelBlockDecompressor<R>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<R> !RefUnwindSafe for ParallelBlockDecompressor<R>

impl<R> !Sync for ParallelBlockDecompressor<R>

impl<R> !UnwindSafe for ParallelBlockDecompressor<R>

impl<R> Freeze for ParallelBlockDecompressor<R> where R: Freeze,

impl<R> Send for ParallelBlockDecompressor<R> where R: Send,

impl<R> Unpin for ParallelBlockDecompressor<R> where R: Unpin,

impl<R> UnsafeUnpin for ParallelBlockDecompressor<R> where R: UnsafeUnpin,

Blanket Implementations

impl<I> IntoIterator for ParallelBlockDecompressor<R> where I: Iterator,

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for ParallelBlockDecompressor<R> where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for ParallelBlockDecompressor<R> where ST: ?Sized, DT: ?Sized,

impl<T> Any for ParallelBlockDecompressor<R> where T: 'static + ?Sized,

impl<T> Borrow<T> for ParallelBlockDecompressor<R> where T: ?Sized,

impl<T> BorrowMut<T> for ParallelBlockDecompressor<R> where T: ?Sized,

impl<T> From<T> for ParallelBlockDecompressor<R>

impl<T> Pointable for ParallelBlockDecompressor<R>

impl<T> Read<Exclusive, BecauseExclusive> for ParallelBlockDecompressor<R> where T: ?Sized,

impl<T, U> Into<U> for ParallelBlockDecompressor<R> where U: From<T>,

impl<T, U> TryFrom<U> for ParallelBlockDecompressor<R> where U: Into<T>,

impl<T, U> TryInto<U> for ParallelBlockDecompressor<R> where U: TryFrom<T>,