pub struct IndexPolicy { /* private fields */ }Expand description
Controls resource limits and compatibility when indexing a ZIP archive.
Implementations§
Source§impl IndexPolicy
impl IndexPolicy
Sourcepub fn extra_field_policy(self, policy: ExtraFieldPolicy) -> Self
pub fn extra_field_policy(self, policy: ExtraFieldPolicy) -> Self
Sets the extra fields accepted in both headers. Defaults to ExtraFieldPolicy::Zip64Only.
Sourcepub fn comment_policy(self, policy: CommentPolicy) -> Self
pub fn comment_policy(self, policy: CommentPolicy) -> Self
Sets the rules for member and archive comments.
Sourcepub fn allow_redundant_zip64_sizes(self, allow: bool) -> Self
pub fn allow_redundant_zip64_sizes(self, allow: bool) -> Self
Allows a local ZIP64 extra that repeats both 32-bit sizes on a member without a data descriptor. Disabled by default.
Older CPython versions wrote these extras with force_zip64 even
when the extraction version was below 4.5. Both sizes must match
exactly.
Sourcepub fn allow_stored_data_descriptors(self, allow: bool) -> Self
pub fn allow_stored_data_descriptors(self, allow: bool) -> Self
Allows Stored members with data descriptors (bit 3). Disabled by default.
Sourcepub fn allow_empty_deflate_streams(self, allow: bool) -> Self
pub fn allow_empty_deflate_streams(self, allow: bool) -> Self
Allows empty DEFLATE streams. Enabled by default.
Disable to require zero compressed bytes for empty DEFLATE members under APPNOTE §4.3.8.
Sourcepub fn allow_incompatible_extraction_versions(self, allow: bool) -> Self
pub fn allow_incompatible_extraction_versions(self, allow: bool) -> Self
Allows local and central member headers to declare an extraction version below the minimum for their compression method, ZIP64 fields, or member kind (APPNOTE 4.4.3.2). Disabled by default. Versions above 4.5 remain unsupported.
Info-ZIP 3.0 can declare version 1.0 for directories, which require 2.0.
Go’s zip.Writer.CreateRaw
can write version 0 if the caller leaves FileHeader.ReaderVersion unset.
Sourcepub fn allow_ambiguous_symlink_modes(self, allow: bool) -> Self
pub fn allow_ambiguous_symlink_modes(self, allow: bool) -> Self
Allows Unix symlink mode bits from non-Unix creator systems. Disabled by default. When enabled, Darwin uses Unix modes. Other creators use their usual attributes.
Sourcepub fn allow_backslashes(self, allow: bool) -> Self
pub fn allow_backslashes(self, allow: bool) -> Self
Allows literal backslashes in member names. Disabled by default.
Member names are returned verbatim. Only / is a path separator.