Rust 基础大纲

Rust 基础大纲

1.Summary

安装

https://www.rust-lang.org/zh-CN/tools/install

bash 复制代码
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# 安装完成后,验证是否成功
rustc -V
cargo -V

# 创建项目
cargo new my_project
# 编译项目
cargo build
# 生成的可执行文件位于 target/debug/ 目录下。

# 运行程序
# 直接运行以下命令:
cargo run

教材

https://practice.rs/
rust by examples

https://doc.rust-lang.org/stable/rust-by-example/
rust 圣经

https://course.rs/about-book.html
rust 官方文档中文网站

https://rustwiki.org/
Experiment: Improving the Rust Book

https://rust-book.cs.brown.edu/

2 Rust 源

中国区,可能连接 crates.io 会有问题。

$HOME/.cargo/config 中添加如下内容:

bash 复制代码
[source.crates-io]
replace-with = 'ustc'

[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

如果所处的环境中不允许使用 git 协议,可以把上述地址改为:

bash 复制代码
registry = "https://mirrors.ustc.edu.cn/crates.io-index"

2.1 cargo 版本>= 1.68 支持稀疏索引

可以在 $HOME/.cargo/config 中添加如下内容:
cargo 1.68 版本开始支持稀疏索引:不再需要完整克隆 crates.io-index 仓库,可以加快获取包的速度。

bash 复制代码
[source.crates-io]
replace-with = 'ustc'

[source.ustc]
registry = "sparse+https://mirrors.ustc.edu.cn/crates.io-index/"
相关推荐
大卫小东(Sheldon)3 小时前
GIM 2.0 发布:真正让 AI 提交消息可定制、可控、可项目级优化
git·rust·gim
roamingcode12 小时前
我是如何 Vibe Coding,将 AI CLI 工具从 Node.js 迁移到 Rust 并成功发布的
人工智能·rust·node.js·github·claude·github copilot
初恋叫萱萱13 小时前
构建高性能生成式AI应用:基于Rust Axum与蓝耘DeepSeek-V3.2大模型服务的全栈开发实战
开发语言·人工智能·rust
superman超哥2 天前
Serde 性能优化的终极武器
开发语言·rust·编程语言·rust serde·serde性能优化·rust开发工具
sayang_shao2 天前
Rust多线程编程学习笔记
笔记·学习·rust
鸿乃江边鸟2 天前
Spark Datafusion Comet 向量化Rust Native--读数据
rust·spark·native·arrow
硬汉嵌入式3 天前
基于Rust构建的单片机Ariel RTOS,支持Cortex-M、RISC-V 和 Xtensa
单片机·rust·risc-v
低调滴开发3 天前
Tauri开发桌面端服务,配置指定防火墙端口
rust·tauri·桌面端·windows防火墙规则
咚为3 天前
Rust Cell使用与原理
开发语言·网络·rust
咸甜适中4 天前
rust的docx-rs库,自定义docx模版批量生成docx文档(逐行注释)
开发语言·rust·docx·docx-rs