Skip to content

Include a list of struct methods in reference sidebar on struct pages #41123

Closed
@mqudsi

Description

@mqudsi

This is a suggestion for the formatting of reference pages for structs in rustdoc, in particular, to discuss the addition of a linked table of impl to the sidebar which would serve as

a) a quick way to identify methods a struct exposes which can be a great way to quickly find a function you know should exist but don't know the name of in rust, and
b) an easy way to navigate overly-long reference pages (currently, several parts of the rust book and documentation recommend "using ctrl+f to find the impl for xxxx"

As a concrete example, my suggestion would be for the string reference page to change like this:

unsorted methods

There are of course several questions about the layout and formatting of such a table. Should arguments be included? If yes, they add not-inconsiderable visual clutter, if no, what about overloads? Are they presented in alphabetical order or in the order they appear in the document? Do we include functions from trait implementations? Do we put them in a separate list?

Thanks for considering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions