Expand description
Use the latest search index from rustdoc
to find the docs.rs (or stdlib) URL for any item in a
crate by its simple path.
§Example
Please have a look at the start_search
function for an example of how to use this crate, as
it is the main entry point. In addition, you can check out the examples
directory in the
repository.
§Feature flags
The following features flags enable support for older versions of the search index. If they’re
not enabled, the retrieving the Index
for a crate might fail. These should be enabled or
disabled based on the requirements to what crates will be searched for (if known).
The features listed are enabled by default.
index-v2
enables support to parse the slightly outdated index format. This is needed if parsing of older crates that haven’t be update in a while is required.index-v1
enables support for the even older index format. Nowadays it’s rarely found and this is only needed to parse very old crates that haven’t been updated in a long while.
Modules§
- error
- Different types of errors that can occur when using this crate.
Structs§
- Index
- Parsed crate index that contains the mappings from
SimplePath
s to their URL for direct linking. - Search
Index - Second and last state in retrieving a search index. Use the
Self::url
function to get the search index URL to download. The index’s content must be passed toSelf::transform_index
to create the finalIndex
instance. - Search
Page - Initial state when starting a new search. Use the
Self::url
function to get the URL to download content from. The web page content must then be passed toSelf::find_index
to get to the next state. - Simple
Path - Path for any item within a crate (or just the crate itself) like
std::vec::Vec
,anyhow::Result
orthiserror
.
Enums§
- Version
- Crate version that can be either the latest available or a specific one.
Functions§
- start_
search - Search for the given crate name and optionally a fixed version. This is the main entry point to
retrieve an
Index
and further query that index forSimplePath
s.