Skip to main content

Module builder

Module builder 

Source
Expand description

Fluent builder API — the primary interface for the KGet library.

§Quick start

use kget::KgetError;

// Single file
let result = kget::builder("https://example.com/file.zip")
    .output("./downloads/")
    .connections(8)
    .sha256("abc123...")
    .download()?;

println!("Avg speed: {} B/s", result.avg_speed_bps);

§Batch

let results = kget::batch(["https://a.com/f1.zip", "https://b.com/f2.iso"])
    .concurrency(4)
    .output_dir("./downloads/")
    .download_all();

for r in &results {
    match &r.result {
        Ok(info) => println!("OK  {}", r.url),
        Err(e)   => eprintln!("ERR {}  — {}", r.url, e),
    }
}

Structs§

BatchBuilder
Builder for downloading multiple URLs concurrently.
BatchResult
Result of one URL in a batch download.
ComputedChecksums
Digests that were computed (and optionally verified) after a download.
DownloadBuilder
Fluent builder for a single download.
DownloadResult
Metrics and metadata returned after a successful download.
RetryConfig
Controls how many times and how often a failed download is retried.

Enums§

Backoff
Delay strategy between retry attempts.