replace crates.io ustc mirrors
[source]
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "https://mirrors.ustc.edu.cn/crates.io-index"
generate local registry
cargo install cargo-local-registry
cargo local-registry --sync <path of Cargo.toml> <path of local registory>
local registry config
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'local-registry'
[source.local-registry]
local-registry = '/root/.cargo/./local-registry/'
generate vendor directory
cargo vendor <path of Cargo.toml> <path of local registory>
local vendor directory config
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "path of vendor directory"