pub struct CompiledPolicy {
pub hidden_file_policy: HiddenFilePolicy,
pub symlink_policy: SymlinkPolicy,
pub max_file_size_bytes: Option<u64>,
/* private fields */
}Expand description
A source policy compiled for fast per-entry checks.
Fields§
§symlink_policy: SymlinkPolicy§max_file_size_bytes: Option<u64>Implementations§
Source§impl CompiledPolicy
impl CompiledPolicy
Sourcepub fn from_source(source: &SourceRecord) -> Self
pub fn from_source(source: &SourceRecord) -> Self
Compile from a catalog source record. The default excludes are always active in addition to user excludes.
Sourcepub fn component_excluded(&self, name: &str) -> bool
pub fn component_excluded(&self, name: &str) -> bool
Whether a directory or file component is excluded by name.
Whether a component is hidden (dotfile convention).
Sourcepub fn file_included(&self, file_name: &str) -> bool
pub fn file_included(&self, file_name: &str) -> bool
Whether a file name passes the include/exclude pattern rules.
Sourcepub fn size_allowed(&self, size: u64) -> bool
pub fn size_allowed(&self, size: u64) -> bool
Whether a file size is within the policy limit.
Trait Implementations§
Source§impl Clone for CompiledPolicy
impl Clone for CompiledPolicy
Source§fn clone(&self) -> CompiledPolicy
fn clone(&self) -> CompiledPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompiledPolicy
impl RefUnwindSafe for CompiledPolicy
impl Send for CompiledPolicy
impl Sync for CompiledPolicy
impl Unpin for CompiledPolicy
impl UnsafeUnpin for CompiledPolicy
impl UnwindSafe for CompiledPolicy
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