api-guidelines icon indicating copy to clipboard operation
api-guidelines copied to clipboard

Document the most common non-trait methods?

Open cher-nov opened this issue 1 year ago • 0 comments

Excuse me if this has already been mentioned and/or discussed somewhere and I just missed it. But I honestly searched and didn't find anything resembling, although for me this was one of the first questions that arose when I started learning Rust 4 years ago.

It would be really great, especially for beginners IMO, to have a list of the most common method names (except those provided by traits, since they're naturally general) that would describe and explain their semantics. Which is currently observed in the form of a fairly implicit notation.

Some examples of the most obvious:

  • https://doc.rust-lang.org/1.82.0/std/index.html?search=unwrap
  • https://doc.rust-lang.org/1.82.0/std/index.html?search=take
  • https://doc.rust-lang.org/1.82.0/std/index.html?search=flatten
  • https://doc.rust-lang.org/1.82.0/std/index.html?search=transpose
  • https://doc.rust-lang.org/1.82.0/std/index.html?search=inspect
  • as_ref and as_mut not from the std::convert::AsRef trait (see explanation)

It might make sense to gather some stats on the most repeating names in the standard library, and then extract an appropriate subset of terminology from it.

cher-nov avatar Nov 16 '24 17:11 cher-nov