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
use *;
/// A transport that carries an HTTP/2 or HTTP/3 request stream to the pipeline.
///
/// HTTP/2 and HTTP/3 deliver a request as a bidirectional stream, and the
/// framework pipeline writes HTTP/1.1 shaped bytes onto it: a status line, a
/// header block, then body bytes. A duplex pipe joins the two halves: the
/// lifecycle writes into one end exactly as it would write to a socket, and a
/// concurrent pump reads the other end, frames the head once it is complete and
/// forwards every following chunk as a data frame. A handler that flushes
/// progressively therefore reaches the client before it returns, which a sink
/// that collected everything and framed it afterwards could not do.
///
/// The transport itself performs no framing. It only exposes the pipe to the
/// framework and reports the addresses of the connection carrying it.
pub
/// Wraps a TLS session so it satisfies the framework transport contract.
///
/// An HTTP/1.1 request over TLS must present the same `Stream` surface as a
/// plaintext one, so the negotiated session is carried with the address
/// information the framework reads from it. The session is the real socket,
/// so keep alive, upgrades and raw writes behave exactly as they do in
/// plaintext.
pub
/// The environment one accepted connection is served in.
///
/// Every protocol path needs the same three things: the server whose pipeline
/// runs each request, the parsing limits and read timeouts those requests are
/// bounded by, and the protocol this connection is served as. Carried as one
/// value they stop being the same three parameters repeated in the same order at
/// every layer.
///
/// The server handle is held in an `Arc` exactly as before: one clone per spawned
/// connection, and one per request task, which is the count the previous
/// signature already forced. `Clone` copies the handle and adds one to the number
/// of existing clones of that `Arc`. The other two fields are `Copy`, so they are
/// carried by value.
pub
/// The addresses of the connection carrying one request stream.
///
/// The duplex transport reports these to the framework, so a handler that reads
/// them sees the real connection rather than a fabricated one. They are the same
/// two values on every protocol path and the duplex transport is always built
/// from both, so they travel together.
pub