Crates.io | cargo-manifest |
lib.rs | cargo-manifest |
version | 0.17.0 |
source | src |
created_at | 2020-10-23 10:33:57.711957 |
updated_at | 2024-11-28 09:02:54.871782 |
description | Helper crate to parse and manipulate manifests - `Cargo.toml` files. |
homepage | |
repository | https://github.com/LukeMathWalker/cargo-manifest |
max_upload_size | |
id | 304630 |
size | 92,621 |
serde
definitions to read and write
Cargo.toml
files.
This Rust crate contains various structs and enums to represent the contents of
a Cargo.toml
file. These definitions can be used with serde
and the toml
crate to read and write
Cargo.toml
manifest files.
This crate also to some degree supports post-processing of the data to emulate
Cargo's workspace inheritance and autobins
features. This is used for example
by crates.io to extract whether a crate contains a library or executable
binaries.
[!NOTE] The cargo team regularly adds new features to the
Cargo.toml
file definition. This crate aims to keep up-to-date with these changes. You should keep this crate up-to-date to correctly parse all fields in modernCargo.toml
files.
cargo add cargo-manifest
use cargo_manifest::Manifest;
let manifest = Manifest::from_path("Cargo.toml").unwrap();
see docs.rs for more information.
crates.io is using this crate for
server-side validation of Cargo.toml
files.
This crate is a fork of the cargo_toml
project. There are only some minor differences between these projects at this
point, you will need to evaluate which one fits your needs better.
There is also cargo-util-schemas
now, which is maintained by the cargo team themselves. This crate was extracted
from the cargo codebase and is used inside the cargo
binary itself. It is
kept up-to-date with the latest changes to the Cargo.toml
file format, but is
currently lacking some of the post-processing features that cargo-manifest
provides.
This project is licensed under either of
Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.