Cargo字节镜像源

在 Windows 系统默认为:%USERPROFILE%.cargo,在类 Unix 系统默认为:$HOME/.cargo,在此目录下新建config文件,填写内容如下:

php 复制代码
[source.crates-io]
replace-with = 'rsproxy'

[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"

# 稀疏索引,要求 cargo >= 1.68
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"

[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"

[net]
git-fetch-with-cli = true

源替换:

source.crates-io:这一部分指定了 crates.io 作为默认源。

replace-with = 'rsproxy':这行配置表示将 crates.io 源替换为 rsproxy。
自定义源配置:

source.rsproxy:定义了一个名为 rsproxy 的源。

registry = "https://rsproxy.cn/crates.io-index":指定了 rsproxy 源的注册表 URL。
稀疏索引配置(需要 Cargo 1.68 及以上版本):

source.rsproxy-sparse:定义了一个名为 rsproxy-sparse 的源,用于稀疏索引。

registry = "sparse+https://rsproxy.cn/index/":指定了稀疏索引源的注册表 URL。
注册表配置:

registries.rsproxy:定义了一个名为 rsproxy 的注册表。

index = "https://rsproxy.cn/crates.io-index":指定了注册表的索引 URL。
网络配置:

net:定义了网络相关的配置。

git-fetch-with-cli = true:这行配置指定了在处理 git 依赖时使用命令行工具。

丰富内容

相关推荐
wflynn7 小时前
GitHub 今日推荐|wordcraft:用 Rust 重写 Word 内核并开放给 AI 调用
rust·开源·github
I'm Jie7 小时前
【开源】7 天,我用 Rust 复刻了 FinalShell!Rhost v1.0.0 发布
开发语言·rust·开源
小灰灰搞电子8 小时前
Rust+Slint 实现一个终端软件源码分享(半成品)
开发语言·rust
恋喵大鲤鱼9 小时前
Rust str 与 String 类型的区别
rust
miofly10 小时前
GitHub 今日推荐|fsearch:Rust 打造 macOS 毫秒级全盘文件名与内容搜索工具
rust·开源·github
大鹏的NLP博客11 小时前
Rust 的本质:用数学约束实现编译期内存安全
安全·rust
Kapaseker11 小时前
Rust 读多写少还在用 Mutex?别让线程白白排队
rust
EatFan12 小时前
2026 Rust 后端技术栈选型:Axum 0.8 + Tokio + SQLx 全链路怎么搭
开发语言·后端·rust·tokio·serde·axum·sqlx
Zoom1 天前
【开源】7 天,我用 Rust 复刻了 FinalShell!Rhost v1.0.0 发布
rust·electron·shell
wflynn1 天前
GitHub 今日推荐|ts-rust:把微软 TypeScript-Go 编译器逐行移植成 Rust 实现
rust·typescript·开源·github·compiler·tsc