Skip to main content

ManifestParser

Trait ManifestParser 

Source
pub trait ManifestParser {
    // Required methods
    fn manifest_name(&self) -> &str;
    fn can_parse(&self, manifest_path: &Path) -> bool;
    fn parse(
        &self,
        manifest_path: &Path,
        workspace_root: &Path,
    ) -> Result<(Project, Vec<Dependency>), KdoError>;
}
Expand description

Trait implemented by each language-specific manifest parser.

Required Methods§

Source

fn manifest_name(&self) -> &str

Returns the canonical manifest filename (e.g., Cargo.toml).

Source

fn can_parse(&self, manifest_path: &Path) -> bool

Check whether this parser can handle the given manifest path.

Source

fn parse( &self, manifest_path: &Path, workspace_root: &Path, ) -> Result<(Project, Vec<Dependency>), KdoError>

Parse a manifest file, returning a project and its declared dependencies.

workspace_root is used to resolve relative path dependencies.

Implementors§