pub struct CompressedWriteContext { /* private fields */ }Expand description
A write context specifically for compressed output.
This wraps WriteContext to handle the finish() call properly for compressed writers, which need to call finish() on the encoder before the atomic file swap.
Implementations§
Source§impl CompressedWriteContext
impl CompressedWriteContext
Sourcepub fn new(
writer: CompressedWriter,
current_state: Value,
observation_count: usize,
snapshot_interval: Option<usize>,
finish_strategy: FinishStrategy,
diagnostics: DiagnosticCollector,
) -> Self
pub fn new( writer: CompressedWriter, current_state: Value, observation_count: usize, snapshot_interval: Option<usize>, finish_strategy: FinishStrategy, diagnostics: DiagnosticCollector, ) -> Self
Create a new compressed write context.
Sourcepub fn write_observations<P: AsRef<Path>>(
&mut self,
files: &[P],
) -> Result<usize, Vec<Diagnostic>>
pub fn write_observations<P: AsRef<Path>>( &mut self, files: &[P], ) -> Result<usize, Vec<Diagnostic>>
Write observations for a list of JSON files.
Sourcepub fn write_raw(&mut self, bytes: &[u8]) -> Result<(), Vec<Diagnostic>>
pub fn write_raw(&mut self, bytes: &[u8]) -> Result<(), Vec<Diagnostic>>
Write raw bytes to the output (used for copying existing archive content).
Sourcepub fn finish(self) -> Result<DiagnosticCollector, Vec<Diagnostic>>
pub fn finish(self) -> Result<DiagnosticCollector, Vec<Diagnostic>>
Finish the write operation.
This finishes the compression encoder, then performs any atomic file operations needed.
Auto Trait Implementations§
impl Freeze for CompressedWriteContext
impl !RefUnwindSafe for CompressedWriteContext
impl Send for CompressedWriteContext
impl Sync for CompressedWriteContext
impl Unpin for CompressedWriteContext
impl !UnwindSafe for CompressedWriteContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more