lora_snapshot/lib.rs
1//! Efficient snapshots for LoraDB graph state.
2//!
3//! This crate is intentionally separate from `lora-store` and `lora-wal`:
4//! the store owns the canonical in-memory records, the WAL owns ordered
5//! mutation recovery, and this crate owns compact point-in-time state images.
6//!
7//! The current format is column-oriented rather than serde-over-struct:
8//! nodes, labels, relationships, relationship types, and properties are stored
9//! in separate columns. That keeps the format friendly to future Arrow /
10//! Parquet backends while avoiding those heavy dependencies in the first
11//! implementation. Compression and authenticated encryption are applied to the
12//! encoded column body.
13//!
14//! Layout:
15//! - `format` — magic + format/version constants.
16//! - `codec` — top-level `encode_snapshot` / `decode_snapshot` /
17//! `write_snapshot` / `read_snapshot` and `SnapshotInfo`.
18//! - `envelope`, `body`, `columnar`, `transform`, `view` — the layered
19//! on-disk format implementation.
20//! - `errors`, `options` — public vocabulary.
21
22mod body;
23mod codec;
24mod columnar;
25mod envelope;
26mod errors;
27mod format;
28mod options;
29mod transform;
30mod view;
31
32#[cfg(test)]
33mod tests;
34
35pub use codec::{
36 decode_snapshot, encode_snapshot, encode_snapshot_with_options, open_snapshot_view,
37 read_snapshot, snapshot_info, write_snapshot, SnapshotInfo,
38};
39pub use errors::{Result, SnapshotCodecError};
40pub use format::DATABASE_SNAPSHOT_MAGIC;
41pub use options::{
42 Compression, EncryptionKey, PasswordKdfParams, SnapshotCredentials, SnapshotEncryption,
43 SnapshotOptions, SnapshotPassword,
44};
45pub use view::{SnapshotView, StringTableView, U32ColumnView, U64ColumnView};