pub struct ZipDataWriter<W> { /* private fields */ }Expand description
A writer for the uncompressed data of a Zip file entry.
This writer will keep track of the data necessary to write the data descriptor (ie: number of bytes written and the CRC32 checksum).
Once all the data has been written, invoke the finish method to receive the
DataDescriptorOutput necessary to finalize the entry.
Implementations§
Source§impl<W> ZipDataWriter<W>
impl<W> ZipDataWriter<W>
Sourcepub fn new(inner: W) -> Self
👎Deprecated since 0.4.0: Use the tuple-based API: ZipFileBuilder::start() returns (writer, builder) which can propagate the CRC32 option
pub fn new(inner: W) -> Self
ZipFileBuilder::start() returns (writer, builder) which can propagate the CRC32 optionCreates a new ZipDataWriter that writes to an underlying writer.
Sourcepub fn finish(self) -> Result<(W, DataDescriptorOutput), Error>where
W: Write,
pub fn finish(self) -> Result<(W, DataDescriptorOutput), Error>where
W: Write,
Consumes self and returns the inner writer and the data descriptor to be
passed to a ZipEntryWriter.
The writer is returned to facilitate situations where the underlying compressor needs to be notified that no more data will be written so it can write any sort of necessary epilogue (think zstd).
The DataDescriptorOutput contains the CRC32 checksum and uncompressed size,
which is needed by ZipEntryWriter::finish.
Trait Implementations§
Source§impl<W: Debug> Debug for ZipDataWriter<W>
impl<W: Debug> Debug for ZipDataWriter<W>
Source§impl<W> Write for ZipDataWriter<W>where
W: Write,
impl<W> Write for ZipDataWriter<W>where
W: Write,
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored)