Skip to content
rgreinhoPublic

About

Tokio Rust Asynchronous Universal download MAnager

Resources

Stars

179 stars

Watchers

2 watching

Forks

Repository files navigation

Trauma

Crates.io Documentation ci

Tokio Rust Asynchronous Universal download MAnager

Description

Trauma is a library simplifying and prettifying HTTP(s) downloads. The downloads are executed asynchronously and progress bars are drawn on the screen to help monitoring the process.

trauma v3 default UI

Features

  • Library only
  • HTTP(S) downloads with rustls
  • Support download via proxies
  • Download files via providing a list of URLs
    • Automatically use the remote file names
    • Ability to rename downloaded files
  • Ability to configure the download manager
    • Download directory
    • Maximum simultaneous requests
    • Number of retries
    • Resume downloads (if supported by the remote server)
    • Custom HTTP Headers
  • Asynchronous w/ Tokio
  • Progress bar w/ indicatif
    • Display the individual progress
    • Display the total progress
  • Ability to customize the progress bars
    • Customize the format
    • Customize the progression style
    • Leave them on the screen or clear them upon completion
    • Hide any or both of them
    • Use pre-configured styles

Usage

Add this to your Cargo.toml:

[dependencies]
trauma = "3"

Features

By default, trauma enables rustls for TLS support.

To explicitly use the legacy default-tls specify this feature instead:

[dependencies]
trauma = { version = "3", default-features = false, features = ["default-tls"] }

Quick start

use trauma::{download::Download, downloader::DownloaderBuilder, Error};

#[tokio::main]
async fn main() -> Result<(), Error> {
    let reqwest_rs = "https://github.com/seanmonstar/reqwest/archive/refs/tags/v0.11.9.zip";
    let downloads = vec![Download::builder().url(reqwest_rs)?.build()];
    let downloader = Downloader::builder().directory("output").build();
    downloader.download(&downloads).await;
    Ok(())
}

More examples can be found in the examples folder. They are well commented and will guide you through the different features of this library.

Why another download manager

Before starting this project, I spent some time searching the internet, trying not to reinvent the wheel. And I did find a bunch of interesting existing projects!

However they are almost all abandoned:

As a result, I decided to write trauma.

About

Tokio Rust Asynchronous Universal download MAnager

Resources

Stars

179 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages