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
//! API to consumer a response when a client write request is completed.
pub
pub use OneshotResponder;
use crateClientWriteResult;
use crateOptionalSend;
use crateRaftTypeConfig;
/// A trait that lets `RaftCore` send the response or an error of a client write request back to the
/// client or to somewhere else.
///
/// It is created for each request [`AppData`], and is sent to `RaftCore`.
/// Once the request is completed,
/// the `RaftCore` send the result [`ClientWriteResult`] via it.
/// The implementation of the trait then forward the response to application.
/// There could optionally be a receiver to wait for the response.
///
/// Usually an implementation of [`Responder`] is a oneshot channel Sender,
/// and [`Responder::Receiver`] is a oneshot channel Receiver.
///
/// [`AppData`]: `crate::AppData`