pub fn run_rustdoc(
crate_dir: &Path,
crate_name: &str,
features: Option<&str>,
no_default_features: bool,
target: Option<&str>,
allow_rustup: bool,
) -> Result<Crate>Expand description
Runs rustdoc for a given crate and parses the resulting JSON output.
This function uses the rustdoc-json crate to invoke rustdoc with the
necessary flags to produce JSON output. It requires a specific nightly
Rust toolchain (see NIGHTLY_RUST_VERSION).
§Arguments
crate_dir: Path to the root directory of the crate.crate_name: The name of the crate (as it appears inCargo.toml).features: An optional space-separated string of features to enable.no_default_features: Iftrue, thedefaultfeature will not be activated.target: An optional target triple to build documentation for.allow_rustup: Iftrue, the function will attempt to install the required nightly toolchain usingrustup. Iffalseand the toolchain is not present, it may fail.
§Returns
A Result containing the parsed rustdoc_types::Crate data, or an error
if rustdoc execution or JSON parsing fails.