//! MemTable for read-your-writes consistency.
//!
//! The MemTable sits between the WAL commit and KVStore indexing,
//! providing immediate visibility of assertions. This ensures that
//! after `POST /assert` returns 201, an immediate `GET /query` will
//! return the assertion without waiting for background indexing.
//!
//! # Architecture
//!
//! ```text
//! Write: POST /assert → WAL (fsync) → MemTable → return 201
//!                                         ↓
//! Query: GET /query  → MemTable ∪ KVStore → Lens → response
//!
//! Background: IngestWorker → WAL → KVStore → evict from MemTable
//! ```
//!
//! # Usage
//!
//! ```ignore
//! use stemedb_storage::memtable::{MemTable, MemTableEntry};
//!
//! let memtable = MemTable::new(10_000);
//!
//! // After WAL commit, insert into MemTable
//! let entry = MemTableEntry::new(assertion, hash, wal_offset);
//! memtable.insert(entry);
//!
//! // Query merges MemTable with KVStore
//! let assertions = memtable.get_by_subject("Tesla");
//!
//! // After IngestWorker indexes, evict from MemTable
//! memtable.advance_indexed_offset(new_offset);
//! ```

mod entry;
mod table;

#[cfg(test)]
mod tests;

pub use entry::MemTableEntry;
pub use table::MemTable;
