| Crates.io | download-extract-progress |
| lib.rs | download-extract-progress |
| version | 1.0.0 |
| created_at | 2025-05-29 16:17:27.647896+00 |
| updated_at | 2025-05-30 13:14:36.309172+00 |
| description | A Rust library for downloading and extracting files with progress tracking. |
| homepage | |
| repository | https://github.com/sshcrack/download-extract-progress |
| max_upload_size | |
| id | 1693966 |
| size | 78,318 |
A Rust library for downloading and extracting files with progress tracking. Supports async downloads, hash verification, and zip extraction with progress updates.
Add to your Cargo.toml:
[dependencies]
download-extract-progress = "0.1.0"
use download_extract_progress::download::download;
use futures_util::StreamExt;
#[tokio::main]
async fn main() {
let url = "https://example.com/file.zip";
let path = "./file.zip";
let mut stream = download("Example File", url, path, None).await;
while let Some(status) = stream.next().await {
match status {
Ok((progress, msg)) => println!("{:.0}% - {}", progress * 100.0, msg),
Err(e) => eprintln!("Error: {}", e),
}
}
}
use download_extract_progress::extract::extract_obs;
use futures_util::StreamExt;
use std::path::Path;
#[tokio::main]
async fn main() {
let archive = Path::new("./file.zip");
let out_dir = Path::new("./output");
let mut stream = extract_obs(archive, out_dir).await;
while let Some(status) = stream.next().await {
match status {
Ok((progress, msg)) => println!("{:.0}% - {}", progress * 100.0, msg),
Err(e) => eprintln!("Extract error: {}", e),
}
}
}
use download_extract_progress::download::download_github;
use futures_util::StreamExt;
#[tokio::main]
async fn main() {
let repo = "user/repo";
let is_zip = |name: &str| name.ends_with(".zip");
let path = "./latest.zip";
let mut stream = download_github(repo, is_zip, path, None).await.unwrap();
while let Some(status) = stream.next().await {
match status {
Ok((progress, msg)) => println!("{:.0}% - {}", progress * 100.0, msg),
Err(e) => eprintln!("Error: {}", e),
}
}
}
MIT
Pull requests and issues are welcome!
See docs.rs for full API documentation.