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§
fn snapshot(&self) -> Result<Snapshot>
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§
impl SnapshotMachine for HtmlMachine
The whole document is the state, so a snapshot is the document.