pub struct PatternMatcher { /* private fields */ }
Expand description
Combined pattern matcher that integrates glob and gitignore patterns
Implementations§
Source§impl PatternMatcher
impl PatternMatcher
Sourcepub fn new(options: MatcherOptions) -> Self
pub fn new(options: MatcherOptions) -> Self
Create a new pattern matcher
Sourcepub fn with_includes<I, S>(self, patterns: I) -> Result<Self>
pub fn with_includes<I, S>(self, patterns: I) -> Result<Self>
Create a pattern matcher with include patterns
Sourcepub fn with_excludes<I, S>(self, patterns: I) -> Result<Self>
pub fn with_excludes<I, S>(self, patterns: I) -> Result<Self>
Create a pattern matcher with exclude patterns
Sourcepub fn with_gitignore<P: AsRef<Path>>(self, base_path: P) -> Result<Self>
pub fn with_gitignore<P: AsRef<Path>>(self, base_path: P) -> Result<Self>
Create a pattern matcher with gitignore support
Sourcepub fn is_match<P: AsRef<Path>>(&mut self, path: P) -> Result<MatchResult>
pub fn is_match<P: AsRef<Path>>(&mut self, path: P) -> Result<MatchResult>
Check if a path matches the patterns
Sourcepub fn should_process<P: AsRef<Path>>(&mut self, path: P) -> Result<bool>
pub fn should_process<P: AsRef<Path>>(&mut self, path: P) -> Result<bool>
Check if a path should be processed (not excluded or ignored)
Sourcepub fn should_skip<P: AsRef<Path>>(&mut self, path: P) -> Result<bool>
pub fn should_skip<P: AsRef<Path>>(&mut self, path: P) -> Result<bool>
Check if a path should be skipped (excluded or ignored)
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the internal cache
Sourcepub fn cache_stats(&self) -> (u64, u64, f64)
pub fn cache_stats(&self) -> (u64, u64, f64)
Get cache statistics
Sourcepub fn pattern_count(&self) -> usize
pub fn pattern_count(&self) -> usize
Get the number of patterns
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PatternMatcher
impl RefUnwindSafe for PatternMatcher
impl Send for PatternMatcher
impl Sync for PatternMatcher
impl Unpin for PatternMatcher
impl UnwindSafe for PatternMatcher
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