Struct exr::block::writer::OnProgressChunkWriter

source ·
pub struct OnProgressChunkWriter<'w, W, F> {
    chunk_writer: &'w mut W,
    written_chunks: usize,
    on_progress: F,
}
Expand description

A new writer that triggers a callback for each block written to the inner writer.

Fields§

§chunk_writer: &'w mut W§written_chunks: usize§on_progress: F

Trait Implementations§

source§

impl<'w, W, F> ChunksWriter for OnProgressChunkWriter<'w, W, F>
where W: 'w + ChunksWriter, F: FnMut(f64),

source§

fn total_chunks_count(&self) -> usize

The total number of chunks that the complete file will contain.
source§

fn write_chunk( &mut self, index_in_header_increasing_y: usize, chunk: Chunk, ) -> UnitResult

Any more calls will result in an error and have no effect. If writing results in an error, the file and the writer may remain in an invalid state and should not be used further. Errors when the chunk at this index was already written.
source§

fn on_progress<F>( &mut self, on_progress: F, ) -> OnProgressChunkWriter<'_, Self, F>
where F: FnMut(f64),

Obtain a new writer that calls the specified closure for each block that is written to this writer.
source§

fn sequential_blocks_compressor<'w>( &'w mut self, meta: &'w MetaData, ) -> SequentialBlocksCompressor<'w, Self>

Obtain a new writer that can compress blocks to chunks, which are then passed to this writer.
source§

fn parallel_blocks_compressor<'w>( &'w mut self, meta: &'w MetaData, ) -> Option<ParallelBlocksCompressor<'w, Self>>

Obtain a new writer that can compress blocks to chunks on multiple threads, which are then passed to this writer. Returns none if the sequential compressor should be used instead (thread pool creation failure or too large performance overhead).
source§

fn compress_all_blocks_sequential( self, meta: &MetaData, blocks: impl Iterator<Item = (usize, UncompressedBlock)>, ) -> UnitResult

Compresses all blocks to the file. The index of the block must be in increasing line order within the header. Obtain iterator with MetaData::collect_ordered_blocks(...) or similar methods.
source§

fn compress_all_blocks_parallel( self, meta: &MetaData, blocks: impl Iterator<Item = (usize, UncompressedBlock)>, ) -> UnitResult

Compresses all blocks to the file. The index of the block must be in increasing line order within the header. Obtain iterator with MetaData::collect_ordered_blocks(...) or similar methods. Will fallback to sequential processing where threads are not available, or where it would not speed up the process.
source§

impl<'w, W: Debug, F: Debug> Debug for OnProgressChunkWriter<'w, W, F>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'w, W, F> Freeze for OnProgressChunkWriter<'w, W, F>
where F: Freeze,

§

impl<'w, W, F> RefUnwindSafe for OnProgressChunkWriter<'w, W, F>

§

impl<'w, W, F> Send for OnProgressChunkWriter<'w, W, F>
where F: Send, W: Send,

§

impl<'w, W, F> Sync for OnProgressChunkWriter<'w, W, F>
where F: Sync, W: Sync,

§

impl<'w, W, F> Unpin for OnProgressChunkWriter<'w, W, F>
where F: Unpin,

§

impl<'w, W, F> !UnwindSafe for OnProgressChunkWriter<'w, W, F>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.