PathMatched

Trait PathMatched 

Source
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§

Source

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).

Source

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

Provided Methods§

Source

fn is_global(&self) -> bool

Check if this is a global entry (matches all files).

Implementors§