Expand description
Parse Cargo.toml manifests into CrateManifest structs.
Handles:
[package]metadata (name, version, description, edition)[dependencies],[dev-dependencies],[build-dependencies]- Workspace inheritance:
version.workspace = trueresolved from workspace root - Dependency sources: workspace, path, git, crates.io
- Inline table form:
dep = "1.0"and table form:dep = { version = "1.0" }
§Example
use nusy_codegraph::cargo_parser::CrateManifest;
use std::path::Path;
let manifest = CrateManifest::from_path(Path::new("Cargo.toml")).unwrap();
println!("{} {}", manifest.name, manifest.version);Structs§
- Crate
Dependency - A single dependency entry parsed from a Cargo.toml dependency table.
- Crate
Manifest - A parsed Cargo.toml manifest.
Enums§
- Dependency
Source - Provenance of a dependency.
Functions§
- parse_
workspace_ dependencies - Parse the workspace root
Cargo.tomland return a map ofname → versionfor all entries under[workspace.dependencies].