- 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.
推薦閱讀
- Expert C++
- Modular Programming with Python
- Monkey Game Development:Beginner's Guide
- Building a Game with Unity and Blender
- Python數據可視化之Matplotlib與Pyecharts實戰
- Visual FoxPro程序設計
- PhoneGap:Beginner's Guide(Third Edition)
- Unity UI Cookbook
- Nginx Lua開發實戰
- Java網絡編程實戰
- Scala for Machine Learning(Second Edition)
- Getting Started with Python and Raspberry Pi
- Julia 1.0 Programming Complete Reference Guide
- 工業機器人離線編程
- AMP:Building Accelerated Mobile Pages