@@ -125,15 +125,30 @@ public struct HTTPRequestHead: Equatable {
125
125
126
126
extension HTTPRequestHead : @unchecked Sendable { }
127
127
128
- /// The parts of a complete HTTP message, either request or response.
129
- ///
130
- /// A HTTP message is made up of a request or status line with several headers,
131
- /// encoded by `.head`, zero or more body parts, and optionally some trailers. To
132
- /// indicate that a complete HTTP message has been sent or received, we use `.end`,
133
- /// which may also contain any trailers that make up the message.
128
+ /// The parts of a complete HTTP message, representing either a request or a response.
129
+ ///
130
+ /// An HTTP message is made up of:
131
+ /// - a request or status line with several headers, encoded by a single ``HTTPPart/head(_:)`` part,
132
+ /// - zero or more ``HTTPPart/body(_:)`` parts,
133
+ /// - and some optional trailers (represented as headers) in a single ``HTTPPart/end(_:)`` part.
134
+ ///
135
+ /// To indicate that a complete HTTP message has been sent or received,
136
+ /// an ``HTTPPart/end(_:)`` part must be used, even when no trailers are included.
134
137
public enum HTTPPart < HeadT: Equatable , BodyT: Equatable > {
138
+ /// The headers of an HTTP request or response.
139
+ ///
140
+ /// A single part is always used to encode all headers.
135
141
case head( HeadT )
142
+
143
+ /// A part of an HTTP request or response's body.
144
+ ///
145
+ /// Zero or more body parts can be sent or received. The stream is finished when
146
+ /// an ``HTTPPart/end(_:)`` part is received.
136
147
case body( BodyT )
148
+
149
+ /// The end of an HTTP request or response, optionally containing trailers.
150
+ ///
151
+ /// A single part is always used to encode all trailers.
137
152
case end( HTTPHeaders ? )
138
153
}
139
154
0 commit comments