4 stable releases

1.3.2 Aug 26, 2019
1.3.1 Dec 25, 2018

#21 in #cargo-manifest

Download history 32/week @ 2024-07-21 39/week @ 2024-07-28 29/week @ 2024-08-04 30/week @ 2024-08-11 19/week @ 2024-08-18 26/week @ 2024-08-25 33/week @ 2024-09-01 31/week @ 2024-09-08 30/week @ 2024-09-15 53/week @ 2024-09-22 42/week @ 2024-09-29 34/week @ 2024-10-06 40/week @ 2024-10-13 24/week @ 2024-10-20 46/week @ 2024-10-27 50/week @ 2024-11-03

166 downloads per month
Used in 7 crates (5 directly)

MIT/Apache

17KB
323 lines

Cargo-toml2

Crates.io maintenance-as-is

Stuff for parsing Cargo.toml and .cargo/config files.

Should be fully accurate as per the Manifest Reference and .cargo/config Reference.

In the event the reference and the implementation diverge, I will make no attempt to fix anything until the references are properly updated.

Keeping track of undocumented changes is never a fun thing and I don't plan to do it. And it benefits no one to have a bunch of undocumented behaviour for Cargo.toml/.cargo/config.

Details

No validation or other work is performed on (De)Serialization. It is up to you to:

  • Ensure inputs are valid if you intend to Serialize.
  • Set Default values for missing fields, if you want them.

Note that this is a pretty direct wrapper around the Cargo Manifest, and you should see the Manifest Reference if you want to know what things mean.

Limitations

Due to current limitations in toml-rs, the Dependencies table may fail to write out with a ValueAfterTable error.

As a workaround, if possible remove or convert the Dependency::Simple variants to Dependency::Full ones. The relevant issue is #256

FAQ

  • Q: What about cargo-toml?
  • A: 🤷. It didn't work for my needs, so I wrote my own.

  • Q: Why call it cargo-toml2?
  • A: Cargo-toml was taken, and I'm unimaginative. It's a simple obvious name that clearly states its purpose, what else could I make it? Sorry. Bit late to change after it's published.

License

Licensed under either of

at your option.

Contribution

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.

Dependencies

~0.5–1MB
~25K SLoC