Function fetch_online_docs

Source
pub fn fetch_online_docs(
    crate_name: &str,
    item_path: Option<&str>,
) -> Result<String>
Expand description

Fetches Rust documentation from docs.rs and converts it to Markdown.

§Arguments

  • crate_name - The name of the crate to fetch documentation for
  • item_path - Optional path to a specific item within the crate

§Returns

The documentation as Markdown text.

§Examples

use rustdoc_text::fetch_online_docs;

let docs = fetch_online_docs("serde", None)?;
println!("{}", docs);