Skip to main content

Resolver

Trait Resolver 

Source
pub trait Resolver: Sealed {
    // Required methods
    fn ecosystem(&self) -> Ecosystem;
    fn detect(&self, root: &Path) -> bool;
    fn resolve(&self, root: &Path) -> Result<ProjectGraph>;
    fn package_for_file(
        &self,
        graph: &ProjectGraph,
        file: &Path,
    ) -> Option<PackageId>;
    fn test_command(&self, package_id: &PackageId) -> Vec<String>;
}
Expand description

Trait implemented by each ecosystem resolver.

This trait is sealed and cannot be implemented outside of this crate.

Required Methods§

Source

fn ecosystem(&self) -> Ecosystem

Which ecosystem this resolver handles.

Source

fn detect(&self, root: &Path) -> bool

Can this resolver handle the project at the given root path?

Source

fn resolve(&self, root: &Path) -> Result<ProjectGraph>

Build the full project graph: packages + dependency edges.

Source

fn package_for_file( &self, graph: &ProjectGraph, file: &Path, ) -> Option<PackageId>

Given a file path (relative to project root), return which package owns it.

Source

fn test_command(&self, package_id: &PackageId) -> Vec<String>

Return the shell command to run tests for a given package.

Implementors§