pub struct StreamCompressor { /* private fields */ }Expand description
Streaming compressor: feed raw output bytes incrementally (as a command
produces them) and render the same compressed view as compress on
finish. Memory stays bounded by the head/tail windows and the lines that
match keep patterns — the mass of uninteresting middle lines is only
counted, never stored, so a command emitting gigabytes cannot exhaust
memory.
Deterministic: for a given byte stream and options, StreamCompressor::finish
always returns the same result, byte-stable with compress.
Implementations§
Source§impl StreamCompressor
impl StreamCompressor
Sourcepub fn new(options: &CompressOptions) -> Result<Self, ExecError>
pub fn new(options: &CompressOptions) -> Result<Self, ExecError>
Create a streaming compressor for options.
Sourcepub fn push(&mut self, bytes: &[u8])
pub fn push(&mut self, bytes: &[u8])
Feed a chunk of raw output bytes. Chunks may split lines anywhere.
Sourcepub fn finish(self) -> CompressResult
pub fn finish(self) -> CompressResult
Render the final compressed view and statistics.
Auto Trait Implementations§
impl Freeze for StreamCompressor
impl RefUnwindSafe for StreamCompressor
impl Send for StreamCompressor
impl Sync for StreamCompressor
impl Unpin for StreamCompressor
impl UnsafeUnpin for StreamCompressor
impl UnwindSafe for StreamCompressor
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