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§
Sourcefn detect(&self, root: &Path) -> bool
fn detect(&self, root: &Path) -> bool
Can this resolver handle the project at the given root path?
Sourcefn resolve(&self, root: &Path) -> Result<ProjectGraph>
fn resolve(&self, root: &Path) -> Result<ProjectGraph>
Build the full project graph: packages + dependency edges.
Sourcefn package_for_file(
&self,
graph: &ProjectGraph,
file: &Path,
) -> Option<PackageId>
fn package_for_file( &self, graph: &ProjectGraph, file: &Path, ) -> Option<PackageId>
Given a file path (relative to project root), return which package owns it.
Sourcefn test_command(&self, package_id: &PackageId) -> Vec<String>
fn test_command(&self, package_id: &PackageId) -> Vec<String>
Return the shell command to run tests for a given package.