Download System
Overview
Quick Example
use lighty_core::download_file;
#[tokio::main]
async fn main() {
// Download with SHA1 verification
let path = download_file(
"https://example.com/file.zip",
"/tmp/file.zip",
Some("expected-sha1-hash")
).await?;
println!("Downloaded to: {:?}", path);
Ok(())
}Flow Diagram
API Reference
download_file(url, destination, expected_sha1)
download_file(url, destination, expected_sha1)Error Handling
Best Practices
1. Always Verify Critical Files
2. Handle Retries Gracefully
3. Use Absolute Paths
Advanced Usage
Concurrent Downloads
Progress Tracking
See Also
Last updated