Re:A Gentle Introduction to Rust
by tempodox on Thursday April 12, 2018 @04:18AM
(#16818930)
What makes Rust still rather inaccessible for me is the difficulty in finding «functions I can apply to an argument of type X» and «functions that return a value of type Y» other than, “read every last bit of API doc about everything and memorize it”.
[ Parent
| on HN ]
Re:A Gentle Introduction to Rust
by fredmorcos on Thursday April 12, 2018 @04:40AM
(#16819032)
When you search in the API documentation, you will find 3 tabs at the top: "In Names", "In Parameters" and "In Return Types".
The official docs have limited support for it, if you search for i32[0] the default facet is "in names" but you can use the "in parameters" and "in return types" tabs for these. I don't know how well these handle abstract types and it's nowhere near hoogle convenience, but there you are (there were efforts to port/replicate hoogle a few years back but the few I remember seem to have been abandoned, specifying a search syntax is probably non-trivial as well given Rust's signatures are not as convenient as Haskell's there)/
That would be what Hoogle is for Haskell: https://www.haskell.org/hoogle/
Could you start by grepping API docs?