nexir_mvcc_core/lib.rs
1//! Standalone, deterministic Multi-Version Concurrency Control (MVCC) core library.
2//!
3//! This library provides the core primitives needed to build durable, transactional
4//! key-value databases without imposing a specific runtime or storage engine.
5//! It is completely independent of Tokio, networking, or specific consensus implementations.
6//!
7//! Key components:
8//! - [`MvccEngine`]: The main entry point for executing read, write, and batch operations.
9//! - [`Backend`]: A trait that must be implemented by the durable storage layer.
10//! - `types`: Core data structures like `Intent`, `CommittedVersion`, `ReadGuard`, and `PhysicalWrite`.
11//! - `error`: Precision typed error enums for handling validation and conflict states.
12//!
13//! When the `conformance` feature is enabled, a test macro is exposed for external `Backend` implementers.
14
15/// Storage backend trait and implementations.
16pub mod backend;
17/// Deterministic binary serialization.
18pub mod codec;
19/// The core MVCC engine logic.
20pub mod engine;
21/// Explicit error types.
22pub mod error;
23/// Core types used throughout the library.
24pub mod types;
25
26#[cfg(feature = "conformance")]
27pub mod conformance;
28
29pub use backend::{Backend, InMemoryBackend};
30pub use codec::{decode_committed, decode_intent, encode_committed, encode_intent};
31pub use engine::{
32 GcBudget, GcOptions, GcStats, IncrementalGcCursor, IncrementalGcResult, MvccEngine,
33};
34pub use error::{
35 AbortError, BatchAbortError, BatchCommitError, BatchError, BatchPrewriteError, CodecError,
36 CommitError, GcError, PrewriteError, ReadError,
37};
38pub use types::{
39 CommittedVersion, Intent, Key, Mutation, PhysicalWrite, ReadGuard, Timestamp, TxnId, Value,
40};