kevy-persist
Durability for a kevy-store Store —
zero-dependency, pure Rust over std::fs. Part of
kevy.
Two mechanisms:
- Snapshot (RDB-style) —
save_snapshotdumps a whole store to a temp file, fsyncs, then atomically renames;load_snapshotrestores it. Compact, type-tagged binary format covering every value type. - AOF (append-only file) — an
Aofcommand log withAlways/EverySec/Nofsync policies;replay_aofre-applies it on startup and tolerates a truncated trailing frame from a crash mid-write.
Paired (snapshot + AOF), SAVE truncates the AOF so a reload of snapshot @ T0
plus the AOF of writes since T0 never double-applies. #![forbid(unsafe_code)].
use ;
let path = temp_dir.join;
let mut aof = open.unwrap;
aof.append.unwrap;
drop;
let mut cmds = Vecnew;
replay_aof.unwrap;
assert_eq!;
# remove_file.ok;
License
Licensed under either of MIT or Apache-2.0 at your option.