pub struct GitignoreMatcher { /* private fields */ }
Expand description
Gitignore pattern matcher with full syntax support
Implementations§
Source§impl GitignoreMatcher
impl GitignoreMatcher
Sourcepub fn case_insensitive() -> Self
pub fn case_insensitive() -> Self
Create a case-insensitive matcher
Sourcepub fn add_pattern(&mut self, pattern: &str) -> Result<()>
pub fn add_pattern(&mut self, pattern: &str) -> Result<()>
Add a gitignore pattern directly
Sourcepub fn add_patterns<I, S>(&mut self, patterns: I) -> Result<()>
pub fn add_patterns<I, S>(&mut self, patterns: I) -> Result<()>
Add multiple patterns
Sourcepub fn add_gitignore_file<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
pub fn add_gitignore_file<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
Load patterns from a gitignore file
Sourcepub fn add_gitignore_files<P, I>(&mut self, paths: I) -> Result<()>
pub fn add_gitignore_files<P, I>(&mut self, paths: I) -> Result<()>
Load patterns from multiple gitignore files
Sourcepub fn is_ignored<P: AsRef<Path>>(&mut self, path: P) -> Result<bool>
pub fn is_ignored<P: AsRef<Path>>(&mut self, path: P) -> Result<bool>
Check if a path should be ignored
Sourcepub fn match_path<P: AsRef<Path>>(
&mut self,
path: P,
) -> Result<IgnoreMatchResult>
pub fn match_path<P: AsRef<Path>>( &mut self, path: P, ) -> Result<IgnoreMatchResult>
Get detailed match information for a path
Sourcepub fn filter_paths<P>(&mut self, paths: &[P]) -> Result<Vec<P>>
pub fn filter_paths<P>(&mut self, paths: &[P]) -> Result<Vec<P>>
Check multiple paths efficiently using ignore crate integration
Sourcepub fn ignore_files(&self) -> &[IgnoreFile]
pub fn ignore_files(&self) -> &[IgnoreFile]
Get all loaded ignore files
Sourcepub fn patterns(&self) -> &[GitignorePattern]
pub fn patterns(&self) -> &[GitignorePattern]
Get all patterns
Sourcepub fn stats(&self) -> GitignoreStats
pub fn stats(&self) -> GitignoreStats
Get statistics about loaded patterns
Sourcepub fn discover_gitignore_files<P: AsRef<Path>>(root: P) -> Result<Vec<PathBuf>>
pub fn discover_gitignore_files<P: AsRef<Path>>(root: P) -> Result<Vec<PathBuf>>
Find gitignore files in a directory tree
Sourcepub fn from_directory<P: AsRef<Path>>(root: P) -> Result<Self>
pub fn from_directory<P: AsRef<Path>>(root: P) -> Result<Self>
Load all gitignore files from a directory tree
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a matcher with commonly ignored patterns
Trait Implementations§
Source§impl Debug for GitignoreMatcher
impl Debug for GitignoreMatcher
Auto Trait Implementations§
impl Freeze for GitignoreMatcher
impl RefUnwindSafe for GitignoreMatcher
impl Send for GitignoreMatcher
impl Sync for GitignoreMatcher
impl Unpin for GitignoreMatcher
impl UnwindSafe for GitignoreMatcher
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