pub struct ZipFileBuilder<'archive, 'name, W> { /* private fields */ }
Expand description
A builder for creating a new file entry in a ZIP archive.
Implementations§
Source§impl<'archive, W> ZipFileBuilder<'archive, '_, W>where
W: Write,
impl<'archive, W> ZipFileBuilder<'archive, '_, W>where
W: Write,
Sourcepub fn compression_method(self, compression_method: CompressionMethod) -> Self
pub fn compression_method(self, compression_method: CompressionMethod) -> Self
Sets the compression method for the file entry.
Sourcepub fn last_modified(self, modification_time: UtcDateTime) -> Self
pub fn last_modified(self, modification_time: UtcDateTime) -> Self
Sets the modification time for the file entry.
Only accepts UTC timestamps to ensure Extended Timestamp fields are written correctly.
Sourcepub fn unix_permissions(self, permissions: u32) -> Self
pub fn unix_permissions(self, permissions: u32) -> Self
Sets the Unix permissions for the file entry.
Accepts either:
- Basic permission bits (e.g., 0o644 for rw-r–r–, 0o755 for rwxr-xr-x)
- Full Unix mode including file type (e.g., 0o100644 for regular file, 0o040755 for directory)
- Special permission bits are preserved (SUID: 0o4000, SGID: 0o2000, sticky: 0o1000)
When set, the archive will be created with Unix-compatible “version made by” field to ensure proper interpretation of the permissions by zip readers.
Sourcepub fn create(self) -> Result<ZipEntryWriter<'archive, W>, Error>
pub fn create(self) -> Result<ZipEntryWriter<'archive, W>, Error>
Creates the file entry and returns a writer for the file’s content.
Trait Implementations§
Auto Trait Implementations§
impl<'archive, 'name, W> Freeze for ZipFileBuilder<'archive, 'name, W>
impl<'archive, 'name, W> RefUnwindSafe for ZipFileBuilder<'archive, 'name, W>where
W: RefUnwindSafe,
impl<'archive, 'name, W> Send for ZipFileBuilder<'archive, 'name, W>where
W: Send,
impl<'archive, 'name, W> Sync for ZipFileBuilder<'archive, 'name, W>where
W: Sync,
impl<'archive, 'name, W> Unpin for ZipFileBuilder<'archive, 'name, W>
impl<'archive, 'name, W> !UnwindSafe for ZipFileBuilder<'archive, 'name, 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