Skip to main content

AffectedBy

Trait AffectedBy 

Source
pub trait AffectedBy {
    // Required methods
    fn is_affected_by(
        &self,
        changed_files: &[PathBuf],
        project_root: &Path,
    ) -> bool;
    fn input_patterns(&self) -> Vec<&str>;
}
Expand description

Trait for types that can determine if they are affected by file changes.

Implement this trait on task types to enable affected detection in CI pipelines and incremental builds.

Required Methods§

Source

fn is_affected_by(&self, changed_files: &[PathBuf], project_root: &Path) -> bool

Returns true if this item is affected by the given file changes.

§Arguments
  • changed_files - Paths of files that have changed (typically repo-relative)
  • project_root - Root path of the project containing this item
§Returns

true if the item should be considered affected and needs to run

Source

fn input_patterns(&self) -> Vec<&str>

Returns the input patterns that determine what affects this item.

Used for debugging and reporting which patterns matched.

Implementors§