34 releases (8 breaking)

0.19.2 Mar 4, 2024
0.18.0 Jan 8, 2024
0.18.0-beta.2 Dec 22, 2023
0.17.1 Nov 22, 2023
0.3.0 Jun 16, 2018

#31 in Parser implementations

Download history 43564/week @ 2023-12-23 60054/week @ 2023-12-30 78996/week @ 2024-01-06 86863/week @ 2024-01-13 87717/week @ 2024-01-20 92016/week @ 2024-01-27 91171/week @ 2024-02-03 95711/week @ 2024-02-10 97911/week @ 2024-02-17 93248/week @ 2024-02-24 99797/week @ 2024-03-02 96963/week @ 2024-03-09 102631/week @ 2024-03-16 98003/week @ 2024-03-23 105535/week @ 2024-03-30 90261/week @ 2024-04-06

411,400 downloads per month
Used in 316 crates (153 directly)

Apache-2.0 OR MIT

115KB
2K SLoC

Deserialize Cargo.toml

tom replacement

This is a definition of fields in Cargo.toml files for serde. It allows reading of Cargo.toml data, and serializing it using TOML or other formats. It's used by the lib.rs site to extract information about crates.

This crate is more than just schema definition. It supports post-processing of the data to emulate Cargo's workspace inheritance and autobins features. It supports files on disk as well as other non-disk data sources.

To get started, see Manifest::from_slice. If you need to get information about Cargo projects local to devs' machines, also consider cargo_metadata.


lib.rs:

This crate defines structs that can be deserialized with Serde to load and inspect Cargo.toml metadata.

See Manifest::from_slice.

Correct interpretation of the manifest requires two things:

  • List of files in order to auto-discover binaries, examples, benchmarks, and tests.
  • Potentially Manifest from parent directories that acts as a workspace root for inheritance of shared workspace information.

The crate has methods for processing this information, but you will need to write some glue code to obtain it. See Manifest::complete_from_path_and_workspace.

Dependencies

~0.6–1.1MB
~26K SLoC