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
//! Write-Ahead Log (WAL) module that provides interfaces for durable logging.
//!
//! The WAL is a critical component for maintaining data consistency and
//! durability in distributed systems. It ensures that all state changes are
//! first recorded persistently before being applied, enabling:
//!
//! - Crash recovery: System can recover its state by replaying the log
//! - Consistency: Ordered record of all state transitions
//! - Durability: Persistent storage of operations
//!
//! This module defines the core WAL trait that implementations must satisfy.
use io;
use crateSegment;
/// Write-Ahead Log (WAL) trait that provides durability and consistency
/// guarantees for state machine operations.
///
/// The WAL ensures that all modifications are first recorded in a sequential
/// log before being applied to the state machine. This provides crash recovery
/// and helps maintain data consistency.
///
/// Type parameter `R` represents the record type that will be stored in the
/// log.