1 个不稳定版本
0.1.1 | 2022年6月10日 |
---|
#355 在 游戏 中
10KB
Rust示例项目

目录
如何安装Rust
在线尝试Rust
你可以在Rust Playground中在线尝试Rust,无需在电脑上安装任何东西。在线尝试
安装它!
Windows
你需要下载 RUSTUP-INIT.EXE 并将其安装到你的电脑上。
Linux
如果你是Windows Subsystem for Linux用户或Linux用户,请在终端中运行以下命令,然后按照屏幕上的说明安装Rust。
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
有关更多安装选项,你可以查看这个 链接。
与VSCode集成

你可以安装 rust-analyser 扩展程序,然后你就可以开始使用了。
Cargo
当你安装Rustup时,你还会得到最新稳定的Rust构建工具和包管理器,也称为Cargo。Cargo可以做很多事情
- 使用
cargo build
构建你的项目 - 使用
cargo run
运行你的项目 - 使用
cargo test
测试你的项目 - 使用
cargo doc
为你的项目生成文档 - 使用
cargo publish
将库发布到crates.io
为了测试你是否已安装Rust和Cargo,你可以在所选的终端中运行以下命令
cargo --version
你应该会看到类似以下的内容 cargo 1.61.0 (a028ae42f 2022-04-29)
需要更多吗?
如果您想学习更多,可以阅读 《Cargo 指南》。
所有信息均来自 Rust 入门页面