public-api 0.51.0

List and diff the public API of Rust library crates. Relies on rustdoc JSON output from the nightly toolchain.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    let json_path = rustdoc_json::Builder::default()
        .toolchain("nightly")
        .manifest_path("test-apis/example_api-v0.2.0/Cargo.toml")
        .build()?;

    let public_api = public_api::Builder::from_rustdoc_json(json_path).build()?;

    for public_item in public_api.items() {
        println!("{public_item}");
    }

    Ok(())
}