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
//! The Session port: submit a request against a running game and get a
//! response, whether the authoritative state lives in this process or (later)
//! a remote one.
//!
//! A [`Session`] is a client-side handle, not the host itself. Only some
//! implementations actually hold the authoritative state:
//!
//! - [`LocalSession`] owns the [`turnbase::Game`] and its state directly and
//! mutates it in process. This process *is* the host for as long as the
//! value lives. Zero I/O; this is what tests, a long-lived server, and
//! self-play hold onto.
//! - [`FileSession`] is not itself a [`Session`]: it is a stateless adapter
//! *around* a per-call [`LocalSession`]. Each call loads a `LocalSession`
//! from a JSON save file, submits one request, and saves it back. This is
//! what a headless CLI drives, one process invocation per request.
//!
//! A future `RemoteSession` would hold no authority at all, only a connection
//! to a host reached over some transport. That, and any pluggable `Store`
//! backend beyond the single JSON file [`FileSession`] ships, are deliberately
//! deferred until a concrete consumer exists (see the workspace design notes).
//!
//! Redaction is automatic: a [`Request::Query`] runs [`turnbase::Game::view`]
//! for the requesting seat first, so only that seat's view is ever produced,
//! never the raw state with every seat's hidden information.
pub use ;
pub use LocalSession;
use ;
use ;
/// A running game, reachable in-process or (later) over a transport.