Files
smartdb/rust/crates/rustdb-storage/src/lib.rs
T

33 lines
1.1 KiB
Rust

//! `rustdb-storage` -- Storage adapters for RustDb.
//!
//! Provides the [`StorageAdapter`] trait and two concrete implementations:
//! - [`MemoryStorageAdapter`] -- fast in-memory store backed by `DashMap`
//! - [`FileStorageAdapter`] -- Bitcask-style append-only log with crash recovery
//!
//! Also includes an [`OpLog`] for operation logging, a [`BinaryWal`] for
//! write-ahead logging, and [`compaction`] for dead record reclamation.
pub mod adapter;
pub mod binary_wal;
pub mod compaction;
pub mod error;
pub mod file;
pub mod keydir;
pub mod memory;
pub mod oplog;
pub mod record;
pub mod validate;
pub use adapter::StorageAdapter;
pub use binary_wal::{BinaryWal, WalEntry, WalOpType};
pub use compaction::{compact_data_file, should_compact, CompactionResult};
pub use error::{StorageError, StorageResult};
pub use file::FileStorageAdapter;
pub use keydir::{BuildStats, KeyDir, KeyDirEntry};
pub use memory::MemoryStorageAdapter;
pub use oplog::{OpLog, OpLogEntry, OpLogStats, OpType};
pub use record::{
DataRecord, FileHeader, FileType, RecordScanner, FILE_HEADER_SIZE, FILE_MAGIC, FORMAT_VERSION,
RECORD_HEADER_SIZE, RECORD_MAGIC,
};