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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
//! Socket-address connections.
//!
//! Two Conns project the `std::net::SocketAddr` sum onto its
//! variant-specific subtypes:
//!
//! - [`SOVXSOV4`] — `SocketAddr → Extended<SocketAddrV4>` — extract
//! the V4 variant; V6 inputs saturate above all V4 values.
//! - [`SOVXSOV6`] — `SocketAddr → Extended<SocketAddrV6>` — extract
//! the V6 variant; V4 inputs saturate below all V6 values.
//!
//! The orientation puts the **more-specific** variant type on the
//! right (the natural composition `<chain> → SocketAddr → V4` reads
//! left-to-right toward the projection). All three types implement
//! the same total `Ord` Rust derives for them, so the saturation arms
//! line up cleanly with the Ord-induced lattice: V4 variants sort
//! below all V6 variants, and within each variant Ord is
//! lexicographic over the inner fields.
//!
//! Both Conns ship as one-sided ([`Conn::new_l`] for `SOVXSOV4`,
//! [`Conn::new_r`] for `SOVXSOV6`). The full triple isn't lawful
//! for these projections because the source `SocketAddr`'s MIN/MAX
//! coincides with `inner`'s synthetic-end values, making `inner`
//! non-order-reflecting and forcing a `floor_le_ceil` violation.
//! `new_left`/`new_right` set `floor = ceil` as a fn pointer, so the
//! rounding sandwich holds trivially at the cost of asserting only
//! the constructor's side of Galois (L for `new_left`, R for `new_right`).
use crateConn;
use crateExtended;
use ;
const SOV4_MIN: SocketAddrV4 = new;
/// SocketAddrV6's lex-MAX: highest Ipv6, port, flowinfo, and scope_id.
const
/// `SocketAddr → Extended<SocketAddrV4>` — V4 extraction from the
/// SocketAddr sum.
///
/// One-sided ceil-adjoint Conn ([`Conn::new_l`]): only `ceil ⊣
/// inner` holds (`galois_l`); the right-Galois law does not. The
/// full triple isn't lawful for this projection because the source
/// SocketAddr's MIN (`V4(0.0.0.0:0)`) coincides with `inner(NegInf
/// rung)`, making `inner` non-order-reflecting at the bottom and
/// forcing a `floor_le_ceil` violation. `new_left` sets `floor =
/// ceil` as a fn pointer, sidestepping the violation.
///
/// V4 inputs project to `Finite(addr)` except at the source MIN
/// where Galois forces `ceil(V4(0.0.0.0:0)) = NegInf`. V6 inputs
/// saturate up to `PosInf` (above all V4 in the coproduct order).
///
/// # Examples
///
/// ```rust
/// use connections::addr::socket::SOVXSOV4;
/// use connections::extended::Extended;
/// use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
///
/// let v4 = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 80);
/// assert_eq!(SOVXSOV4.ceil(SocketAddr::V4(v4)), Extended::Finite(v4));
///
/// // V6 input saturates above all V4 values.
/// let v6 = SocketAddrV6::new(Ipv6Addr::LOCALHOST, 80, 0, 0);
/// assert_eq!(SOVXSOV4.ceil(SocketAddr::V6(v6)), Extended::PosInf);
///
/// // SOVXSOV4 is a one-sided ConnL — no `.floor()` method exists.
/// // `inner` is the surviving lower-side accessor for the L-pair.
/// let _: SocketAddr = SOVXSOV4.upper(Extended::Finite(v4));
/// ```
pub const SOVXSOV4: crateConn = ;
/// `SocketAddr → Extended<SocketAddrV6>` — V6 extraction from the
/// SocketAddr sum.
///
/// One-sided floor-adjoint Conn ([`Conn::new_r`]): only `inner ⊣
/// floor` holds (`galois_r`); the left-Galois law does not. The
/// full triple isn't lawful here because the source SocketAddr's MAX
/// (`V6(SOV6_MAX)`) coincides with `inner(PosInf rung)`, making
/// `inner` non-order-reflecting at the top and forcing a
/// `floor_le_ceil` violation. `new_right` sets `ceil = floor` as a fn
/// pointer, sidestepping the violation.
///
/// V6 inputs project to `Finite(addr)` except at the source MAX
/// where Galois forces `floor(V6(MAX)) = PosInf`. V4 inputs saturate
/// down to `NegInf` (below all V6 in the coproduct order).
///
/// # Examples
///
/// ```rust
/// use connections::addr::socket::SOVXSOV6;
/// use connections::extended::Extended;
/// use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
///
/// let v6 = SocketAddrV6::new(Ipv6Addr::LOCALHOST, 80, 0, 0);
/// assert_eq!(SOVXSOV6.floor(SocketAddr::V6(v6)), Extended::Finite(v6));
///
/// // V4 input saturates below all V6 values.
/// let v4 = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 80);
/// assert_eq!(SOVXSOV6.floor(SocketAddr::V4(v4)), Extended::NegInf);
///
/// // SOVXSOV6 is a one-sided ConnR — no `.ceil()` method exists.
/// // `inner` is the surviving lower-side accessor for the R-pair.
/// let _: SocketAddr = SOVXSOV6.lower(Extended::Finite(v6));
/// ```
pub const SOVXSOV6: crateConn = ;