Crates.io | tokio-dl-stream-to-disk |
lib.rs | tokio-dl-stream-to-disk |
version | 1.0.1 |
source | src |
created_at | 2021-08-17 20:33:30.755391 |
updated_at | 2024-03-29 02:54:05.447943 |
description | A micro-library for downloading from a URL and streaming it directly to the disk |
homepage | https://github.com/EFForg/tokio-dl-stream-to-disk |
repository | https://github.com/EFForg/tokio-dl-stream-to-disk |
max_upload_size | |
id | 438651 |
size | 14,268 |
tokio-dl-stream-to-disk
A micro-library for downloading from a URL and streaming it directly to the disk
use std::path::Path;
use tokio_dl_stream_to_disk::AsyncDownload;
#[tokio::main]
async fn main() {
if AsyncDownload::new("https://bit.ly/3yWXSOW", &Path::new("/tmp"), "5mb_test.bin").download(&None).await.is_ok() {
println!("File downloaded successfully!");
}
}
License: MIT