Struct ParallelBlocksCompressor
#[must_use]
pub struct ParallelBlocksCompressor<'w, W> { /* private fields */ }
Compress blocks to a chunk writer with multiple threads.
Implementations
impl<'w, W> ParallelBlocksCompressor<'w, W>
where
W: 'w + ChunksWriter,
fn new(meta: &'w MetaData, chunks_writer: &'w mut W) -> Option<Self>New blocks writer. Returns none if sequential compression should be used. Use
new_with_thread_poolto customize the threadpool.fn new_with_thread_pool<CreatePool>(meta: &'w MetaData, chunks_writer: &'w mut W, try_create_thread_pool: CreatePool) -> Option<Self> where CreatePool: FnOnce() -> Result<ThreadPool, ThreadPoolBuildError>,New blocks writer. Returns none if sequential compression should be used.
fn inner_chunks_writer(&'w self) -> &'w WThis is where the compressed blocks are written to.
fn write_all_queued_chunks(&mut self) -> UnitResultWait until all currently compressing chunks in the compressor have been written.
fn add_block_to_compression_queue(&mut self, index_in_header_increasing_y: usize, block: UncompressedBlock) -> UnitResultAdd a single block to the compressor queue. The index of the block must be in increasing line order. When calling this function for the last block, this method waits until all the blocks have been written. This only works when you write as many blocks as the image expects, otherwise you can use
wait_for_all_remaining_chunks. Waits for a block from the queue to be written, if the queue already has enough items.
Trait Implementations
impl<'w, W: Debug> Debug for ParallelBlocksCompressor<'w, W>
fn fmt(&self, f: &mut Formatter<'_>) -> Result