I’m not sure if there are any guidelines on that currently.
I know that in the new
io module though, all of the structs seem to have been named nouns, the traits have been named verbs, and the methods have been named verbs or plural nouns.
Write, the trait for something to write to - similarly
BufWrite, the trait for something that writes in a buffered way
BufWriter, an implementation of
Write::write, a method to write something to the
- or in a different method name case,
Read::chars, a method to produce a character iterator from a
But, in another case, structs have also been called verbs. The ones in the
io trait using this convention are all iterators, which take the name directly from the methods which produce them.
io::repeat(u8) will produce a
BufReader::split(self, u8) will produce a
Besides those trends, I don’t know of any specific guidelines. I think the general consensus is just to go with something which will give the user an idea of what the function will do, and not to have it in any specific part of speech.