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
//! State machine abstraction for applying records in a deterministic order.
use Debug;
use crateChunkId;
use crateSegment;
/// A trait representing a state machine of [`WAL`] that can apply records to
/// modify its state.
///
/// The Raft-log follows a Write-Ahead Log (WAL) + State Machine pattern. This
/// trait defines the state machine component that processes records persisted
/// in the WAL to build and maintain application state.
///
/// # Type Parameters
/// * `R` - The type of records that can be applied to the state machine
///
/// [`WAL`]: crate::api::wal::WAL