软件包与环境

cargo-rustdoc:构建 Rust 软件包的文档

· 52CE 我爱测

适用场景 构建 Rust 软件包的文档。 本条为命令参考与排查示例;请先确认命令已安装,再按示例定位实际参数和输出。 cargo rustdoc 构建 Rust 软件包的文档。 类似于 cargo doc,但您可以向 rustdoc 传递选项。查看 rustdoc --help 获取所有可用选项。 另请参阅:rustdoc。 更多信息:。 - 向 rustdoc 传递选项: cargo rustdoc -- {{rustdocoptions}} - 关于文

适用场景

构建 Rust 软件包的文档。 本条为命令参考与排查示例;请先确认命令已安装,再按示例定位实际参数和输出。

cargo rustdoc

构建 Rust 软件包的文档。 类似于 cargo doc,但您可以向 rustdoc 传递选项。查看 rustdoc --help 获取所有可用选项。 另请参阅:rustdoc。 更多信息:https://doc.rust-lang.org/cargo/commands/cargo-rustdoc.html。

  • 向 rustdoc 传递选项:

cargo rustdoc -- {{rustdoc_options}}

  • 关于文档 lint 发出警告:

cargo rustdoc -- {{[-W|--warn]}} rustdoc::{{lint_name}}

  • 忽略文档 lint:

cargo rustdoc -- {{[-A|--allow]}} rustdoc::{{lint_name}}

  • 为软件包的库生成文档:

cargo rustdoc --lib

  • 为指定的二进制文件生成文档:

cargo rustdoc --bin {{名称}}

  • 为指定的示例生成文档:

cargo rustdoc --example {{名称}}

  • 为指定的集成测试生成文档:

cargo rustdoc --test {{名称}}

资料来源与适用范围

资料来源
tldr 中文命令参考
适用范围
Linux / Unix;具体选项随发行版和命令版本变化
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-10-26
授权说明
CC BY 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。