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

相关推荐
盒马盒马4 小时前
Rust:迭代器
开发语言·后端·rust
Source.Liu18 小时前
【Iced】stream.rs文件
rust·iced
Kapaseker18 小时前
精通 Rust 宏 — 包装新类型
rust
飞函安全18 小时前
Vite 8.0:Rust.bundle,性能提升10-30倍
开发语言·人工智能·rust
奋斗中的小猩猩1 天前
OpenClaw不安全,Rust写的ZeroClaw给出满意答案
安全·rust·openclaw·小龙虾
海奥华21 天前
Rust初步学习
开发语言·学习·rust
VermouthSp1 天前
上下文切换
linux·rust
小杍随笔2 天前
【Rust 1.94.0 正式发布:数组窗口、Cargo 配置模块化、TOML 1.1 全面升级|开发者必看】
开发语言·后端·rust
敬业小码哥2 天前
记一次:clion使用rust插件配置环境并开发
学习·rust
NGINX开源社区3 天前
NGINX 引入对 ACME 协议的原生支持
nginx·rust