pub trait PathMatched {
// Required methods
fn path_patterns(&self) -> Option<&[String]>;
fn matches_path(&self, path: &Path) -> bool;
// Provided method
fn is_global(&self) -> bool { ... }
}Expand description
Trait for index entries that support path-based filtering.
Implementors can specify glob patterns that determine which files the entry applies to. Entries without patterns match all files.
Required Methods§
Sourcefn path_patterns(&self) -> Option<&[String]>
fn path_patterns(&self) -> Option<&[String]>
Get the path patterns this entry matches.
Returns None if this is a global entry that matches all files.
Returns Some(&[]) if patterns were explicitly set to empty (matches nothing).
Sourcefn matches_path(&self, path: &Path) -> bool
fn matches_path(&self, path: &Path) -> bool
Check if this entry matches the given file path.
Default behavior:
- No patterns (
None) → matches all files - Empty patterns → matches no files
- Has patterns → matches if any pattern matches