snapshot
snapshot
Section titled “snapshot”The snapshot module exposes a single suspension primitive that captures the
current execution state, returns a hash identifier, and — when resumed —
re-enters the call site indicating that a previous snapshot has been restored.
For richer VM-state introspection (frame capture, module bindings, content
hashing, diff/patch), see std::core::state.
Import
Section titled “Import”use std::core::snapshotThe Snapshot Enum
Section titled “The Snapshot Enum”pub enum Snapshot { Hash(string), // process was just snapshotted; payload is the Hash ID Resumed, // execution resumed from a previous snapshot}snapshot::snapshot() -> Snapshot
Section titled “snapshot::snapshot() -> Snapshot”Create a snapshot of the current execution state. The engine saves all state
and returns Snapshot::Hash(id). When execution later resumes from that
snapshot, control returns to the same call site and snapshot::snapshot()
returns Snapshot::Resumed.
use std::core::snapshot
match snapshot::snapshot() { Snapshot::Hash(id) => { print(f"snapshot id: {id}") // ... persist id, transfer to peer, etc. }, Snapshot::Resumed => { print("resumed from a prior snapshot") // ... continue post-resume work },}See Also
Section titled “See Also”- state — explicit
capture_all,resume,hash,diff,patch - Content-Addressed Bytecode — snapshot transport / hash semantics
- Resumability & Distributed Computing — end-to-end patterns