Skip to content

Commit 8d6c951

Browse files
committed
chore: doc work
1 parent 1a8a81c commit 8d6c951

1 file changed

Lines changed: 35 additions & 40 deletions

File tree

include/boost/http_proto/serializer.hpp

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,13 @@ class serializer
158158
void
159159
reset() noexcept;
160160

161-
/** Prepare the serializer for a new message without a body.
161+
/** Start serializing a message with an empty body
162162
163-
Initializes the serializer with the HTTP
164-
start-line and headers from `m`, and
165-
without a body.
163+
This function prepares the serializer to create a message which
164+
has an empty body.
165+
Ownership of the specified message is not transferred; the caller is
166+
responsible for ensuring the lifetime of the object extends until the
167+
serializer is done.
166168
167169
@par Preconditions
168170
@code
@@ -176,19 +178,15 @@ class serializer
176178
177179
@par Exception Safety
178180
Strong guarantee.
179-
Exceptions thrown if there is insufficient
180-
internal buffer space to start the
181-
operation.
181+
Exceptions thrown if there is insufficient internal buffer space
182+
to start the operation.
182183
183-
@throw std::logic_error
184-
`this->is_done() == true`.
184+
@throw std::logic_error `this->is_done() == true`.
185185
186-
@throw std::length_error if there is
187-
insufficient internal buffer space to
188-
start the operation.
186+
@throw std::length_error if there is insufficient internal buffer
187+
space to start the operation.
189188
190-
@param m The message to read the HTTP
191-
start-line and headers from.
189+
@param m The request or response headers to serialize.
192190
193191
@see
194192
@ref message_base.
@@ -197,17 +195,19 @@ class serializer
197195
BOOST_HTTP_PROTO_DECL
198196
start(message_base const& m);
199197

200-
/** Prepare the serializer for a new message with a ConstBufferSequence body.
198+
/** Start serializing a message with a buffer sequence body
201199
202-
Initializes the serializer with the HTTP
203-
start-line and headers from `m`, and the
204-
provided `buffers` for reading the
205-
message body from.
200+
Initializes the serializer with the HTTP start-line and headers from `m`,
201+
and the provided `buffers` for reading the message body from.
206202
207-
Changing the contents of the message
208-
after calling this function and before
209-
@ref is_done returns `true` results in
210-
undefined behavior.
203+
Changing the contents of the message after calling this function and
204+
before @ref is_done returns `true` results in undefined behavior.
205+
206+
At least one copy of the specified buffer sequence is maintained until
207+
the serializer is done, gets reset, or ios destroyed, after which all
208+
of its copies are destroyed. Ownership of the underlying memory is not
209+
transferred; the caller must ensure the memory remains valid until the
210+
serializer’s copies are destroyed.
211211
212212
@par Preconditions
213213
@code
@@ -221,26 +221,23 @@ class serializer
221221
222222
@par Constraints
223223
@code
224-
buffers::is_const_buffer_sequence<ConstBufferSequence>::value == true
224+
buffers::is_const_buffer_sequence_v<ConstBufferSequence> == true
225225
@endcode
226226
227227
@par Exception Safety
228228
Strong guarantee.
229-
Exceptions thrown if there is insufficient
230-
internal buffer space to start the
231-
operation.
229+
Exceptions thrown if there is insufficient internal buffer space
230+
to start the operation.
232231
233-
@throw std::logic_error
234-
`this->is_done() == true`.
232+
@throw std::logic_error `this->is_done() == true`.
235233
236-
@throw std::length_error if there is
237-
insufficient internal buffer space to
238-
start the operation.
234+
@throw std::length_error If there is insufficient internal buffer
235+
space to start the operation.
239236
240-
@param m The message to read the HTTP
241-
start-line and headers from.
237+
@param m The message to read the HTTP start-line and headers from.
238+
239+
@param buffers A buffer sequence containing the message body.
242240
243-
@param buffers One or more buffers
244241
containing the message body data. While
245242
the buffers object is copied, ownership of
246243
the underlying memory remains with the
@@ -261,12 +258,10 @@ class serializer
261258
message_base const& m,
262259
ConstBufferSequence&& buffers);
263260

264-
/** Prepare the serializer for a new message with a Source body.
261+
/** Start serializing a message with a @em Source body
265262
266-
Initializes the serializer with the
267-
HTTP start-line and headers from `m`,
268-
and constructs a `Source` object to read
269-
the message body.
263+
Initializes the serializer with the HTTP start-line and headers from
264+
`m`, and constructs a `Source` object to provide the message body.
270265
271266
Changing the contents of the message
272267
after calling this function and before

0 commit comments

Comments
 (0)