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. Usenew_with_thread_poolto 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) -> &MetaDataThe 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