pub struct StateSnapshot {
pub globals: BTreeMap<String, Value>,
pub lists: BTreeMap<String, SnapshotList>,
pub turn_index: u32,
pub visit_counts: BTreeMap<String, u32>,
pub turn_counts: BTreeMap<String, u32>,
pub call_stack: Vec<SnapshotFrame>,
pub status: SnapshotStatus,
}Expand description
A typed, name-resolved snapshot of a session’s game state.
A NEW typed serialization path — distinct from the string-valued
DebugSnapshot. Globals keep their Values (list
membership included via SnapshotList); callstack is summarized to frame
kinds + resolved locations. Deterministic (BTreeMap / sorted vectors).
Fields§
§globals: BTreeMap<String, Value>Global variables by name, typed. BTreeMap for determinism.
lists: BTreeMap<String, SnapshotList>Resolved list memberships for any List-valued global, keyed by
variable name (item names, sorted). Complements globals for consumers
that want membership without decoding DefinitionIds.
turn_index: u32Global turn index.
visit_counts: BTreeMap<String, u32>Per-knot/stitch visit counts, keyed by resolved path, sorted.
Path-keyed projection: counts for scopes with no resolvable author
path (anonymous counted containers — gathers, choice points — keyed
only by hash id) are omitted here. This is the known projection
limit of the typed snapshot; the full id-keyed counts remain available
via StorySession::save_state.
turn_counts: BTreeMap<String, u32>Per-knot/stitch turn-since counts, keyed by resolved path, sorted.
Same path-keyed projection limit as
visit_counts.
call_stack: Vec<SnapshotFrame>Callstack summary of the default flow, innermost frame first.
status: SnapshotStatusExecution status.
Trait Implementations§
Source§impl Clone for StateSnapshot
impl Clone for StateSnapshot
Source§fn clone(&self) -> StateSnapshot
fn clone(&self) -> StateSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more