29 breaking releases

0.32.2 Oct 23, 2024
0.31.0 Oct 13, 2024
0.28.0 Jul 18, 2024
0.24.0 Dec 24, 2023
0.1.0 Dec 6, 2020

#62 in Rust patterns

Download history 13407/week @ 2024-07-30 17560/week @ 2024-08-06 20259/week @ 2024-08-13 16833/week @ 2024-08-20 14755/week @ 2024-08-27 19511/week @ 2024-09-03 19641/week @ 2024-09-10 15510/week @ 2024-09-17 19190/week @ 2024-09-24 19202/week @ 2024-10-01 19440/week @ 2024-10-08 26935/week @ 2024-10-15 23594/week @ 2024-10-22 22633/week @ 2024-10-29 25428/week @ 2024-11-05 21642/week @ 2024-11-12

97,497 downloads per month
Used in 40 crates (20 directly)

MIT/Apache

54KB
554 lines

Rustdoc Types

Docs

This crate contains the type definitions for rustdoc's currently-unstable --output-format=json flag. They can be deserialized with serde-json from the output of cargo +nightly rustdoc -- --output-format json -Z unstable-options:

let json_string = std::fs::read_to_string("./target/doc/rustdoc_types.json")?;
let krate: rustdoc_types::Crate = serde_json::from_str(&json_string)?;

println!("the index has {} items", krate.index.len());

For performance sensitive crates, consider turning on the rustc-hash feature. This switches all data structures from std::collections::HashMap to rustc-hash::FxHashMap which improves performance when reading big JSON files (like aws_sdk_rs's).

cargo-semver-checks benchmarked this change with aws_sdk_ec2's JSON and observed a -3% improvement to the runtime. The performance here depends on how much time you spend querying the HashMaps, so as always, measure first.

Contributing

This repo is a reexport of rustdoc-json-types from the rust repo. Any change to the contents of src/, should be sent to rust-lang/rust, via their normal contribution procedures. Once reviewed and merged there, the change will be pulled to this repo and published to crates.io.

Release Procedure

  1. Run ./update.sh to pull code from upstream
  2. Run cargo test
  3. Run ./clgen.sh <old_version> <new_version>
  4. Follow printed instructions to commit and push.

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.3–1MB
~21K SLoC