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
//! **The three gestures a foot may send, and the answers it may receive**
//! (yog's `docs/REMOTE.md` §4.2, §5.1, §5.3).
//!
//! REMOTE §4.2 enumerates the foot set outright — *"`advertise`, `invocations`
//! and `complete`. No other `Query`, no other `Action`"* — and this file is
//! that enumeration in code. A foot cannot ask *about the world* and cannot act
//! *on the world*; what it may do is answer for the machine it is. **Note which
//! of the routing leg's four verbs is absent: `invoke`, the asking side's. A
//! foot is invoked; it never invokes.**
//!
//! So the enumeration is the enforcement thrall can keep. The real enforcement
//! is the engine's — it is the party that can be trusted to hold it — but a
//! foot with no spelling for a fourth verb cannot send one by accident, and
//! adding one here would be a visible act rather than a slip.
//!
//! **None of the three names a client, and that is the gesture** (REMOTE §5.1).
//! The identity a set lands under, the queue a read drains and the invocation a
//! completion answers are all the *intake's* — the connection's certificate
//! common name. A `client` field on the wire would let any connection overwrite
//! or drain any other's, which is the authorization the certificate has already
//! decided.
//!
//! **The wire adds nothing to the boundary** (REMOTE §3), so these are ordinary
//! gestures in the ordinary envelope: `op` the discriminant, every parameter a
//! named field. There is no wire-only verb, no envelope and no field here that
//! a seat could not type.
use ;
use crate;
use cratestr_of;
use crate;
/// **Present what this box offers** (REMOTE §5.1): one field, `tools`, an array
/// whose element is exactly three facts.
/// **Wait for this machine's next work** (REMOTE §5.3): the follow-class read,
/// and where a foot spends nearly all of its life. It carries no field at all —
/// a connection drains its own queue.
/// **Answer exactly one invocation** (REMOTE §5.3), quoting the handle it was
/// minted under and carrying the capture in its one spelling.
/// What an engine can answer a foot. Three kinds, because there are three
/// gestures — plus the refusal every gesture can earn.
///
/// A refusal is not an error *here*: the engine spoke, and what it said is that
/// it will not do the thing. Whether that ends the loop is the loop's decision
/// (see [`run`](crate::run)), not the decoder's.
/// Read one reply frame: the outer `Err` is bytes this decoder cannot read at
/// all, and the inner `Err` is the refusal the envelope faithfully carried.
///
/// **The refusal is the envelope with no `kind`.** `ok` cannot be the
/// discriminant — a reply may faithfully report something that failed — so a
/// body carrying a `kind` is an answer, and a body carrying none must be
/// `{"ok": false, "error": …}`.
///
/// **A kind this foot has no use for is an error and not a shrug.** The three
/// above are the only answers the three gestures can earn; anything else means
/// the engine answered a question nobody here asked, and continuing on it would
/// be guessing.
/// The kind-less envelope: a refusal, and nothing else may wear that shape.
/// The follow-class read's rows.
/// One invocation's standing. `capture` is **absent** rather than empty while
/// the work is still out, so a reader never has to tell "not finished" from
/// "finished saying nothing".