Skip to main content

load_state

Function load_state 

Source
pub fn load_state<C: ContextAccess + ?Sized>(
    program: &Program,
    ctx: &mut C,
    save: &SaveState,
) -> LoadReport
Expand description

Reconcile a SaveState into a flow’s context, returning a LoadReport of anything that couldn’t be applied. Globals are matched by name; visit/turn counts by id. Tolerant of story patches: unknown globals are reported, scopes the program no longer has retain their saved counts harmlessly in the live context. Note one deliberate change from the pre-F6.1b Story methods: such stale entries are not re-emitted by a subsequent save_state (which enumerates the current program’s containers, not the live maps) — ghost counts from older program versions no longer round-trip through saves indefinitely.

Writes go through ContextAccess, so on a ContextView they route by scope exactly like any other write: a World-scoped unit lands in the shared World, a Local-scoped unit in the flow’s own FlowLocal override layer.