pub struct StoredZipWriter<W: Write> { /* private fields */ }Expand description
Writes a stored ZIP archive to W. Add entries, then finish. Nothing is
flushed or synced: wrap a file in [crate::AtomicWriter] (or write the finished bytes with
[crate::atomic_write]) when the archive must appear whole.
Implementations§
Source§impl<W: Write> StoredZipWriter<W>
impl<W: Write> StoredZipWriter<W>
Sourcepub fn new(out: W) -> Self
pub fn new(out: W) -> Self
A writer that appends to out from its current position (the archive starts there).
Sourcepub fn add_file(&mut self, name: &str, data: &[u8]) -> Result<()>
pub fn add_file(&mut self, name: &str, data: &[u8]) -> Result<()>
Add a file entry holding data.
Errors (InvalidInput): a bad or duplicate name, data of 4 GiB or more, an archive past the
ZIP limits, or a local-header offset past 4 GiB. A failed write is the writer’s error.
Auto Trait Implementations§
impl<W> Freeze for StoredZipWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for StoredZipWriter<W>where
W: RefUnwindSafe,
impl<W> Send for StoredZipWriter<W>where
W: Send,
impl<W> Sync for StoredZipWriter<W>where
W: Sync,
impl<W> Unpin for StoredZipWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for StoredZipWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for StoredZipWriter<W>where
W: UnwindSafe,
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