Downloading Rust crates using a web browser

2019-06-25 10:37发布

问题:

Is there any way to download Rust dependencies using a web browser? I currently have internet access through my web browser but not through the command prompt (Windows).

I know that I can set up a local fileserver and set Cargo to use a mirror, but that doesn't help if I can't get the crates in the first place.

Edit:

See related Github issue, now closed.

回答1:

You can use the following address:

https://crates.io/api/v1/crates/name/version/download

To download crates directly from crates.io - just change the name and version to download a specific version of a crate.

The downloaded file has a .crate extension, but it's actually a tarball (.tar.gz).