changepacks_core/
proejct_finder.rs

1use std::path::Path;
2
3use crate::project::Project;
4use anyhow::Result;
5use async_trait::async_trait;
6
7#[async_trait]
8pub trait ProjectFinder: std::fmt::Debug + Send + Sync {
9    fn projects(&self) -> Vec<&Project>;
10    fn projects_mut(&mut self) -> Vec<&mut Project>;
11    fn project_files(&self) -> &[&str];
12    async fn visit(&mut self, path: &Path, relative_path: &Path) -> Result<()>;
13    fn check_changed(&mut self, path: &Path) -> Result<()> {
14        for project in self.projects_mut() {
15            project.check_changed(path)?;
16        }
17        Ok(())
18    }
19    async fn test(&self) -> Result<()> {
20        Ok(())
21    }
22}