Skip to main content

inferadb_ledger_state/
lib.rs

1//! State management for InferaDB Ledger.
2//!
3//! This crate sits between the raw B+ tree storage engine (`inferadb-ledger-store`)
4//! and the Raft consensus layer (`inferadb-ledger-raft`), providing:
5//!
6//! - State layer with bucket-based incremental hashing (256 buckets per vault)
7//! - Entity and relationship CRUD with conditional writes
8//! - Snapshot creation and restoration
9//! - Dual indexes for relationship queries (object-centric and subject-centric)
10//! - System types for routing and cluster membership
11//! - Time-travel index for historical queries
12//! - Block archive for committed block storage
13
14#![deny(unsafe_code)]
15#![warn(missing_docs)]
16
17mod block_archive;
18mod bucket;
19mod engine;
20mod entity;
21mod events;
22mod events_keys;
23mod indexes;
24mod keys;
25mod relationship;
26mod shard;
27mod snapshot;
28mod state;
29/// System organization (`_system`) for global cluster data.
30///
31/// Contains types for user accounts, organization routing, cluster membership,
32/// and cross-organization sagas. See [`system::SystemOrganizationService`] for the
33/// primary service interface.
34pub mod system;
35mod tiered_storage;
36
37pub use block_archive::{BlockArchive, BlockArchiveError};
38pub use bucket::{NUM_BUCKETS, VaultCommitment};
39pub use engine::{InMemoryStorageEngine, StorageEngine};
40pub use entity::EntityStore;
41pub use events::{
42    EventIndex, EventStore, EventStoreError, Events, EventsDatabase, EventsDatabaseError,
43};
44pub use events_keys::encode_event_key;
45pub use indexes::IndexManager;
46pub use keys::{StorageKey, decode_storage_key, encode_storage_key};
47pub use relationship::RelationshipStore;
48pub use shard::ShardManager;
49pub use snapshot::{
50    Snapshot, SnapshotChainParams, SnapshotError, SnapshotManager, SnapshotStateData,
51    VaultSnapshotMeta,
52};
53pub use state::{StateError, StateLayer};
54pub use tiered_storage::{
55    LocalBackend, ObjectStorageBackend, StorageBackend, StorageTier, TieredSnapshotManager,
56    TieredStorageConfig, TieredStorageError,
57};