1
2
3
4
5
6
7
8
9
10
use std::error::Error;

/// AZble to capture and restore its state.
pub trait Snapshot<S> {
    /// Capture the current state.
    fn capture(self) -> Result<S, ()>;

    /// Restore a state.
    fn restore(&mut self, snapshot: S) -> Result<(), Box<dyn Error>>;
}