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
//! Type-erased connection handle for the HTTP client.
//!
//! The pool and request orchestrator hold `Box<dyn HttpStream + Send>`
//! rather than the runtime-wide `StreamKind` enum. Why: an enum that
//! has both a TCP and a TLS arm pulls in *both* arms' drop glue at any
//! reachable drop site, which forces rustls's per-connection drop
//! chain into the final binary even when no Seq program uses
//! `net.http.*` or `net.tls.client`. (See `docs/design/done/NO_DEAD_CODE.md`
//! and the PR4 review thread.)
//!
//! A trait object decouples the two: the vtable for the TLS-wrapped
//! stream is emitted only inside `tls::dial_tls`, which is itself
//! unreachable from a hello-world binary. `--gc-sections` then strips
//! the rustls types out cleanly.
//!
//! All read/write operations dispatch through the vtable. The extra
//! indirection is one nanosecond per call — negligible against the
//! micro-to-millisecond latency of a TCP/TLS round-trip.
use ;
use RawFd;
/// What the HTTP client needs from a connection: byte stream IO plus
/// the underlying TCP fd (for the pool's half-closed peek).
pub
pub type Conn = ;