https://github.com/lukemathwalker/cargo-manifest
Fork to fix some serialization issues.
https://github.com/lukemathwalker/cargo-manifest
Last synced: 3 months ago
JSON representation
Fork to fix some serialization issues.
- Host: GitHub
- URL: https://github.com/lukemathwalker/cargo-manifest
- Owner: LukeMathWalker
- License: apache-2.0
- Created: 2020-10-23T00:03:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-01-28T20:21:31.000Z (5 months ago)
- Last Synced: 2025-03-31T08:12:27.220Z (3 months ago)
- Language: Rust
- Size: 245 KB
- Stars: 14
- Watchers: 4
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
cargo-manifest
==============================================================================[`serde`](https://serde.rs) definitions to read and write
[`Cargo.toml`](https://doc.rust-lang.org/cargo/reference/manifest.html) files.Description
------------------------------------------------------------------------------This Rust crate contains various structs and enums to represent the contents of
a `Cargo.toml` file. These definitions can be used with [`serde`](https://serde.rs)
and the [`toml`](https://crates.io/crates/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 modern
> `Cargo.toml` files.Installation
------------------------------------------------------------------------------```sh
cargo add cargo-manifest
```Usage
------------------------------------------------------------------------------```rust
use cargo_manifest::Manifest;let manifest = Manifest::from_path("Cargo.toml").unwrap();
```see [docs.rs](https://docs.rs/cargo-manifest) for more information.
Users
------------------------------------------------------------------------------- [cargo-chef](https://crates.io/crates/cargo-chef)
- [crates.io](https://github.com/rust-lang/crates.io) is using this crate for
server-side validation of `Cargo.toml` files.Alternatives
------------------------------------------------------------------------------This crate is a fork of the [`cargo_toml`](https://crates.io/crates/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`](https://crates.io/crates/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.License
------------------------------------------------------------------------------This project is licensed under either of
- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
)- MIT license ([LICENSE-MIT](LICENSE-MIT) or
)at your option.