pub trait SnapshotWriter {
// Required methods
fn write(&mut self, snapshot: &Snapshot) -> Result<(), SnapshotWriterError>;
fn flush(&mut self) -> Result<(), SnapshotWriterError>;
fn close(self) -> Result<(), SnapshotWriterError>;
}Expand description
A snapshot writer that persists state to storage.
Required Methods§
Sourcefn write(&mut self, snapshot: &Snapshot) -> Result<(), SnapshotWriterError>
fn write(&mut self, snapshot: &Snapshot) -> Result<(), SnapshotWriterError>
Write a snapshot to storage.
Sourcefn flush(&mut self) -> Result<(), SnapshotWriterError>
fn flush(&mut self) -> Result<(), SnapshotWriterError>
Flush pending writes to durable storage.
Sourcefn close(self) -> Result<(), SnapshotWriterError>
fn close(self) -> Result<(), SnapshotWriterError>
Close the writer, releasing any resources.