Skip to main content

IncrementalSave

Trait IncrementalSave 

Source
pub trait IncrementalSave<T>: Send + Sync {
    // Required methods
    fn save_ops(&self, ops: &[Op]) -> Result<()>;
    fn sync(&self) -> Result<()>;
    fn should_snapshot(&self) -> bool;
    fn snapshot(&self, state: &T) -> Result<()>;
}
Expand description

Trait for incremental (WAL-based) saves from the Store.

Required Methods§

Source

fn save_ops(&self, ops: &[Op]) -> Result<()>

Append ops to WAL buffer (no fsync).

Source

fn sync(&self) -> Result<()>

Flush BufWriter + fsync WAL file.

Source

fn should_snapshot(&self) -> bool

Check if WAL has exceeded the snapshot threshold.

Source

fn snapshot(&self, state: &T) -> Result<()>

Write a full snapshot and reset WAL.

Implementors§