pub struct ExtractOptions {
pub overwrite: OverwritePolicy,
pub path_safety: PathSafety,
pub link_policy: LinkPolicy,
pub limits: ResourceLimits,
pub threads: Threads,
pub preserve_metadata: PreserveMetadata,
pub password: Option<Password>,
pub progress: Option<Box<dyn ProgressReporter>>,
}Expand description
Options for extraction operations.
Fields§
§overwrite: OverwritePolicyPolicy for handling existing files.
path_safety: PathSafetyPath safety validation policy.
link_policy: LinkPolicySymbolic link handling policy.
limits: ResourceLimitsResource limits for extraction.
threads: ThreadsThread configuration.
preserve_metadata: PreserveMetadataMetadata preservation options.
password: Option<Password>Available on crate feature
aes only.Password for encrypted archives.
progress: Option<Box<dyn ProgressReporter>>Progress reporter for tracking extraction progress (optional).
Implementations§
Source§impl ExtractOptions
impl ExtractOptions
Sourcepub fn overwrite(self, policy: OverwritePolicy) -> Self
pub fn overwrite(self, policy: OverwritePolicy) -> Self
Sets the overwrite policy.
Sourcepub fn path_safety(self, policy: PathSafety) -> Self
pub fn path_safety(self, policy: PathSafety) -> Self
Sets the path safety policy.
Sourcepub fn link_policy(self, policy: LinkPolicy) -> Self
pub fn link_policy(self, policy: LinkPolicy) -> Self
Sets the link policy.
Sourcepub fn limits(self, limits: ResourceLimits) -> Self
pub fn limits(self, limits: ResourceLimits) -> Self
Sets the resource limits.
Sourcepub fn preserve_metadata(self, preserve: PreserveMetadata) -> Self
pub fn preserve_metadata(self, preserve: PreserveMetadata) -> Self
Sets the metadata preservation options.
Sourcepub fn password(self, password: impl Into<Password>) -> Self
Available on crate feature aes only.
pub fn password(self, password: impl Into<Password>) -> Self
aes only.Sets the password for encrypted archives.
Sourcepub fn progress(self, reporter: impl ProgressReporter + 'static) -> Self
pub fn progress(self, reporter: impl ProgressReporter + 'static) -> Self
Sets the progress reporter.
Sourcepub fn clone_settings(&self) -> Self
pub fn clone_settings(&self) -> Self
Clones all settings except the progress reporter.
This is useful when you need to extract multiple archives with the same settings but can’t clone the options due to the non-Clone progress reporter.
§Example
ⓘ
use zesven::read::{ExtractOptions, OverwritePolicy};
let base = ExtractOptions::new().overwrite(OverwritePolicy::Skip);
archive1.extract(dest1, (), &base.clone_settings())?;
archive2.extract(dest2, (), &base.clone_settings())?;Trait Implementations§
Source§impl Debug for ExtractOptions
impl Debug for ExtractOptions
Source§impl Default for ExtractOptions
impl Default for ExtractOptions
Source§fn default() -> ExtractOptions
fn default() -> ExtractOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ExtractOptions
impl !Sync for ExtractOptions
impl !UnwindSafe for ExtractOptions
impl Freeze for ExtractOptions
impl Send for ExtractOptions
impl Unpin for ExtractOptions
impl UnsafeUnpin for ExtractOptions
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more