Skip to main content

ZipWriter

Trait ZipWriter 

Source
pub trait ZipWriter {
    // Required methods
    fn start_file(
        &mut self,
        name: &str,
        options: SimpleFileOptions,
    ) -> Result<()>;
    fn write_all(&mut self, buf: &[u8]) -> Result<()>;
    fn finish(self: Box<Self>) -> Result<()>;
}
Expand description

Trait for user-provided ZIP writers.

Mirrors the subset of zip::ZipWriter used when saving a workbook so that callers can inject custom archive implementations.

Required Methods§

Source

fn start_file(&mut self, name: &str, options: SimpleFileOptions) -> Result<()>

Start a new file in the archive.

Source

fn write_all(&mut self, buf: &[u8]) -> Result<()>

Write bytes to the current archive entry.

Source

fn finish(self: Box<Self>) -> Result<()>

Finish writing the archive.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<W: Write + Seek> ZipWriter for ZipWriter<W>

Source§

fn start_file(&mut self, name: &str, options: SimpleFileOptions) -> Result<()>

Source§

fn write_all(&mut self, buf: &[u8]) -> Result<()>

Source§

fn finish(self: Box<Self>) -> Result<()>

Implementors§