diff options
| author | Michael Howell <michael@notriddle.com> | 2024-01-06 13:17:51 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2024-03-11 21:22:03 -0700 |
| commit | 7f427f86bd0db622f896bcdce04ce5f20658c071 (patch) | |
| tree | 3b6e8ba782cbe642acea6c3f25770f5e88cb952f /src/doc/rustdoc | |
| parent | 5aad51d015b8d3f6d823a6bf9dbc8ae3b9fd10c5 (diff) | |
| download | rust-7f427f86bd0db622f896bcdce04ce5f20658c071.tar.gz rust-7f427f86bd0db622f896bcdce04ce5f20658c071.zip | |
rustdoc-search: parse and search with ML-style HOF
Option::map, for example, looks like this:
option<t>, (t -> u) -> option<u>
This syntax searches all of the HOFs in Rust: traits Fn, FnOnce,
and FnMut, and bare fn primitives.
Diffstat (limited to 'src/doc/rustdoc')
| -rw-r--r-- | src/doc/rustdoc/src/read-documentation/search.md | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/doc/rustdoc/src/read-documentation/search.md b/src/doc/rustdoc/src/read-documentation/search.md index b5f4060f059..d17e41bcde7 100644 --- a/src/doc/rustdoc/src/read-documentation/search.md +++ b/src/doc/rustdoc/src/read-documentation/search.md @@ -63,11 +63,12 @@ Before describing the syntax in more detail, here's a few sample searches of the standard library and functions that are included in the results list: | Query | Results | -|-------|--------| +|-------|---------| | [`usize -> vec`][] | `slice::repeat` and `Vec::with_capacity` | | [`vec, vec -> bool`][] | `Vec::eq` | | [`option<T>, fnonce -> option<U>`][] | `Option::map` and `Option::and_then` | -| [`option<T>, fnonce -> option<T>`][] | `Option::filter` and `Option::inspect` | +| [`option<T>, (fnonce (T) -> bool) -> option<T>`][optionfilter] | `Option::filter` | +| [`option<T>, (T -> bool) -> option<T>`][optionfilter2] | `Option::filter` | | [`option -> default`][] | `Option::unwrap_or_default` | | [`stdout, [u8]`][stdoutu8] | `Stdout::write` | | [`any -> !`][] | `panic::panic_any` | @@ -77,7 +78,8 @@ the standard library and functions that are included in the results list: [`usize -> vec`]: ../../std/vec/struct.Vec.html?search=usize%20-%3E%20vec&filter-crate=std [`vec, vec -> bool`]: ../../std/vec/struct.Vec.html?search=vec,%20vec%20-%3E%20bool&filter-crate=std [`option<T>, fnonce -> option<U>`]: ../../std/vec/struct.Vec.html?search=option<T>%2C%20fnonce%20->%20option<U>&filter-crate=std -[`option<T>, fnonce -> option<T>`]: ../../std/vec/struct.Vec.html?search=option<T>%2C%20fnonce%20->%20option<T>&filter-crate=std +[optionfilter]: ../../std/vec/struct.Vec.html?search=option<T>%2C+(fnonce+(T)+->+bool)+->+option<T>&filter-crate=std +[optionfilter2]: ../../std/vec/struct.Vec.html?search=option<T>%2C+(T+->+bool)+->+option<T>&filter-crate=std [`option -> default`]: ../../std/vec/struct.Vec.html?search=option%20-%3E%20default&filter-crate=std [`any -> !`]: ../../std/vec/struct.Vec.html?search=any%20-%3E%20!&filter-crate=std [stdoutu8]: ../../std/vec/struct.Vec.html?search=stdout%2C%20[u8]&filter-crate=std |
