Skip to main content

CreationConfigFields

Struct CreationConfigFields 

Source
#[non_exhaustive]
pub struct CreationConfigFields { pub follow_symlinks: bool, pub include_hidden: bool, pub max_file_size: Option<u64>, pub exclude_patterns: Vec<String>, pub strip_prefix: Option<PathBuf>, pub compression_level: Option<u8>, pub preserve_permissions: bool, pub format: Option<ArchiveType>, }
Expand description

The field data of a CreationConfig, reachable via Deref/DerefMut regardless of (or gated by) validation state.

Mirrors SecurityConfigFields: a plain #[non_exhaustive] data bag that blocks external struct-literal forging, while CreationConfig’s own private fields member blocks re-wrapping a mutated bag into a Validated config. See that type’s docs for the full rationale — the same sealing boundary applies here.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§follow_symlinks: bool

Follow symlinks when adding files to archive.

Default: false (store symlinks as symlinks).

Security note: Following symlinks may include unintended files from outside the source directory.

§include_hidden: bool

Include hidden files (files starting with ‘.’).

Default: false (skip hidden files).

§max_file_size: Option<u64>

Maximum size for a single file in bytes.

Files larger than this limit will be skipped. None means no limit.

Default: None.

§exclude_patterns: Vec<String>

Patterns to exclude from the archive.

Files matching these patterns will be skipped.

Default: [".git", ".DS_Store", "*.tmp"].

§strip_prefix: Option<PathBuf>

Prefix to strip from entry paths in the archive.

If set, this prefix will be removed from all entry paths. Useful for creating archives without deep directory nesting.

Default: None.

§compression_level: Option<u8>

Compression level (1-9).

Higher values provide better compression but slower speed. None uses format-specific defaults.

Default: Some(6) (balanced).

Valid range: 1 (fastest) to 9 (best compression).

§preserve_permissions: bool

Preserve file permissions in the archive.

Default: true.

§format: Option<ArchiveType>

Archive format to create.

None means auto-detect from output file extension.

Default: None.

Trait Implementations§

Source§

impl Clone for CreationConfigFields

Source§

fn clone(&self) -> CreationConfigFields

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CreationConfigFields

Source§

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

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

impl Default for CreationConfigFields

Source§

fn default() -> Self

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.