The change is live on nightly builds, and you can already see it in action.
demo of searching for
charext -> boolin the stdlib docs
The current feature set includes:
- searching by type (you can use generics as well, as long as you use the exact name: vec, t ->)
- the order of function arguments is not relevant (so you don't have to remember it)
self's type is took into account (e.g.
vec -> usize)
- reference types are treated as basic types (e.g.
If you are interested in the technical details, I suggest you check out the original issues, as well as the PR. While this is in no way comparable to a full fledged implementation like Hoogle's, the basic searching need is covered, and I hope that it will at least help other newbies like me explore the standard library, if nothing else.
There are plenty of enhancements to be made, so if you feel like contributing, here are a few ideas:
- proper support for generics (
char -> charshould match
t -> t)
- smart ranking (
char -> charshould first match
char -> charresults, and then
t -> t)
- support for complex, wrapped types (e.g.
- look for trait implementors (
char -> boolshould include
charext -> boolresults)
- use compression for the search index (it was pretty large to begin with and it takes up even more space now, with the type information)
Last but not least, I'd like to give kudos to the Rust community. They were extremely helpful, both on IRC and on GitHub, and this helped make a daunting task (at first) seem doable!