proof_engine/networking/mod.rs
1//! Networking module: HTTP client, WebSocket client, connection management.
2//!
3//! Networking primitives for leaderboards, replay sharing, analytics and
4//! live updates. Real network I/O needs cargo features: `http` (ureq) for
5//! [`http`], [`leaderboard`] and [`analytics`], `websocket` (tungstenite) for
6//! [`websocket`], or `net` for both. Without them the clients report an error
7//! instead of talking to the network. Requests and connections run on
8//! background threads; nothing blocks the frame.
9//!
10//! ## Modules
11//! - `http` — HTTP/HTTPS request/response with retry, caching, rate limiting
12//! - `websocket` — WebSocket client with auto-reconnect and message queueing
13//! - `leaderboard` — Leaderboard protocol: submit, fetch, paginate
14//! - `analytics` — Opt-in telemetry: session, deaths, performance
15//!
16//! ## Design
17//! All network operations are non-blocking. `tick(dt)` drives the state
18//! machines each frame. Results are delivered through `Event` queues that
19//! the game polls each frame — no async runtime required.
20
21pub mod http;
22pub mod websocket;
23pub mod leaderboard;
24pub mod analytics;
25
26pub mod protocol;
27pub mod transport;
28pub mod sync;
29pub mod lobby;
30pub mod rpc;
31
32pub use http::{HttpClient, HttpRequest, HttpResponse, HttpEvent, Method};
33pub use websocket::{WsClient, WsMessage, WsEvent, WsState};
34pub use leaderboard::{LeaderboardClient, ScoreEntry, LeaderboardEvent};
35pub use analytics::{Analytics, AnalyticsEvent, SessionStats};