Expand description
§gosh-dl
A fast, safe, and reliable download engine written in Rust.
§Features
- HTTP/HTTPS Downloads: Multi-connection segmented downloads with resume support
- BitTorrent: Full protocol support including DHT, PEX, and LPD
- Cross-platform: Works on Linux, macOS, and Windows
- Memory-safe: Written in Rust with no unsafe code in core paths
- Async: Built on Tokio for efficient concurrent downloads
§Quick Start
ⓘ
use gosh_dl::{DownloadEngine, EngineConfig, DownloadOptions};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create engine with default config
let config = EngineConfig::default();
let engine = DownloadEngine::new(config).await?;
// Add a download
let id = engine.add_http(
"https://example.com/file.zip",
DownloadOptions::default(),
).await?;
// Subscribe to events
let mut events = engine.subscribe();
while let Ok(event) = events.recv().await {
println!("Event: {:?}", event);
}
Ok(())
}Re-exports§
pub use config::AllocationMode;pub use config::EngineConfig;pub use config::HttpConfig;pub use config::TorrentConfig;pub use engine::DownloadEngine;pub use error::EngineError;pub use error::NetworkErrorKind;pub use error::ProtocolErrorKind;pub use error::Result;pub use error::StorageErrorKind;pub use protocol::ProtocolError;pub use protocol::ProtocolResult;pub use storage::SqliteStorage;pub use storage::MemoryStorage;pub use storage::Segment;pub use storage::SegmentState;pub use storage::Storage;pub use http::ConnectionPool;pub use http::HttpDownloader;pub use http::ResumeInfo;pub use http::RetryPolicy;pub use http::SegmentedDownload;pub use http::ServerCapabilities;pub use http::SpeedCalculator;
Modules§
- config
- Engine configuration
- engine
- Download Engine - Main coordinator
- error
- Typed error hierarchy for gosh-dl
- http
- HTTP Download Engine
- protocol
- Protocol types for gosh-dl
- storage
- Storage Module
- torrent
- BitTorrent Module
Structs§
- Bandwidth
Limits - Current bandwidth limits (possibly from schedule)
- Bandwidth
Scheduler - Bandwidth scheduler that manages time-based limits
- Download
Id - Unique identifier for a download
- Download
Metadata - Metadata about a download
- Download
Options - Options for adding a new download
- Download
Progress - Progress information for a download
- Download
Status - Full status of a download
- Global
Stats - Global statistics
- Peer
Info - Peer information (for torrents)
- Priority
Queue - Priority-based download queue
- Priority
Queue Stats - Statistics about the priority queue
- Schedule
Rule - A rule for time-based bandwidth scheduling
- Torrent
File - Information about a file in a torrent
- Torrent
Info - Parsed torrent metadata
- Torrent
Status Info - Torrent status information embedded in DownloadStatus
Enums§
- Download
Event - Events emitted by the download engine
- Download
Kind - Type of download
- Download
Priority - Priority levels for downloads
- Download
State - Current state of a download