Skip to main content

is_item_fallback_page

Function is_item_fallback_page 

Source
pub fn is_item_fallback_page(html: &str, item_path: &str) -> bool
Expand description

Determine whether a resolved rustdoc page is a fallback rather than the dedicated page for item_path.

resolve_item_html probes the dedicated item page first, then falls back to the containing type’s page (e.g. the Value enum page for Value::is_null, since methods have no standalone page) and finally to the crate overview. A dedicated item page’s <h1> always contains the requested leaf identifier (the final :: segment); a parent-type or crate fallback heading does not. Returns true when the page does not document the requested item directly, so callers can surface an honest note in every output format.

This is content-based (not resolution-time state) so it stays correct on cache hits, where only the raw HTML is replayed. When the page has no heading at all, returns false to avoid over-warning.