pub struct PackRules {
pub custom_secret_count: usize,
pub custom_keep_count: usize,
pub custom_cache_count: usize,
/* private fields */
}Expand description
Compiled classification rules used by the scan.
Fields§
§custom_secret_count: usizeHow many of the compiled patterns came from the operator, for reporting.
custom_keep_count: usizeHow many keep patterns came from the operator, for reporting.
custom_cache_count: usizeHow many cache directory names came from the operator, for reporting.
Implementations§
Source§impl PackRules
impl PackRules
Sourcepub fn new(overrides: &RuleOverrides) -> Result<Self, PackError>
pub fn new(overrides: &RuleOverrides) -> Result<Self, PackError>
Compile the built-in rules plus the operator’s additions.
§Arguments
overrides— Extra globs and directory names from[pack].
§Returns
Rules ready to classify file names.
§Errors
PackError::BadPattern when an operator-supplied glob is malformed,
naming the offending pattern. A typo in config must fail loudly rather
than silently classifying nothing.
Sourcepub fn is_cache_dir(&self, name: &str) -> bool
pub fn is_cache_dir(&self, name: &str) -> bool
Whether a directory name is a regenerable cache.
Sourcepub fn secret_reason(&self, name: &str) -> Option<String>
pub fn secret_reason(&self, name: &str) -> Option<String>
Sourcepub fn secret_pattern_count(&self) -> usize
pub fn secret_pattern_count(&self) -> usize
Total number of secret patterns in force.
Sourcepub fn is_customized(&self) -> bool
pub fn is_customized(&self) -> bool
Whether the operator customized anything.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PackRules
impl RefUnwindSafe for PackRules
impl Send for PackRules
impl Sync for PackRules
impl Unpin for PackRules
impl UnsafeUnpin for PackRules
impl UnwindSafe for PackRules
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