pub struct GitignoreMatcher { /* private fields */ }Expand description
Gitignore pattern matcher with full syntax support
Implementations§
Source§impl GitignoreMatcher
impl GitignoreMatcher
Sourcepub fn new() -> GitignoreMatcher
pub fn new() -> GitignoreMatcher
Create a new gitignore matcher
Sourcepub fn case_insensitive() -> GitignoreMatcher
pub fn case_insensitive() -> GitignoreMatcher
Create a case-insensitive matcher
Sourcepub fn add_pattern(&mut self, pattern: &str) -> Result<(), ScribeError>
pub fn add_pattern(&mut self, pattern: &str) -> Result<(), ScribeError>
Add a gitignore pattern directly
Sourcepub fn add_patterns<I, S>(&mut self, patterns: I) -> Result<(), ScribeError>
pub fn add_patterns<I, S>(&mut self, patterns: I) -> Result<(), ScribeError>
Add multiple patterns
Sourcepub fn add_gitignore_file<P>(&mut self, path: P) -> Result<(), ScribeError>
pub fn add_gitignore_file<P>(&mut self, path: P) -> Result<(), ScribeError>
Load patterns from a gitignore file
Sourcepub fn add_gitignore_files<P, I>(&mut self, paths: I) -> Result<(), ScribeError>
pub fn add_gitignore_files<P, I>(&mut self, paths: I) -> Result<(), ScribeError>
Load patterns from multiple gitignore files
Sourcepub fn is_ignored<P>(&mut self, path: P) -> Result<bool, ScribeError>
pub fn is_ignored<P>(&mut self, path: P) -> Result<bool, ScribeError>
Check if a path should be ignored
Sourcepub fn match_path<P>(
&mut self,
path: P,
) -> Result<IgnoreMatchResult, ScribeError>
pub fn match_path<P>( &mut self, path: P, ) -> Result<IgnoreMatchResult, ScribeError>
Get detailed match information for a path
Sourcepub fn filter_paths<P>(&mut self, paths: &[P]) -> Result<Vec<P>, ScribeError>
pub fn filter_paths<P>(&mut self, paths: &[P]) -> Result<Vec<P>, ScribeError>
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>(root: P) -> Result<Vec<PathBuf>, ScribeError>
pub fn discover_gitignore_files<P>(root: P) -> Result<Vec<PathBuf>, ScribeError>
Find gitignore files in a directory tree
Sourcepub fn from_directory<P>(root: P) -> Result<GitignoreMatcher, ScribeError>
pub fn from_directory<P>(root: P) -> Result<GitignoreMatcher, ScribeError>
Load all gitignore files from a directory tree
Sourcepub fn with_defaults() -> GitignoreMatcher
pub fn with_defaults() -> GitignoreMatcher
Create a matcher with commonly ignored patterns
Trait Implementations§
Source§impl Debug for GitignoreMatcher
impl Debug for GitignoreMatcher
Source§impl Default for GitignoreMatcher
impl Default for GitignoreMatcher
Source§fn default() -> GitignoreMatcher
fn default() -> GitignoreMatcher
Returns the “default value” for a type. Read more
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more