Expand description
§Turbo CDN
Intelligent download accelerator with automatic CDN optimization and concurrent chunked downloads.
§Features
- Automatic CDN Optimization: GitHub, jsDelivr, Fastly, Cloudflare mirrors
- Concurrent Downloads: Multi-threaded chunked downloads with range requests
- Smart URL Mapping: Regex-based URL pattern matching for CDN selection
- Resume Support: Automatic resume for interrupted downloads
- Geographic Awareness: Location-based CDN selection for optimal speed
- Progress Tracking: Real-time download progress and speed monitoring
§Quick Start
use turbo_cdn::*;
#[tokio::main]
async fn main() -> turbo_cdn::Result<()> {
// Simple download with automatic CDN optimization
let downloader = TurboCdn::new().await?;
let result = downloader.download_from_url(
"https://github.com/BurntSushi/ripgrep/releases/download/14.1.1/ripgrep-14.1.1-x86_64-pc-windows-msvc.zip"
).await?;
println!("Downloaded {} bytes to: {}", result.size, result.path.display());
println!("Speed: {:.2} MB/s", result.speed / 1024.0 / 1024.0);
Ok(())
}Re-exports§
pub use concurrent_downloader::ConcurrentDownloader;pub use concurrent_downloader::DownloadResult;pub use config::Region;pub use config::TurboCdnConfig;pub use error::Result;pub use error::TurboCdnError;pub use github_releases::AssetInfo;pub use github_releases::DataSource;pub use github_releases::FetchOptions;pub use github_releases::GitHubReleasesFetcher;pub use github_releases::ReleaseInfo;pub use github_releases::ReleasesResult;pub use github_releases::VersionsResult;pub use progress::ConsoleProgressReporter;pub use progress::ProgressCallback;pub use progress::ProgressInfo;pub use progress::ProgressTracker;pub use server_tracker::PerformanceSummary;pub use server_tracker::ServerStats;pub use url_mapper::UrlMapper;pub use constants::*;
Modules§
- adaptive_
concurrency - Adaptive Concurrency Control System
- adaptive_
speed_ controller - Adaptive speed controller with dynamic optimization
- async_
api - Async API module for external integrations (like vx)
- cdn_
quality - CDN Quality Assessment and Real-time Performance Monitoring
- cli_
progress - CLI progress display utilities using indicatif
- concurrent_
downloader - Concurrent download engine with dynamic segmentation
- config
- Configuration System
- constants
- Constants
- dns_
cache - DNS Cache System
- error
- geo_
detection - Geographic Location Detection
- github_
releases - GitHub Releases version listing API with CDN fallback
- http_
client - HTTP client implementation using reqwest with rustls
- http_
client_ manager - HTTP client manager using reqwest with rustls
- load_
balancer - Intelligent Load Balancer
- logging
- Professional logging configuration for turbo-cdn
- memory_
tracker - Memory usage tracking and metrics
- mmap_
writer - Memory-mapped file writer for high-performance I/O
- progress
- server_
quality_ scorer - Server quality scoring and intelligent failover system
- server_
tracker - Server performance tracking and intelligent selection
- smart_
chunking - Smart Chunking Algorithm
- smart_
downloader - Smart downloader with automatic method selection
- string_
interner - String interning system for frequently used URLs and patterns
- sync_
api - Synchronous API for blocking operations
- url_
mapper - URL mapping system for CDN optimization
Macros§
Structs§
- Download
Options - Download options for customizing download behavior
- Turbo
Cdn - Main TurboCdn client - simplified download accelerator
- Turbo
CdnBuilder - Builder for TurboCdn with fluent API
- Turbo
CdnStats - Statistics for TurboCdn
Functions§
- init_
rustls_ provider - Initialize rustls crypto provider (ring backend) This must be called before creating any reqwest Client when using rustls-no-provider
- init_
tracing Deprecated - Initialize tracing for the library (deprecated - use logging module)
- init_
tracing_ with_ level Deprecated - Initialize tracing with specific level (deprecated - use logging module)