cargo-public-api
« Back to VersTracker
Description:
List and diff the public API of Rust library crates
Type: Formula  |  Latest Version: 0.50.1@0  |  Tracked Since: Dec 17, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: rust cli api developer-tools semver dev-tool
Install: brew install cargo-public-api
About:
cargo-public-api is a command-line tool for Rust developers to inspect and compare the public API of library crates. It leverages rustdoc's JSON output to generate a precise list of all public items, such as structs, traits, and functions. This is invaluable for managing API stability, as it can generate diffs between versions to detect breaking changes.
Key Features:
  • Generate a detailed list of all public API items from rustdoc JSON
  • Diff public APIs between different crate versions or git commits
  • Integrates with CI/CD to enforce semantic versioning and prevent breaking changes
  • Supports checking for changes in both nightly and stable Rust toolchains
Use Cases:
  • Verifying that a new release adheres to semantic versioning rules
  • Auditing dependencies for unexpected API changes that could cause breakage
  • Automating API stability checks in a continuous integration pipeline
Alternatives:
  • cargo-semver-checks – Focuses specifically on detecting semver violations, whereas cargo-public-api provides a more general-purpose tool for listing and diffing APIs.
  • rustdoc --output-format json – The underlying mechanism that cargo-public-api uses; the tool provides a user-friendly CLI and diffing capabilities on top of the raw JSON output.
Version History
Detected Version Rev Change Commit