BinaryFormatWriter

Trait BinaryFormatWriter 

Source
pub trait BinaryFormatWriter: Send + Sync {
    // Required methods
    fn write_chunk(&mut self, chunk: ChunkFormat) -> Result<(), PipelineError>;
    fn write_chunk_at_position<'life0, 'async_trait>(
        &'life0 self,
        chunk: ChunkFormat,
        sequence_number: u64,
    ) -> Pin<Box<dyn Future<Output = Result<(), PipelineError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn finalize<'life0, 'async_trait>(
        &'life0 self,
        final_header: FileHeader,
    ) -> Pin<Box<dyn Future<Output = Result<u64, PipelineError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn bytes_written(&self) -> u64;
    fn chunks_written(&self) -> u32;
}
Expand description

Writer for streaming .adapipe processed files

Required Methods§

Source

fn write_chunk(&mut self, chunk: ChunkFormat) -> Result<(), PipelineError>

Writes a processed chunk (compressed/encrypted data) to the .adapipe file

Source

fn write_chunk_at_position<'life0, 'async_trait>( &'life0 self, chunk: ChunkFormat, sequence_number: u64, ) -> Pin<Box<dyn Future<Output = Result<(), PipelineError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Writes a processed chunk at a specific position for concurrent processing

Changed from &mut self to &self for thread-safe concurrent access. Multiple workers can now call this simultaneously without mutex!

Source

fn finalize<'life0, 'async_trait>( &'life0 self, final_header: FileHeader, ) -> Pin<Box<dyn Future<Output = Result<u64, PipelineError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Finalizes the .adapipe file by writing the footer with complete metadata

Changed from self: Box<Self> to &self for Arc sharing compatibility. Uses internal AtomicBool to prevent double-finalization.

Source

fn bytes_written(&self) -> u64

Gets the current number of bytes written

Source

fn chunks_written(&self) -> u32

Gets the current number of chunks written

Implementors§