Thanks to visit codestin.com
Credit goes to docs.rs

Crate ngdp_cdn

Crate ngdp_cdn 

Source
Expand description

NGDP CDN client for downloading game content

This crate provides an async HTTP client specifically designed for downloading content from Blizzard’s CDN servers. It includes:

  • Connection pooling for efficient multiple downloads
  • Automatic retry with exponential backoff
  • Support for gzip/deflate compression
  • Configurable timeouts and retry policies

§Example

use ngdp_cdn::CdnClient;

// Create a CDN client with default configuration
let client = CdnClient::new()?;

// Download a file by hash
let response = client.download(
    "blzddist1-a.akamaihd.net",
    "tpr/wow",
    "2e9c1e3b5f5a0c9d9e8f1234567890ab",
).await?;

let content = response.bytes().await?;
println!("Downloaded {} bytes", content.len());

§Advanced Configuration

use ngdp_cdn::CdnClient;

// Create a client with custom retry configuration
let client = CdnClient::builder()
    .max_retries(5)
    .initial_backoff_ms(200)
    .max_backoff_ms(30_000)
    .connect_timeout(60)
    .pool_max_idle_per_host(50)
    .build()?;

Structs§

CdnClient
CDN client for downloading content with automatic fallback
CdnClientBuilder
Builder for configuring CDN client

Enums§

Error
Error types for CDN operations

Type Aliases§

Result
Result type for CDN operations