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 missing targets. Hard links and ambient symbolic-link targets require explicit opt-in.
Implementations§
Source§impl LinkPolicy
impl LinkPolicy
Sourcepub fn symlink_policy(self, policy: SymlinkPolicy) -> Self
pub fn symlink_policy(self, policy: SymlinkPolicy) -> Self
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) -> Self
pub fn allow_hard_links(self, allow: bool) -> Self
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_ambient_targets(self, allow: bool) -> Self
pub fn allow_ambient_targets(self, allow: bool) -> Self
Configures whether pre-existing symbolic-link targets may be used.
Existing symbolic links are followed only when capability-relative resolution remains beneath the extraction root. Ambient targets are forbidden by default. This does not affect hard-link validation.
Sourcepub fn allow_missing_targets(self, allow: bool) -> Self
pub fn allow_missing_targets(self, allow: bool) -> Self
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 moreimpl Copy for LinkPolicy
Source§impl Debug for LinkPolicy
impl Debug for LinkPolicy
Source§impl Default for LinkPolicy
impl Default for LinkPolicy
impl Eq for LinkPolicy
Source§impl PartialEq for LinkPolicy
impl PartialEq for LinkPolicy
Source§fn eq(&self, other: &LinkPolicy) -> bool
fn eq(&self, other: &LinkPolicy) -> bool
self and other values to be equal, and is used by ==.