#download #url #http-request #downloader #internet #tokio

dload

A simple crate to help you download files from URLs easily

5 releases

0.1.4 Aug 9, 2024
0.1.3 Jun 4, 2024
0.1.2 Apr 28, 2024
0.1.1 Apr 28, 2024
0.1.0 Apr 28, 2024

#316 in HTTP client

Download history 2/week @ 2024-08-17 4/week @ 2024-08-24 5/week @ 2024-08-31 7/week @ 2024-09-07 21/week @ 2024-09-14 49/week @ 2024-09-21 21/week @ 2024-09-28 2/week @ 2024-10-05 1/week @ 2024-10-19 41/week @ 2024-11-02 20/week @ 2024-11-09 43/week @ 2024-11-16 36/week @ 2024-11-23 34/week @ 2024-11-30

150 downloads per month
Used in rustfinity

MIT license

14KB
168 lines

dload

dload is a simple crate to help downloading files from the internet easily. It is a simple wrapper around the reqwest crate.

Usage

Add it to your package:

cargo add dload

Then you can use it like this:

use dload::Downloader;

#[tokio::main]
async fn main() {
  let url = "https://www.rust-lang.org/logos/rust-logo-512x512.png";

  Downloader::new()
    .set_output_dir(dir)
    .file_name("rust-logo.png")
    .download(url)
    .await
    .unwrap();
}

This will download the file from the given URL and save it to the given directory with the given file name.

Dependencies

~4–16MB
~192K SLoC