pub struct LinkPolicy { /* private fields */ }Expand description
Controls how symbolic- and hard-link members are extracted.
By default, symbolic links are preserved as native links, including links to pre-existing entries and missing targets. Resolving a preserved link must stay within the extraction root. Hard links require explicit opt-in.
Extraction limits preserved symbolic links to 8 MiB per archive across their records, paths, original targets, and normalized targets. Each link counts toward the limit even if a later member overwrites it.
Implementations§
Source§impl LinkPolicy
impl LinkPolicy
Sourcepub fn symlink_policy(self, policy: SymlinkPolicy) -> LinkPolicy
pub fn symlink_policy(self, policy: SymlinkPolicy) -> LinkPolicy
Configures how symbolic-link members are handled during extraction.
Symbolic links are preserved by default. Platforms without native
symbolic-link creation require SymlinkPolicy::Skip or
SymlinkPolicy::Reject.
Sourcepub fn allow_hard_links(self, allow: bool) -> LinkPolicy
pub fn allow_hard_links(self, allow: bool) -> LinkPolicy
Configures whether hard-link members may be extracted.
Hard links are forbidden by default because they are uncommon, difficult to extract consistently, and prone to implementation differentials. Enable them only for trusted archives.
Sourcepub fn allow_missing_targets(self, allow: bool) -> LinkPolicy
pub fn allow_missing_targets(self, allow: bool) -> LinkPolicy
Configures whether symbolic links to missing targets may be extracted.
Missing symbolic-link targets are allowed by default. This does not affect hard-link validation.
Trait Implementations§
Source§impl Clone for LinkPolicy
impl Clone for LinkPolicy
Source§fn clone(&self) -> LinkPolicy
fn clone(&self) -> LinkPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more