1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! # IronWal
//!
//! `ironwal` is a high-durability, deterministic Write-Ahead Log designed for
//! systems of record such as financial ledgers and game state synchronization.
//!
//! It prioritizes data integrity, precise replication control, and predictable
//! resource usage.
//!
//! ## Key Features
//!
//! * **Deterministic Storage**: Stream keys map to explicit directories.
//! * **Hybrid Compression**: Frames are compressed (LZ4) or raw based on batch size.
//! * **Integrity**: CRC32 checksums on every frame.
//! * **Resource Safety**: Strict LRU management of open file descriptors.
//! * **Manual Pruning**: Cursor-based truncation for safe replication.
//!
//! ## Example
//!
//! ```no_run
//! use ironwal::{Wal, WalOptions};
//!
//! # fn main() -> ironwal::Result<()> {
//! let wal = Wal::new(WalOptions::default())?;
//!
//! // Atomic append
//! let id = wal.append("user_ledger", b"transaction_data")?;
//!
//! // Batch append
//! let ids = wal.append_batch("user_ledger", &[b"tx_1", b"tx_2"])?;
//! # Ok(())
//! # }
//! ```
// Sharded WAL extension (optional feature)
// Re-exports for the flat public API
pub use TxnWriter;
pub use ;
pub use ;
pub use Wal;