Skip to main content

SnapshotMachine

Trait SnapshotMachine 

Source
pub trait SnapshotMachine: Machine {
    // Required methods
    fn snapshot(&self) -> Result<Snapshot>;
    fn restore(&mut self, snapshot: &Snapshot) -> Result<()>;
}
Expand description

Machines that can checkpoint and roll back their environment — Racket namespaces, Smalltalk images, a solver’s push/pop, and (trivially, exactly) a ScriptMachine’s history.

Required Methods§

Source

fn snapshot(&self) -> Result<Snapshot>

Source

fn restore(&mut self, snapshot: &Snapshot) -> Result<()>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl SnapshotMachine for HtmlMachine

The whole document is the state, so a snapshot is the document.

Source§

impl SnapshotMachine for ScriptMachine