crate-inspector
Inspect the public APIs of Rust library crates
Prerequisite
This crate requires that you have the nightly Rust toolchain installed, as it uses the latest rustdoc API (and does not require compiling with the nightly toolchain).
Examples
Getting items
use CrateBuilder;
let builder = default
.toolchain
.manifest_path;
let krate = builder.build.unwrap;
for item in krate.items
for strc in krate.structs
for enm in krate.enums
for sub in krate.sub_modules
if let Some = krate.get_item
Downcasting
use ;
let builder = default
.toolchain
.manifest_path;
let krate = builder.build.unwrap;
for item in krate.items
Compatibility
This crate depends on rustdoc's public API.
Here is a table mapping crate-inspector versions to corresponding rustdoc versions:
| crate-inspector | rustdoc-types |
|---|---|
| 0.1 | 0.23 |
| 0.2 | 0.32 |
| 0.3 | 0.54 |
| 0.4 | 0.55 |
License
This project is licensed under either of Apache License, Version 2.0 or MIT license at your option.