Simple and modular write-ahead-logging implementation.
Examples
use ;
use block_on;
// start from empty WAL (trucate = true)
let store = new;
let mut wal = new.recover.unwrap;
// write a vector of records to WAL
for f in wal.grow.into_iter
// load from WAL if exists (trucate = false)
let store = new;
let mut wal = new.recover.unwrap;
// We'll see the playback of the log even if there is no failure. Let's remove the old log
// entries by assuming they are already persistent in your application.
let ring_ids = wal.grow
.into_iter.map.;
// Let's assume all these records are not longer needed. There will only be one remaining file
// in ./walfiles
block_on.unwrap;
let store = new;
let wal = new.recover.unwrap;
// The ./walfiles is empty now as all records are played back.