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
use fmt;
use Formatter;
use Deref;
/// Unique identifier for an inflight replication request.
///
/// Each time the leader sends logs or a snapshot to a follower, it assigns an `InflightId`.
/// When the follower responds, the response carries the same `InflightId`, allowing the leader
/// to correctly match responses to their corresponding requests.
///
/// This prevents stale responses from incorrectly updating the progress state. For example,
/// if a slow response from a previous request arrives after a new request has been sent,
/// the mismatched `InflightId` causes the stale response to be ignored.
pub