pub struct GlobMatcher { /* private fields */ }
Expand description
High-performance glob pattern matcher with compilation caching
Implementations§
Source§impl GlobMatcher
impl GlobMatcher
Sourcepub fn with_options(options: GlobOptions) -> Self
pub fn with_options(options: GlobOptions) -> Self
Create a new glob matcher with specific options
Sourcepub fn add_pattern(&mut self, pattern: &str) -> Result<()>
pub fn add_pattern(&mut self, pattern: &str) -> Result<()>
Add a glob pattern to the matcher
Sourcepub fn add_patterns<I, S>(&mut self, patterns: I) -> Result<()>
pub fn add_patterns<I, S>(&mut self, patterns: I) -> Result<()>
Add multiple glob patterns
Sourcepub fn add_patterns_csv(&mut self, csv: &str) -> Result<()>
pub fn add_patterns_csv(&mut self, csv: &str) -> Result<()>
Add patterns from comma-separated string
Sourcepub fn matches<P: AsRef<Path>>(&mut self, path: P) -> Result<bool>
pub fn matches<P: AsRef<Path>>(&mut self, path: P) -> Result<bool>
Check if any pattern matches the given path
Sourcepub fn match_with_details<P: AsRef<Path>>(
&mut self,
path: P,
) -> Result<GlobMatchResult>
pub fn match_with_details<P: AsRef<Path>>( &mut self, path: P, ) -> Result<GlobMatchResult>
Get detailed match information
Sourcepub fn pattern_count(&self) -> usize
pub fn pattern_count(&self) -> usize
Get the number of patterns
Sourcepub fn patterns(&self) -> &[GlobPattern]
pub fn patterns(&self) -> &[GlobPattern]
Get all patterns
Sourcepub fn cache_stats(&self) -> (u64, u64, usize)
pub fn cache_stats(&self) -> (u64, u64, usize)
Get cache statistics
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the cache
Sourcepub fn is_compiled(&self) -> bool
pub fn is_compiled(&self) -> bool
Check if patterns are compiled
Sourcepub fn cache_hit_ratio(&self) -> f64
pub fn cache_hit_ratio(&self) -> f64
Get cache hit ratio
Sourcepub fn match_all<P: AsRef<Path>>(&mut self, path: P) -> Result<Vec<usize>>
pub fn match_all<P: AsRef<Path>>(&mut self, path: P) -> Result<Vec<usize>>
Test all patterns against a path and return all matches
Sourcepub fn set_cache_enabled(&mut self, enabled: bool)
pub fn set_cache_enabled(&mut self, enabled: bool)
Enable or disable caching
Sourcepub fn set_cache_size_limit(&mut self, limit: usize)
pub fn set_cache_size_limit(&mut self, limit: usize)
Set cache size limit
Source§impl GlobMatcher
Convenience functions for common glob operations
impl GlobMatcher
Convenience functions for common glob operations
Sourcepub fn for_extensions(extensions: &[&str]) -> Result<Self>
pub fn for_extensions(extensions: &[&str]) -> Result<Self>
Create a matcher for specific file extensions
Sourcepub fn for_directories(directories: &[&str]) -> Result<Self>
pub fn for_directories(directories: &[&str]) -> Result<Self>
Create a matcher for files in specific directories
Sourcepub fn case_insensitive() -> Self
pub fn case_insensitive() -> Self
Create a case-insensitive matcher
Trait Implementations§
Source§impl Debug for GlobMatcher
impl Debug for GlobMatcher
Auto Trait Implementations§
impl Freeze for GlobMatcher
impl RefUnwindSafe for GlobMatcher
impl Send for GlobMatcher
impl Sync for GlobMatcher
impl Unpin for GlobMatcher
impl UnwindSafe for GlobMatcher
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