Crates.io | rustdoc-types |
lib.rs | rustdoc-types |
version | 0.32.2 |
source | src |
created_at | 2020-12-06 17:33:44.758748 |
updated_at | 2024-10-23 11:28:01.692246 |
description | Types for rustdoc's json output |
homepage | |
repository | https://github.com/rust-lang/rustdoc-types |
max_upload_size | |
id | 320173 |
size | 88,510 |
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 HashMap
s, so as always,
measure first.
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.
./update.sh
to pull code from upstreamcargo test
./clgen.sh <old_version> <new_version>
Licensed under either of
at your option.
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.