Expand description
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
-
No async runtime. The engine runs on a synchronous
send/pollloop 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. -
No platform dependencies. This module compiles on every
rustctarget. Platform-specific code lives in the host’sHttpClientimplementation. -
Composable layers.
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 persistenceEach layer is independent and optional.
HttpTileSourcecan use a rawHttpClientwithoutFetchPool, andDiskCachecan sit in front of or behind the network layer.
Structs§
- Disk
Cache - A flat-file on-disk tile cache.
- Fetch
Pool - A concurrency-limited, priority-ordered download scheduler.
- Http
Request - Description of an outgoing HTTP request.
- Http
Response - A completed HTTP response.
- Shared
Http Client - A deduplicating HTTP client wrapper that can be cheaply cloned.
Enums§
- Disk
Cache Error - Errors from disk cache operations.
Traits§
- Http
Client - Abstract HTTP client.