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 types::DownloadEvent;pub use types::DownloadId;pub use types::DownloadKind;pub use types::DownloadMetadata;pub use types::DownloadOptions;pub use types::DownloadProgress;pub use types::DownloadState;pub use types::DownloadStatus;pub use types::GlobalStats;pub use types::PeerInfo;pub use types::TorrentFile;pub use types::TorrentInfo;pub use types::TorrentStatusInfo;pub use storage::MemoryStorage;pub use storage::Segment;pub use storage::SegmentState;pub use storage::SqliteStorage;pub use storage::Storage;pub use priority_queue::DownloadPriority;pub use priority_queue::PriorityQueue;pub use priority_queue::PriorityQueueStats;pub use scheduler::BandwidthLimits;pub use scheduler::BandwidthScheduler;pub use scheduler::ScheduleRule;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
- priority_
queue - Priority Queue for Download Scheduling
- protocol
- Protocol types for gosh-dl
- scheduler
- Bandwidth Scheduling
- storage
- Storage Module
- torrent
- BitTorrent Module
- types
- Core types for gosh-dl