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,

type Item = <I as Iterator>::Item;
type IntoIter = I;
fn into_iter(self) -> I

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,

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

fn borrow_mut(&mut self) -> &mut T

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

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for ParallelBlockDecompressor<R>

const ALIGN: usize = _;
type Init = T;
unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

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

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

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>