Re:Rust 1.37.0
by staticassertion on Thursday August 15, 2019 @05:18PM
(#20709762)
cargo doc does do that already, not sure what you mean.
IDEs should also be autocompleting trait impls.
My experience is that it will only autocomplete traits that you have imported. Which sucks because what if I don’t know what traits my type uses? It’s crazy
Re:Rust 1.37.0
by rakenodiax on Saturday August 17, 2019 @07:08AM
(#20723364)
IntelliJ will suggest unimported trait methods and will automatically import the required trait if it is selected.
For example, on std:String, the + operator is hidden away in the Add trait implementation. (In this case it's reasonably obvious anyway.)
Re:Rust 1.37.0
by staticassertion on Thursday August 15, 2019 @05:43PM
(#20709986)
Ah, interesting. I haven't really noticed that sort of thing myself.
In Go, you can very easily see all the methods that a type implements. However, you don't see which interfaces it implements because it's implicit.
In Rust, the methods are often hidden away in trait implementations, so it's harder to see what you can actually do.
It seems like this might be fixed if the doc tool generated an index to all the methods, as a reference? Or maybe there already is an easier way that I overlooked.