The generator will be asked to produce buffers. The consuming code will signal how much of the data has been consumed, and repeatedly query for buffers until no more data is available, or the generator indicates an error condition.
In this way, serializers can be adapted as [*BuffersGenerator], for example [link beast.ref.boost__beast__http__message_generator `http::message_generator`] which provides a type-erased interface for a variety of concrete http message types.
Overloads of [link beast.ref.boost__beast__write `write`] and [link beast.ref.boost__beast__async_write `async_write`] operations are provided as free functions. These operations will consume the output of a [*BuffersGenerator] and process the data by writing them to a __SyncWriteStream__ or __AsyncWriteStream__ respectively.
* `G` denotes a type meeting the requirements of [*BuffersGenerator]. * `g` denotes a value of type `G`. * `c` denotes a possibly-const value of type `G`. * `n` is a value of type `std::size_t`. * `ec` is a value of type [link beast.ref.boost__beast__error_code `error_code&`].
Called to ask the generator for its completion status. A generator has completed when no new buffer will be produced and previously produced buffers have been fully consumed. [*Note:] The result of invoking `prepare` on `g` once it has completed is unspecified.