#[non_exhaustive]pub struct ExtractionOptions {
pub atomic: bool,
pub skip_duplicates: bool,
pub decode_reuse: DecodeReuse,
}Expand description
Options controlling extraction behavior (non-security).
Separate from SecurityConfig to keep security settings focused.
These options control operational behavior like atomicity.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.atomic: boolExtract atomically: use a temp dir in the same parent as the output directory, rename on success, and delete on failure.
When enabled, extraction is all-or-nothing: if extraction fails, the output directory will not be created. This prevents partial extraction artifacts from remaining on disk.
Note: cleanup is best-effort if the process is terminated via SIGKILL.
skip_duplicates: boolSkip duplicate entries silently instead of aborting.
When true (default), if an archive contains two entries with the same
destination path, the second entry is skipped and a warning is recorded
in ExtractionReport. When false, duplicate entries cause an error.
decode_reuse: DecodeReuseWhere a ZIP extraction keeps the output its structural check already decoded, so deflate entries are decoded once instead of twice.
Defaults to DecodeReuse::Memory with ReuseLimit::DEFAULT. Only
extractions that write into a directory use it; see DecodeReuse.
Implementations§
Source§impl ExtractionOptions
impl ExtractionOptions
Sourcepub fn with_atomic(self, atomic: bool) -> Self
pub fn with_atomic(self, atomic: bool) -> Self
Enables or disables atomic extraction.
When enabled, extraction is all-or-nothing: the output directory is not created if extraction fails.
§Examples
use exarch_core::ExtractionOptions;
let opts = ExtractionOptions::default().with_atomic(true);
assert!(opts.atomic);Sourcepub fn with_skip_duplicates(self, skip: bool) -> Self
pub fn with_skip_duplicates(self, skip: bool) -> Self
Enables or disables skipping duplicate entries silently.
§Examples
use exarch_core::ExtractionOptions;
let opts = ExtractionOptions::default().with_skip_duplicates(false);
assert!(!opts.skip_duplicates);Sourcepub const fn with_decode_reuse(self, reuse: DecodeReuse) -> Self
pub const fn with_decode_reuse(self, reuse: DecodeReuse) -> Self
Chooses where ZIP extraction keeps the census output for reuse.
§Examples
use exarch_core::DecodeReuse;
use exarch_core::ExtractionOptions;
let opts = ExtractionOptions::default().with_decode_reuse(DecodeReuse::Off);
assert_eq!(opts.decode_reuse, DecodeReuse::Off);Trait Implementations§
Source§impl Clone for ExtractionOptions
impl Clone for ExtractionOptions
Source§impl Debug for ExtractionOptions
impl Debug for ExtractionOptions
Source§impl Default for ExtractionOptions
impl Default for ExtractionOptions
Source§impl TryFrom<&ExtractionOptions> for SinkOptions
impl TryFrom<&ExtractionOptions> for SinkOptions
Source§fn try_from(options: &ExtractionOptions) -> Result<Self>
fn try_from(options: &ExtractionOptions) -> Result<Self>
Carries the duplicate policy over from path-based options.
§Errors
Returns ArchiveError::InvalidConfiguration for atomic, which needs
a directory to rename.