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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
//! The command families each executor offers, held in one list.
//!
//! Four types execute commands — [`Client`](crate::client::Client),
//! [`ExclusiveClient`](crate::client::ExclusiveClient),
//! [`Pipeline`](crate::client::Pipeline) and
//! [`Transaction`](crate::client::Transaction) — and each used to carry its own
//! hand-written block of empty `impl`s. Nothing checked the four against each
//! other, so a family added to the client and forgotten in the batch executors
//! compiled fine and failed at the call site: that is exactly how the whole
//! vector-set family came to be unusable in a pipeline or a transaction.
//!
//! The 22 data families live in [`data_command_families`] and are written once.
//! What each executor adds on top is named at its own call site, so the
//! differences between the four surfaces are a short list to read rather than
//! four long lists to diff.
/// Invokes `$mac` with `$ty`, the 22 data command families, and any extra
/// families the call site names.
///
/// These are the families that are meaningful on every executor: they read and
/// write data and nothing else. A new command family belongs here unless it
/// steers the connection or the topology, in which case it goes in the extras
/// of the executors that can honour it.
/// Implements each named family for `&'a $ty` — the executors that send a
/// command as soon as it is awaited.
/// Implements each named family for `&'a mut $ty` — the batch executors, whose
/// `queue`/`forget` need a unique borrow.
///
/// The receiver is what makes this a separate macro rather than an argument:
/// `BatchPreparedCommand` is implemented for `PreparedCommand<'a, &'a mut _, R>`,
/// so a family implemented for the shared reference compiles here and then fails
/// to resolve `.queue()`.
/// Implements every command family a client offers, for `&$ty`.
///
/// [`Client`](crate::client::Client) and
/// [`ExclusiveClient`](crate::client::ExclusiveClient) must offer exactly the
/// same commands apart from the two families reserved to an exclusive
/// connection — [`BlockingCommands`](crate::commands::BlockingCommands) and
/// [`TransactionCommands`](crate::commands::TransactionCommands), which are
/// implemented on the exclusive client alone.
///
/// Over the data families a client adds four: cluster and connection management,
/// the internal pub/sub commands the subscription API is built on, and the
/// sentinel ones. `DebugCommands` and `InternalCommands` are test-only here and
/// are not part of the published surface.
/// Implements every command family a pipeline offers, for `&mut $ty`.
///
/// The connection family is here for one command in particular: `CLIENT REPLY
/// OFF` … `CLIENT REPLY ON` around a run of writes is the bulk-load idiom a
/// pipeline exists for, and the suppressed replies are what each command's
/// `forget()` accounts for in the positional matching. The cluster family comes
/// along as introspection that is meaningful mid-batch.
///
/// Neither the pub/sub nor the sentinel family is here. A subscription is
/// answered by push frames rather than by a reply in the batch, and a sentinel
/// command queued on a pipeline would go to the data connection, which is not a
/// sentinel.
/// Implements every command family a transaction offers, for `&mut $ty`.
///
/// The data families and nothing else, which is where a transaction parts
/// company with a pipeline. `CLIENT REPLY`, the reason the connection family is
/// on a pipeline, means nothing inside `MULTI`: every reply is delivered at once
/// in `EXEC`'s array, so there is no per-command reply to suppress. The rest of
/// that family either discards the block outright (`RESET`) or changes the state
/// the queued commands were written against (`SELECT`, `AUTH`).
pub use ;