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
use crateRaftTypeConfig;
use crateStorageError;
/// Unrecoverable error that stops the Raft node.
///
/// `RaftCore`, the task that runs the protocol, stops with a `Fatal` error. API calls on the
/// stopped node return that error, and [`RaftMetrics::running_state`] holds it. An application
/// that gets a `Fatal` error should take the node out of service and shut it down with
/// [`Raft::shutdown`]. Getting the error does not mean that the node's tasks have exited, and a
/// shutdown joins only the `RaftCore` task.
///
/// # Variants
///
/// - `StorageError`: Underlying storage (log or state machine) encountered an error
/// - `Panicked`: Raft core task panicked due to a programming error
/// - `Stopped`: Raft core task stopped for another reason, such as a shutdown or the drop of every
/// `Raft` handle
///
/// [`Raft::shutdown`]: crate::Raft::shutdown
/// [`RaftMetrics::running_state`]: crate::RaftMetrics::running_state