Skip to main content

graphrefly_storage/
lib.rs

1//! `GraphReFly` storage tier dispatch + Node-side persistence.
2//!
3//! Implements the G.27 storage tier protocol: tiered N-way storage with
4//! per-tier transactions, debouncing, compaction, and codec
5//! parameterization. Phase 13.6's deferred ACID atomicity tightening
6//! lands here via [`redb`](https://docs.rs/redb), which provides
7//! pure-Rust ACID transactions without a C dependency.
8//!
9//! # Status
10//!
11//! M4 complete: tier dispatch, WAL, codecs, memory + file backends,
12//! `attach_storage` reactive flush driver, durability/error/rollback
13//! contracts (D268–D270). See `docs/migration-status.md` and
14//! `docs/porting-deferred.md` for remaining storage follow-ons.
15//!
16//! Key modules: [`wal`], [`tier`], [`memory`], [`file`] (feature `file`),
17//! [`redb`] (feature `redb-store`), [`graph_integration`] (snapshot attach /
18//! restore — consumed from `graphrefly-graph`).
19
20#![warn(rust_2018_idioms, unreachable_pub)]
21#![warn(clippy::pedantic)]
22#![allow(clippy::module_name_repetitions, clippy::missing_errors_doc)]
23#![forbid(unsafe_code)]
24
25pub mod backend;
26pub mod codec;
27pub mod error;
28#[cfg(feature = "file")]
29pub mod file;
30pub mod graph_integration;
31pub mod memory;
32#[cfg(feature = "redb-store")]
33pub mod redb;
34pub mod tier;
35pub mod wal;
36
37pub use backend::{memory_backend, MemoryBackend, StorageBackend};
38pub use codec::{Codec, CodecError, JsonCodec};
39pub use error::{PhaseStat, RestoreError, RestoreResult, StorageError};
40#[cfg(feature = "file")]
41pub use file::{
42    file_append_log, file_append_log_default, file_backend, file_kv, file_kv_default,
43    file_snapshot, file_snapshot_default, FileBackend,
44};
45pub use graph_integration::{
46    attach_snapshot_storage, decompose_diff_to_frames, diff_snapshots, restore_snapshot,
47    AttachOptions, AttachTierPair, GraphCheckpointRecord, GraphSnapshotDiff, RestoreOptions,
48    StorageHandle, TornWritePolicy, ValueChange, SNAPSHOT_VERSION,
49};
50pub use memory::{
51    append_log_storage, kv_storage, memory_append_log, memory_kv, memory_snapshot,
52    snapshot_storage, AppendLogStorage, AppendLogStorageOptions, KvStorage, KvStorageOptions,
53    SnapshotStorage, SnapshotStorageOptions,
54};
55#[cfg(feature = "redb-store")]
56pub use redb::{
57    redb_append_log, redb_append_log_default, redb_backend, redb_kv, redb_kv_default,
58    redb_snapshot, redb_snapshot_default, RedbBackend,
59};
60pub use tier::{
61    AppendCursor, AppendLoadResult, AppendLogMode, AppendLogStorageTier, BaseStorageTier,
62    KvStorageTier, LoadEntriesOpts, SnapshotStorageTier,
63};
64pub use wal::{
65    graph_wal_prefix, verify_wal_frame_checksum, wal_frame_checksum, wal_frame_key, ChecksumError,
66    WALFrame, WalTag, REPLAY_ORDER, WAL_FRAME_SEQ_PAD, WAL_KEY_SEGMENT,
67};