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 依赖时使用命令行工具。

丰富内容

相关推荐
分布式存储与RustFS13 小时前
基于Rust的国产开源对象存储RustFS:S3 Table对Iceberg数据湖的适配详解
rust·开源·iceberg·对象存储·rustfs·minio平替·s3 table
Jinkxs16 小时前
Rust 性能优化全流程:从 flamegraph 定位瓶颈到 unsafe 与 SIMD 加速,响应快 2 倍
开发语言·性能优化·rust
星栈独行20 小时前
Rust + Makepad 应用怎么打包发布:Windows、macOS、Linux 全平台交付
windows·程序人生·macos·ui·rust
fox_lht1 天前
15.3.改进我们之前的输入、输出项目
开发语言·后端·学习·rust
guyoung2 天前
BoxAgnts 工具系统(6)——多 Provider 适配与 Agent 查询循环
rust·agent·ai编程
星栈2 天前
Rust + Makepad 应用怎么打包发布:Windows、macOS、Linux 全平台交付
前端·rust
MageGojo2 天前
R-Shell开源项目实战解析:用Rust打造命令行SSH工具,支持连接管理、远程执行、SFTP与MCP
运维·rust·开源项目·命令行工具·ssh客户端·mcp
techdashen2 天前
Cargo 1.94 开发周期全解析
开发语言·后端·rust
fox_lht2 天前
15.4.循环和迭代器的性能比较
开发语言·后端·学习·rust
guyoung2 天前
BoxAgnts 工具系统(5)——WASM 工具开发:从 Hello World 到生产部署
rust·agent·ai编程