1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! Runtime-agnostic I/O abstractions for networking and caching.
//!
//! This module contains the engine's I/O boundary types. The engine
//! itself **never performs I/O directly** -- it defines traits and
//! data structures that the host application implements to bridge to
//! the platform's networking and file-system stacks.
//!
//! # Module map
//!
//! | Type | Role |
//! |------|------|
//! | [`HttpClient`] | Trait the host implements to perform HTTP requests. |
//! | [`HttpRequest`] | Description of an outgoing request (URL, method, headers). |
//! | [`HttpResponse`] | A completed response (status, body, headers). |
//! | [`SharedHttpClient`] | Deduplicating `HttpClient` wrapper that coalesces concurrent requests for the same URL across subscribers. |
//! | [`FetchPool`] | Concurrency-limited, priority-ordered download scheduler wrapping an `HttpClient`. |
//! | [`DiskCache`] | *(feature `disk-cache`)* Flat-file on-disk tile cache (`{z}/{x}/{y}.bin`). |
//! | [`DiskCacheError`] | *(feature `disk-cache`)* Error type for disk cache operations. |
//!
//! # Design principles
//!
//! 1. **No async runtime.** The engine runs on a synchronous
//! `send` / `poll` loop so it can be embedded in Bevy, a winit
//! event loop, a game engine, or a headless CLI tool without
//! pulling in tokio, async-std, or any other executor.
//!
//! 2. **No platform dependencies.** This module compiles on every
//! `rustc` target. Platform-specific code lives in the host's
//! `HttpClient` implementation.
//!
//! 3. **Composable layers.**
//!
//! ```text
//! Engine (TileManager / HttpTileSource)
//! |
//! v
//! FetchPool -- concurrency limit + priority queue
//! |
//! v
//! SharedHttpClient (optional) -- cross-source request dedup
//! |
//! v
//! HttpClient -- host-provided transport (reqwest, web_sys, etc.)
//! |
//! v
//! DiskCache (optional) -- flat-file persistence
//! ```
//!
//! Each layer is independent and optional. `HttpTileSource` can
//! use a raw `HttpClient` without `FetchPool`, and `DiskCache`
//! can sit in front of or behind the network layer.
// ---------------------------------------------------------------------------
// Sub-modules
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Public re-exports
// ---------------------------------------------------------------------------
pub use ;
pub use FetchPool;
pub use ;
pub use SharedHttpClient;