pub struct PaxDecodePolicy { /* private fields */ }Expand description
Controls pax compatibility and the feature subset member decoding may accept.
See each allow API for its default.
Implementations§
Source§impl PaxDecodePolicy
impl PaxDecodePolicy
Sourcepub fn max_extension_size(self, max_extension_size: u64) -> Self
pub fn max_extension_size(self, max_extension_size: u64) -> Self
Configures the maximum payload size in bytes accepted for one pax extension.
The limit applies independently to each local or global extension and covers all records in that extension. An extension that declares a larger payload is rejected before its payload is consumed.
The default is DEFAULT_MAX_PAX_EXTENSION_SIZE. Setting the limit to
zero rejects every nonempty pax extension. Setting it to u64::MAX
removes the limit for each extension. Each global extension still counts
toward the limit for the full archive.
Sourcepub fn max_global_extensions_size(self, max_global_extensions_size: u64) -> Self
pub fn max_global_extensions_size(self, max_global_extensions_size: u64) -> Self
Sets the maximum total payload size of all global pax extensions.
This limit applies to the full archive. It does not reset after an ordinary member.
The default is DEFAULT_MAX_GLOBAL_PAX_EXTENSIONS_SIZE. A value of zero
rejects each nonempty global extension. A value of u64::MAX removes
this limit. The separate limit for each extension still applies.
Sourcepub fn allow_non_utf8_pax_vendor_values(self, allow: bool) -> Self
pub fn allow_non_utf8_pax_vendor_values(self, allow: bool) -> Self
Configures whether vendor-namespaced pax record values may contain non-UTF-8 bytes.
This compatibility option is enabled by default to accommodate raw extensions incorrectly emitted by other real-world writers. Disabling it requires every vendor record value to be valid UTF-8. Vendor values remain exposed as opaque bytes in either mode.
Self::vendor_extension_policy separately controls whether decoding
may ignore vendor records after they have been parsed.
Sourcepub fn allow_global_pax_extensions(self, allow: bool) -> Self
pub fn allow_global_pax_extensions(self, allow: bool) -> Self
Configures whether global pax extension headers may be accepted.
When enabled, Self::allow_global_pax_member_metadata separately
controls whether global path, linkpath, and size records are
accepted. Trailing global headers without a following ordinary member
are consumed and ignored before policy checks.
Global pax extension headers are allowed by default.
Sourcepub fn vendor_extension_policy(self, policy: PaxVendorExtensionPolicy) -> Self
pub fn vendor_extension_policy(self, policy: PaxVendorExtensionPolicy) -> Self
Configures which unknown vendor-namespaced pax records may be ignored.
PaxVendorExtensionPolicy::Ignore accepts every record under its
explicitly listed vendor namespaces, while
PaxVendorExtensionPolicy::AllowUnknown accepts every
vendor-namespaced record. Accepted values are parsed structurally, but
their semantics are not interpreted.
This can produce output that differs from the archive’s intended
contents. For example, GNU.sparse.* records can change a member’s
effective name, logical size, and mapping from stored payload bytes to
file contents; these semantics are ignored when this option is enabled.
IMPORTANT: Only permit records whose ignored semantics are acceptable. Unknown vendor-namespaced pax records are forbidden by default.
Sourcepub fn allow_duplicate_pax_records(self, allow: bool) -> Self
pub fn allow_duplicate_pax_records(self, allow: bool) -> Self
Configures whether one pax extended header may repeat a keyword.
When enabled, standard pax precedence applies and the last record for a repeated keyword takes effect.
Duplicated pax records within a single header are forbidden by default.
Sourcepub fn allow_global_pax_member_metadata(self, allow: bool) -> Self
pub fn allow_global_pax_member_metadata(self, allow: bool) -> Self
Configures whether global pax headers may set member path or size data.
When enabled, standard pax semantics permit global path, linkpath,
and size records to apply to following members until overridden.
Member metadata within global pax headers is forbidden by default, as it is extremely differential-prone.