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

相关推荐
UestcXiye6 小时前
Rust 学习笔记:函数和控制流
rust
Source.Liu10 小时前
【mdlib】0 全面介绍 mdlib - Rust 实现的 Markdown 工具集
rust·markdown
机构师12 小时前
<rust><iced><GUI>iced中的复合列表部件:combo_box
后端·rust
景天科技苑16 小时前
【Rust】Rust中的枚举与模式匹配,原理解析与应用实战
开发语言·后端·rust·match·enum·枚举与模式匹配·rust枚举与模式匹配
红尘散仙16 小时前
七、WebGPU 基础入门——Texture 纹理
前端·rust·gpu
红尘散仙16 小时前
八、WebGPU 基础入门——加载图像纹理
前端·rust·gpu
w4ngzhen16 小时前
关于Bevy中的原型Archetypes
rust·游戏开发
sayornottt18 小时前
Rust中的动态分发
后端·rust
YiSLWLL1 天前
使用Tauri 2.3.1+Leptos 0.7.8开发桌面小程序汇总
python·rust·sqlite·matplotlib·visual studio code
yu4106211 天前
Rust 语言使用场景分析
开发语言·后端·rust