書名: Learning Rust作者名: Paul Johnson Vesa Kaihlavirta本章字數: 93字更新時間: 2021-07-02 23:07:14
Creating documentation using Cargo
As with other languages, Rust is able to create documentation based on meta tags with the source files. Take the following example:
fn main() { print_multiply(4, 5); } /// A simple function example /// /// # Examples /// /// ``` /// print_multiply(3, 5); /// /// ``` fn print_multiply(x: i32, y: i32) { println!("x * y = {}", x * y); }
The comments preceded by /// will be converted into documentation.
The documentation can be created in one of two ways: via Cargo or by using the rustdoc program.
推薦閱讀
- 無代碼編程:用云表搭建企業數字化管理平臺
- Practical Data Science Cookbook(Second Edition)
- 樂學Web編程:網站制作不神秘
- 單片機應用技術
- 小學生C++創意編程(視頻教學版)
- Jupyter數據科學實戰
- 大數據分析與應用實戰:統計機器學習之數據導向編程
- 劍指大數據:企業級數據倉庫項目實戰(在線教育版)
- Android Development Tools for Eclipse
- 軟件工程與UML案例解析(第三版)
- Get Your Hands Dirty on Clean Architecture
- HTML5游戲開發實戰
- Spring Data JPA從入門到精通
- MATLAB計算機視覺實戰
- Slick2D Game Development