Skip to main content

ProjectFinder

Trait ProjectFinder 

Source
pub trait ProjectFinder:
    Debug
    + Send
    + Sync {
    // Required methods
    fn projects(&self) -> Vec<&Project>;
    fn projects_mut(&mut self) -> Vec<&mut Project>;
    fn project_files(&self) -> &[&str];
    fn visit<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        path: &'life1 Path,
        relative_path: &'life2 Path,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn check_changed(&mut self, path: &Path) -> Result<()> { ... }
    fn finalize<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Visitor pattern for discovering projects by walking the git tree.

Each language implements this trait to detect its project files (package.json, Cargo.toml, etc.) and build a collection of projects. The visit method is called for each file in the git tree.

Required Methods§

Source

fn projects(&self) -> Vec<&Project>

Source

fn projects_mut(&mut self) -> Vec<&mut Project>

Source

fn project_files(&self) -> &[&str]

Source

fn visit<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, path: &'life1 Path, relative_path: &'life2 Path, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

§Errors

Returns error if the file visitation fails.

Provided Methods§

Source

fn check_changed(&mut self, path: &Path) -> Result<()>

§Errors

Returns error if checking changed status fails for any project.

Source

fn finalize<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Post-visit processing hook for resolving deferred state (e.g., workspace-inherited versions). Called once after all visit() calls complete.

§Errors

Returns error if finalization fails.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§