pub struct StreamCompressor { /* private fields */ }Expand description
A handle to the streaming compressor.
Implementations§
Source§impl StreamCompressor
impl StreamCompressor
Sourcepub fn sender(&self) -> &Sender<ArchiveEntry>
pub fn sender(&self) -> &Sender<ArchiveEntry>
Examples found in repository?
examples/bench_stream.rs (line 58)
53fn run_once(kind: &str, entries: Vec<ArchiveEntry>, archive: &std::path::PathBuf) -> (f64, u64, u64) {
54 let input_bytes: u64 = entries.iter().map(|e| e.data.len() as u64).sum();
55 let t0 = Instant::now();
56 let compressor = compress_stream(archive, false).expect("compress_stream");
57 for e in entries {
58 compressor.sender().send(e).expect("send");
59 }
60 let report = compressor.finish().expect("finish");
61 let secs = t0.elapsed().as_secs_f64();
62 let _ = kind;
63 (secs, input_bytes, report.chunks)
64}Sourcepub fn finish(self) -> Result<CompressionReport>
pub fn finish(self) -> Result<CompressionReport>
Examples found in repository?
examples/bench_stream.rs (line 60)
53fn run_once(kind: &str, entries: Vec<ArchiveEntry>, archive: &std::path::PathBuf) -> (f64, u64, u64) {
54 let input_bytes: u64 = entries.iter().map(|e| e.data.len() as u64).sum();
55 let t0 = Instant::now();
56 let compressor = compress_stream(archive, false).expect("compress_stream");
57 for e in entries {
58 compressor.sender().send(e).expect("send");
59 }
60 let report = compressor.finish().expect("finish");
61 let secs = t0.elapsed().as_secs_f64();
62 let _ = kind;
63 (secs, input_bytes, report.chunks)
64}Auto Trait Implementations§
impl !RefUnwindSafe for StreamCompressor
impl !UnwindSafe for StreamCompressor
impl Freeze for StreamCompressor
impl Send for StreamCompressor
impl Sync for StreamCompressor
impl Unpin for StreamCompressor
impl UnsafeUnpin 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