shape-runtime 0.3.1

Bytecode compiler, builtins, and runtime infrastructure for Shape
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// @module std::core::snapshot
/// Process Snapshotting and Resumability

/// Result of a snapshot operation.
/// `snapshot()` is a builtin that returns self enum directly.
pub enum Snapshot {
    /// The process has just been snapshotted. Contains the Hash ID.
    Hash(string),
    /// Execution has resumed from a previous snapshot.
    Resumed
}

/// Create a snapshot of the current execution state.
/// This is a suspension point: the engine saves all state and returns `Snapshot::Hash(id)`.
/// When resumed from a snapshot, execution continues here and returns `Snapshot::Resumed`.
pub fn snapshot() -> Snapshot {
    __intrinsic_snapshot()
}