Skip to main content

Module surface

Module surface 

Source
Expand description

Public API surface from rustdoc JSON: item paths, span-derived fingerprints, doc presence, and literal source signatures.

Fingerprints hash the item’s source span text (ordinary comments stripped, then whitespace-normalized), not rustdoc’s structured types — rustdoc item ids shift across builds and would churn a structure-based hash. An item generated by a macro call has a span that is only the call, so its declaration and fingerprint come from the JSON item instead, with ids left out.

Structs§

ItemGroup
One distinct item, grouped by (kind, fingerprint) to collapse the extra path keys alias_reexports adds for the same underlying function — representative is the shortest path (for display), aliases holds every spelling (for lookups, since a covers= tag may name any of them). Un-fingerprinted items (span unreadable) are never merged with others.
ItemInfo
What the surface records about one public item — enough to detect any change to it (fingerprint), classify the change (signature), and audit coverage (kind, has_docs).
Surface
Public items keyed by full path (crate::module::item).

Functions§

from_rustdoc
Build a surface from a rustdoc JSON document. source_root resolves the relative filenames in spans (the directory rustdoc ran in).