pub trait Snapshotable {
// Required methods
fn save_snapshot<W: Write>(
&self,
writer: W,
) -> Result<SnapshotMeta, SnapshotError>;
fn load_snapshot<R: Read>(
&mut self,
reader: R,
) -> Result<SnapshotMeta, SnapshotError>;
}Expand description
A backend that can serialize its state to a byte stream and restore from one.
The trait is deliberately orthogonal to [GraphStorage] /
[GraphStorageMut]: a backend opts into durability independently of the
core read/write contract. Future hooks (WAL, incremental checkpoints)
will land alongside this trait, not inside it — keeping Snapshotable
narrow makes it easy to compose (e.g. SnapshotOverS3, or a wrapper that
also appends to a WAL on every mutation).
Required Methods§
fn save_snapshot<W: Write>( &self, writer: W, ) -> Result<SnapshotMeta, SnapshotError>
fn load_snapshot<R: Read>( &mut self, reader: R, ) -> Result<SnapshotMeta, SnapshotError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.