Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downloading Rust crates using a web browser

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.

like image 534
yinnonsanders Avatar asked Jul 25 '17 13:07

yinnonsanders


People also ask

Where are Rust crates downloaded?

Crates.io is the official website that stores Rust community crates (packages), and it's the place where the cargo package manager uploads, updates, and downloads those.

Are Rust crates open source?

The crate registry at crates.io distributes the source code of your packages, so it primarily hosts code that is open source. Rust and Cargo have features that make your published package easier for people to find and use.

What is cargo registry?

Cargo installs crates and fetches dependencies from a "registry". The default registry is crates.io. A registry contains an "index" which contains a searchable list of available crates. A registry may also provide a web API to support publishing new crates directly from Cargo.


1 Answers

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).

like image 132
ljedrz Avatar answered Oct 09 '22 09:10

ljedrz