pub struct ParallelBlocksCompressor<'w, W> { /* private fields */ }
Expand description

Compress blocks to a chunk writer with multiple threads.

Implementations§

source§

impl<'w, W> ParallelBlocksCompressor<'w, W>where W: 'w + ChunksWriter,

source

pub fn new( meta: &'w MetaData, chunks_writer: &'w mut W, pool: ThreadPool ) -> Option<Self>

New blocks writer. Returns none if sequential compression should be used.

source

pub fn inner_chunks_writer(&'w self) -> &'w W

This is where the compressed blocks are written to.

source

pub fn write_all_queued_chunks(&mut self) -> UnitResult

Wait until all currently compressing chunks in the compressor have been written.

source

pub fn add_block_to_compression_queue( &mut self, index_in_header_increasing_y: usize, block: UncompressedBlock ) -> UnitResult

Add 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§

source§

impl<'w, W: Debug> Debug for ParallelBlocksCompressor<'w, W>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'w, W> RefUnwindSafe for ParallelBlocksCompressor<'w, W>where W: RefUnwindSafe,

§

impl<'w, W> Send for ParallelBlocksCompressor<'w, W>where W: Send,

§

impl<'w, W> !Sync for ParallelBlocksCompressor<'w, W>

§

impl<'w, W> Unpin for ParallelBlocksCompressor<'w, W>

§

impl<'w, W> !UnwindSafe for ParallelBlocksCompressor<'w, W>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.