pub struct ZipEntryBuilder(/* private fields */);Expand description
A builder for ZipEntry.
Implementations§
Source§impl ZipEntryBuilder
impl ZipEntryBuilder
Sourcepub fn new(filename: ZipString, compression: Compression) -> Self
pub fn new(filename: ZipString, compression: Compression) -> Self
Constructs a new builder which defines the raw underlying data of a ZIP entry.
A filename and compression method are needed to construct the builder as minimal parameters.
Sourcepub fn compression(self, compression: Compression) -> Self
pub fn compression(self, compression: Compression) -> Self
Sets the entry’s compression method.
Sourcepub fn size<N: Into<u64>, M: Into<u64>>(
self,
compressed_size: N,
uncompressed_size: M,
) -> Self
pub fn size<N: Into<u64>, M: Into<u64>>( self, compressed_size: N, uncompressed_size: M, ) -> Self
Set a size hint for the file, to be written into the local file header. Unlikely to be useful except for the case of streaming files to be Store’d. This size hint does not affect the central directory, nor does it affect whole files.
Sourcepub fn deflate_option(self, option: DeflateOption) -> Self
Available on crate features bzip2 or deflate or lzma or xz or zstd only.
pub fn deflate_option(self, option: DeflateOption) -> Self
bzip2 or deflate or lzma or xz or zstd only.Set the deflate compression option.
If the compression type isn’t deflate, this option has no effect.
Sourcepub fn attribute_compatibility(
self,
compatibility: AttributeCompatibility,
) -> Self
pub fn attribute_compatibility( self, compatibility: AttributeCompatibility, ) -> Self
Sets the entry’s attribute host compatibility.
Sourcepub fn last_modification_date(self, date: ZipDateTime) -> Self
pub fn last_modification_date(self, date: ZipDateTime) -> Self
Sets the entry’s last modification date.
Sourcepub fn internal_file_attribute(self, attribute: u16) -> Self
pub fn internal_file_attribute(self, attribute: u16) -> Self
Sets the entry’s internal file attribute.
Sourcepub fn external_file_attribute(self, attribute: u32) -> Self
pub fn external_file_attribute(self, attribute: u32) -> Self
Sets the entry’s external file attribute.
Sourcepub fn extra_fields(self, field: Vec<ExtraField>) -> Self
pub fn extra_fields(self, field: Vec<ExtraField>) -> Self
Sets the entry’s extra field data.
Sourcepub fn unix_permissions(self, mode: u16) -> Self
pub fn unix_permissions(self, mode: u16) -> Self
Sets the entry’s Unix permissions mode.
If the attribute host compatibility isn’t set to Unix, this will have no effect.