| Crates.io | facet-cargo-toml |
| lib.rs | facet-cargo-toml |
| version | 0.43.0 |
| created_at | 2026-01-22 23:06:32.744044+00 |
| updated_at | 2026-01-22 23:06:32.744044+00 |
| description | Typed Cargo.toml and Cargo.lock parser using facet |
| homepage | |
| repository | https://github.com/bearcove/facet-cargo-toml |
| max_upload_size | |
| id | 2062861 |
| size | 6,428,320 |
Typed Cargo.toml and Cargo.lock parser using facet.
Add this to your Cargo.toml:
[dependencies]
facet-cargo-toml = "0.1"
use facet_cargo_toml::CargoManifest;
let manifest = CargoManifest::from_path("Cargo.toml")?;
if let Some(package) = &manifest.package {
println!("Package name: {:?}", package.name);
println!("Version: {:?}", package.version);
}
for (name, dep) in manifest.dependencies.unwrap_or_default() {
println!("Dependency: {name} = {dep:?}");
}
use facet_cargo_toml::Lockfile;
let lockfile = Lockfile::from_path("Cargo.lock")?;
for package in &lockfile.package {
println!("Locked package: {} {}", package.name, package.version);
}
CargoManifestComplete typed representation of Cargo.toml including:
LockfileTyped representation of Cargo.lock including:
This crate uses the facet serialization framework which provides:
#[derive(Facet)]Licensed under either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.