rustdoc-json

Crates.iorustdoc-json
lib.rsrustdoc-json
version0.9.2
sourcesrc
created_at2022-06-30 19:58:44.422337
updated_at2024-07-26 15:44:34.838094
descriptionUtilities for working with rustdoc JSON.
homepagehttps://github.com/cargo-public-api/cargo-public-api/tree/main/rustdoc-json
repositoryhttps://github.com/cargo-public-api/cargo-public-api/tree/main/rustdoc-json
max_upload_size
id616680
size60,154
Emil Gardström (Emilgardis)

documentation

https://docs.rs/rustdoc-json

README

rustdoc-json

A library for programmatically working with rustdoc JSON.

Build rustdoc JSON

To build rustdoc JSON for a library with the manifest path project/Cargo.toml, do like this:

let json_path = rustdoc_json::Builder::default()
    .toolchain("nightly")
    .manifest_path("project/Cargo.toml")
    .build()
    .unwrap();

// Prints `Wrote rustdoc JSON to "/Users/martin/src/project/target/doc/project.json"`
println!("Wrote rustdoc JSON to {:?}", &json_path);

There are many more build options. See the docs to learn about all of them.

Changelog

Please refer to CHANGELOG.md.

Tests

This library is indirectly and heavily tested through the public-api and cargo-public-api test suites. Their tests heavily depend on this library, so if all of their tests pass, then this library works as it should. All tests are of course ensured to pass before a new release is made.

Commit count: 1714

cargo fmt