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
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2026 DeRec Alliance. All rights reserved.
//! What a handler needs to know beyond the stores: who this device is, and
//! which exchange it is answering.
//!
//! Three groupings, split by how long each stays true rather than by which
//! flow uses it. [`Local`] is fixed for the life of a protocol instance,
//! [`Exchange`] describes one request/response pair on one channel, and
//! [`PairingConfig`] carries what a peer is told at pairing time and is
//! meaningless outside it.
use crateTransportPolicy;
use crate;
use TransportProtocol;
use HashMap;
/// Identity and configuration constant for the lifetime of a protocol
/// instance.
///
/// Every handler takes this whether or not it reads all five fields, for the
/// same reason it takes every store: the shape of a signature should not
/// encode which values a flow happens to need today.
pub
/// One request/response exchange on one channel.
///
/// Split from [`Local`] because a channel is not instance-wide: the flows
/// that open one (`start`, `restore`, `tear_down`) have no channel or key
/// yet, and folding these in would make all three fields `Option` and lie
/// about every one of them.
pub
/// What one [`DeRecProtocol::start`](crate::protocol::DeRecProtocol::start)
/// call needs to address and identify itself.
///
/// A round is every request a single `start` dispatches. Both fields are
/// properties of the round rather than of any one request in it, which is why
/// they travel together: every target is told the same place to reply, and
/// every target is sent the same token.
///
/// Split from [`Exchange`] because that describes an exchange already under
/// way — it has a `channel_id` and a key. A round has neither when it begins,
/// and a fan-out never has just one.
pub
/// What a peer is validated against at pairing time.
///
/// Separate from [`Local`] because it is read by the pairing entry points
/// alone; the other flows would carry a field they can never use.
pub
/// Borrow a [`DeRecProtocol`]'s identity into a [`Local`].
///
/// Reads `unsafe_connection` directly rather than calling `transport_policy()`:
/// that method borrows the whole protocol, which would collide with the
/// store borrows [`borrow_stores!`](crate::protocol::stores::borrow_stores)
/// takes in the same call. Copying one `bool` field keeps the two disjoint.
///
/// [`DeRecProtocol`]: crate::protocol::DeRecProtocol
/// Borrow a [`DeRecProtocol`]'s pairing-time configuration.
///
/// [`DeRecProtocol`]: crate::protocol::DeRecProtocol
pub use local;
pub use pairing_config;