pub struct Connected<'a> {
pub id: ConnectionId,
pub uri: &'a Uri,
pub remote: Option<SocketAddr>,
pub version: Version,
pub timing: ConnectTiming,
}Expand description
A connection was established.
Fields§
§id: ConnectionId§uri: &'a UriThe URI whose request paid for this connection, as the transport received it — absolute, before any protocol rewrote it.
remote: Option<SocketAddr>The address that answered. One of possibly several tried: RFC 8305 races address families, and this is the winner, not the first candidate.
None where the connection has no IP address, which today
means a Unix-domain socket
(hclient_native::Native::unix_socket): there was no name, no
family to race and no port. It is an Option rather than a
fabricated 0.0.0.0:0 for Head::version’s reason one event over
— a sentinel that is also an ordinary value gives a hook a wrong
answer where the absence gives it a missing one, and only the
second can be handled.
The alternative was to emit no Connected at all for such a
connection, and it is worse: the Closed that follows would
announce the end of a connection whose beginning was never
announced, which is exactly the defect recorded for building a
Closed::Failed out of wasi:http’s error codes.
version: VersionWhat will be spoken on it, as negotiated — not as offered.
timing: ConnectTiming