Skip to main content

Snapshotable

Trait Snapshotable 

Source
pub trait Snapshotable {
    // Required methods
    fn save_snapshot<W>(&self, writer: W) -> Result<SnapshotMeta, SnapshotError>
       where W: Write;
    fn load_snapshot<R>(
        &mut self,
        reader: R,
    ) -> Result<SnapshotMeta, SnapshotError>
       where R: Read;
}
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§

Source

fn save_snapshot<W>(&self, writer: W) -> Result<SnapshotMeta, SnapshotError>
where W: Write,

Source

fn load_snapshot<R>(&mut self, reader: R) -> Result<SnapshotMeta, SnapshotError>
where R: Read,

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.

Implementors§