Skip to main content

ExtractOptions

Struct ExtractOptions 

Source
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: OverwritePolicy

Policy for handling existing files.

§path_safety: PathSafety

Path safety validation policy.

§link_policy: LinkPolicy

Symbolic link handling policy.

§limits: ResourceLimits

Resource limits for extraction.

§threads: Threads

Thread configuration.

§preserve_metadata: PreserveMetadata

Metadata 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

Source

pub fn new() -> Self

Creates extraction options with default settings.

Source

pub fn overwrite(self, policy: OverwritePolicy) -> Self

Sets the overwrite policy.

Source

pub fn path_safety(self, policy: PathSafety) -> Self

Sets the path safety policy.

Sets the link policy.

Source

pub fn limits(self, limits: ResourceLimits) -> Self

Sets the resource limits.

Source

pub fn threads(self, threads: Threads) -> Self

Sets the thread configuration.

Source

pub fn preserve_metadata(self, preserve: PreserveMetadata) -> Self

Sets the metadata preservation options.

Source

pub fn password(self, password: impl Into<Password>) -> Self

Available on crate feature aes only.

Sets the password for encrypted archives.

Source

pub fn progress(self, reporter: impl ProgressReporter + 'static) -> Self

Sets the progress reporter.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExtractOptions

Source§

fn default() -> ExtractOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.