pub struct StreamingZipWriter<W: Write + Seek> { /* private fields */ }Expand description
Streaming ZIP writer that compresses data on-the-fly
Implementations§
Source§impl StreamingZipWriter<File>
impl StreamingZipWriter<File>
Sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
Create a new ZIP writer with default compression level (6) using DEFLATE
Sourcepub fn with_compression<P: AsRef<Path>>(
path: P,
compression_level: u32,
) -> Result<Self>
pub fn with_compression<P: AsRef<Path>>( path: P, compression_level: u32, ) -> Result<Self>
Create a new ZIP writer with custom compression level (0-9) using DEFLATE
Sourcepub fn with_method<P: AsRef<Path>>(
path: P,
method: CompressionMethod,
compression_level: u32,
) -> Result<Self>
pub fn with_method<P: AsRef<Path>>( path: P, method: CompressionMethod, compression_level: u32, ) -> Result<Self>
Create a new ZIP writer with specified compression method and level
§Arguments
path- Path to the output ZIP filemethod- Compression method to use (Deflate, Zstd, or Stored)compression_level- Compression level (0-9 for DEFLATE, 1-21 for Zstd)
Source§impl<W: Write + Seek> StreamingZipWriter<W>
impl<W: Write + Seek> StreamingZipWriter<W>
Sourcepub fn from_writer(writer: W) -> Result<Self>
pub fn from_writer(writer: W) -> Result<Self>
Create a new ZIP writer from an arbitrary writer with default compression level (6) using DEFLATE
Sourcepub fn from_writer_with_compression(
writer: W,
compression_level: u32,
) -> Result<Self>
pub fn from_writer_with_compression( writer: W, compression_level: u32, ) -> Result<Self>
Create a new ZIP writer from an arbitrary writer with custom compression level
Sourcepub fn from_writer_with_method(
writer: W,
method: CompressionMethod,
compression_level: u32,
) -> Result<Self>
pub fn from_writer_with_method( writer: W, method: CompressionMethod, compression_level: u32, ) -> Result<Self>
Create a new ZIP writer from an arbitrary writer with specified compression method and level
§Arguments
writer- Any writer implementing Write + Seekmethod- Compression method to use (Deflate, Zstd, or Stored)compression_level- Compression level (0-9 for DEFLATE, 1-21 for Zstd)
Sourcepub fn start_entry(&mut self, name: &str) -> Result<()>
pub fn start_entry(&mut self, name: &str) -> Result<()>
Start a new entry (file) in the ZIP
Sourcepub fn write_data(&mut self, data: &[u8]) -> Result<()>
pub fn write_data(&mut self, data: &[u8]) -> Result<()>
Write uncompressed data to current entry (will be compressed on-the-fly)
Auto Trait Implementations§
impl<W> Freeze for StreamingZipWriter<W>where
W: Freeze,
impl<W> !RefUnwindSafe for StreamingZipWriter<W>
impl<W> !Send for StreamingZipWriter<W>
impl<W> !Sync for StreamingZipWriter<W>
impl<W> Unpin for StreamingZipWriter<W>where
W: Unpin,
impl<W> !UnwindSafe for StreamingZipWriter<W>
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