1
2[section:boost__beast__async_base async_base]
3
4Base class to assist writing composed operations.
5[heading Synopsis]
6Defined in header [include_file boost/beast/core/async_base.hpp]
7
8```
9template<
10    class __Handler__,
11    class __Executor1__,
12    class __Allocator__ = std::allocator<void>>
13class async_base
14```
15
16[heading Types]
17[table [[Name][Description]]
18  [
19    [[*[link beast.ref.boost__beast__async_base.allocator_type allocator_type]]
20    ]
21    [
22
23The type of allocator associated with this object.
24    ]
25  ]
26  [
27    [[*[link beast.ref.boost__beast__async_base.executor_type executor_type]]
28    ]
29    [
30
31The type of executor associated with this object.
32    ]
33  ]
34]
35[heading Member Functions]
36[table [[Name][Description]]
37  [
38    [[*[link beast.ref.boost__beast__async_base.async_base async_base]]
39    ]
40    [
41
42Constructor.
43
44Move Constructor.
45
46    ]
47  ]
48  [
49    [[*[link beast.ref.boost__beast__async_base.complete complete]]
50    ]
51    [
52
53Invoke the final completion handler, maybe using post.
54    ]
55  ]
56  [
57    [[*[link beast.ref.boost__beast__async_base.complete_now complete_now]]
58    ]
59    [
60
61Invoke the final completion handler.
62    ]
63  ]
64  [
65    [[*[link beast.ref.boost__beast__async_base.get_allocator get_allocator]]
66    ]
67    [
68
69Returns the allocator associated with this object.
70    ]
71  ]
72  [
73    [[*[link beast.ref.boost__beast__async_base.get_executor get_executor]]
74    ]
75    [
76
77Returns the executor associated with this object.
78    ]
79  ]
80  [
81    [[*[link beast.ref.boost__beast__async_base.handler handler]]
82    ]
83    [
84
85Returns the handler associated with this object.
86    ]
87  ]
88  [
89    [[*[link beast.ref.boost__beast__async_base.operator_eq_ operator=]]
90    ]
91    [
92
93    ]
94  ]
95  [
96    [[*[link beast.ref.boost__beast__async_base.release_handler release_handler]]
97    ]
98    [
99
100Returns ownership of the handler associated with this object.
101    ]
102  ]
103  [
104    [[*[link beast.ref.boost__beast__async_base._async_base ~async_base]]
105    ]
106    [
107
108    ]
109  ]
110]
111[heading Description]
112A function object submitted to intermediate initiating functions during a composed operation may derive from this type to inherit all of the boilerplate to forward the executor, allocator, and legacy customization points associated with the completion handler invoked at the end of the composed operation.
113The composed operation must be typical; that is, associated with one executor of an I/O object, and invoking a caller-provided completion handler when the operation is finished. Classes derived from [link beast.ref.boost__beast__async_base `async_base`] will acquire these properties:
114
115* Ownership of the final completion handler provided upon construction.
116
117* If the final handler has an associated allocator, this allocator will be propagated to the composed operation subclass. Otherwise, the associated allocator will be the type specified in the allocator template parameter, or the default of `std::allocator<void>` if the parameter is omitted.
118
119* If the final handler has an associated executor, then it will be used as the executor associated with the composed operation. Otherwise, the specified `Executor1` will be the type of executor associated with the composed operation.
120
121* An instance of `net::executor_work_guard` for the instance of `Executor1` shall be maintained until either the final handler is invoked, or the operation base is destroyed, whichever comes first.
122
123* Calls to the legacy customization points `asio_handler_invoke`, `asio_handler_allocate`, `asio_handler_deallocate`, and `asio_handler_is_continuation`, which use argument-dependent lookup, will be forwarded to the legacy customization points associated with the handler.
124
125[heading Example]
126
127The following code demonstrates how [link beast.ref.boost__beast__async_base `async_base`] may be be used to assist authoring an asynchronous initiating function, by providing all of the boilerplate to manage the final completion handler in a way that maintains the allocator and executor associations:
128
129```
130// Asynchronously read into a buffer until the buffer is full, or an error occurs
131template<class AsyncReadStream, class ReadHandler>
132typename net::async_result<ReadHandler, void(error_code, std::size_t)>::return_type
133async_read(AsyncReadStream& stream, net::mutable_buffer buffer, ReadHandler&& handler)
134{
135    using handler_type = BOOST_ASIO_HANDLER_TYPE(ReadHandler, void(error_code, std::size_t));
136    using base_type = async_base<handler_type, typename AsyncReadStream::executor_type>;
137
138    struct op : base_type
139    {
140        AsyncReadStream& stream_;
141        net::mutable_buffer buffer_;
142        std::size_t total_bytes_transferred_;
143
144        op(
145            AsyncReadStream& stream,
146            net::mutable_buffer buffer,
147            handler_type& handler)
148            : base_type(std::move(handler), stream.get_executor())
149            , stream_(stream)
150            , buffer_(buffer)
151            , total_bytes_transferred_(0)
152        {
153            (*this)({}, 0, false); // start the operation
154        }
155
156        void operator()(error_code ec, std::size_t bytes_transferred, bool is_continuation = true)
157        {
158            // Adjust the count of bytes and advance our buffer
159            total_bytes_transferred_ += bytes_transferred;
160            buffer_ = buffer_ + bytes_transferred;
161
162            // Keep reading until buffer is full or an error occurs
163            if(! ec && buffer_.size() > 0)
164                return stream_.async_read_some(buffer_, std::move(*this));
165
166            // Call the completion handler with the result. If `is_continuation` is
167            // false, which happens on the first time through this function, then
168            // `net::post` will be used to call the completion handler, otherwise
169            // the completion handler will be invoked directly.
170
171            this->complete(is_continuation, ec, total_bytes_transferred_);
172        }
173    };
174
175    net::async_completion<ReadHandler, void(error_code, std::size_t)> init{handler};
176    op(stream, buffer, init.completion_handler);
177    return init.result.get();
178}
179```
180
181Data members of composed operations implemented as completion handlers do not have stable addresses, as the composed operation object is move constructed upon each call to an initiating function. For most operations this is not a problem. For complex operations requiring stable temporary storage, the class [link beast.ref.boost__beast__stable_async_base `stable_async_base`] is provided which offers additional functionality:
182
183* The free function [link beast.ref.boost__beast__allocate_stable `allocate_stable`] may be used to allocate one or more temporary objects associated with the composed operation.
184
185* Memory for stable temporary objects is allocated using the allocator associated with the composed operation.
186
187* Stable temporary objects are automatically destroyed, and the memory freed using the associated allocator, either before the final completion handler is invoked (a Networking requirement) or when the composed operation is destroyed, whichever occurs first.
188
189[heading Temporary Storage Example]
190
191The following example demonstrates how a composed operation may store a temporary object.
192
193```
194```
195
196
197[heading Template Parameters]
198[table [[Type][Description]]
199  [
200    [`Handler`
201    ]
202    [
203The type of the completion handler to store. This type must meet the requirements of ['CompletionHandler].
204    ]
205  ]
206  [
207    [`Executor1`
208    ]
209    [
210The type of the executor used when the handler has no associated executor. An instance of this type must be provided upon construction. The implementation will maintain an executor work guard and a copy of this instance.
211    ]
212  ]
213  [
214    [`Allocator`
215    ]
216    [
217The allocator type to use if the handler does not have an associated allocator. If this parameter is omitted, then `std::allocator<void>` will be used. If the specified allocator is not default constructible, an instance of the type must be provided upon construction.
218    ]
219  ]
220]
221[heading See Also]
222[link beast.ref.boost__beast__stable_async_base `stable_async_base`]
223
224[section:executor_type async_base::executor_type]
225[indexterm2 executor_type..async_base]
226
227
228The type of executor associated with this object.
229[heading Synopsis]
230```
231using executor_type = ``['implementation-defined]``;
232```
233
234[heading Description]
235If a class derived from [link beast.ref.boost__beast__async_base `async_base`] is a completion handler, then the associated executor of the derived class will be this type.
236
237[endsect]
238
239[section:allocator_type async_base::allocator_type]
240[indexterm2 allocator_type..async_base]
241
242
243The type of allocator associated with this object.
244[heading Synopsis]
245```
246using allocator_type = net::associated_allocator_t< Handler, Allocator >;
247```
248
249[heading Description]
250If a class derived from [link beast.ref.boost__beast__async_base `async_base`] is a completion handler, then the associated allocator of the derived class will be this type.
251
252[endsect]
253
254[section:async_base async_base::async_base]
255[indexterm2 async_base..async_base]
256
257
258Constructor.
259```
260template<
261    class __Handler__>
262``[link beast.ref.boost__beast__async_base.async_base.overload1 async_base]``(
263    Handler&& handler,
264    Executor1 const& ex1,
265    Allocator const& alloc = Allocator());
266  ``[''''&raquo;''' [link beast.ref.boost__beast__async_base.async_base.overload1 `more...`]]``
267```
268
269
270Move Constructor.
271```
272``[link beast.ref.boost__beast__async_base.async_base.overload2 async_base]``(
273    async_base&& other);
274  ``[''''&raquo;''' [link beast.ref.boost__beast__async_base.async_base.overload2 `more...`]]``
275```
276
277
278```
279``[link beast.ref.boost__beast__async_base.async_base.overload3 async_base]``(
280    async_base const&);
281  ``[''''&raquo;''' [link beast.ref.boost__beast__async_base.async_base.overload3 `more...`]]``
282```
283
284[section:overload1 async_base::async_base (1 of 3 overloads)]
285
286Constructor.
287[heading Synopsis]
288```
289template<
290    class __Handler__>
291async_base(
292    Handler&& handler,
293    Executor1 const& ex1,
294    Allocator const& alloc = Allocator());
295```
296
297[heading Description]
298
299[heading Parameters]
300[table [[Name][Description]]
301  [
302    [`handler`
303    ]
304    [
305The final completion handler. The type of this object must meet the requirements of ['CompletionHandler]. The implementation takes ownership of the handler by performing a decay-copy.
306    ]
307  ]
308  [
309    [`ex1`
310    ]
311    [
312The executor associated with the implied I/O object target of the operation. The implementation shall maintain an executor work guard for the lifetime of the operation, or until the final completion handler is invoked, whichever is shorter.
313    ]
314  ]
315  [
316    [`alloc`
317    ]
318    [
319The allocator to be associated with objects derived from this class. If `Allocator` is default-constructible, this parameter is optional and may be omitted.
320    ]
321  ]
322]
323
324[endsect]
325
326[section:overload2 async_base::async_base (2 of 3 overloads)]
327
328Move Constructor.
329[heading Synopsis]
330```
331async_base(
332    async_base&& other);
333```
334
335[heading Description]
336
337[endsect]
338
339[section:overload3 async_base::async_base (3 of 3 overloads)]
340
341[heading Synopsis]
342```
343async_base(
344    async_base const&);
345```
346
347[heading Description]
348
349[endsect]
350
351
352[endsect]
353
354[section:_async_base async_base::~async_base]
355[indexterm2 ~async_base..async_base]
356
357
358[heading Synopsis]
359```
360virtual
361~async_base();
362```
363
364[heading Description]
365
366[endsect]
367
368[section:operator_eq_ async_base::operator=]
369[indexterm2 operator=..async_base]
370
371
372[heading Synopsis]
373```
374async_base&
375operator=(
376    async_base const&);
377```
378
379[heading Description]
380
381[endsect]
382
383[section:get_allocator async_base::get_allocator]
384[indexterm2 get_allocator..async_base]
385
386
387Returns the allocator associated with this object.
388[heading Synopsis]
389```
390allocator_type
391get_allocator() const;
392```
393
394[heading Description]
395If a class derived from [link beast.ref.boost__beast__async_base `async_base`] is a completion handler, then the object returned from this function will be used as the associated allocator of the derived class.
396
397[endsect]
398
399[section:get_executor async_base::get_executor]
400[indexterm2 get_executor..async_base]
401
402
403Returns the executor associated with this object.
404[heading Synopsis]
405```
406executor_type
407get_executor() const;
408```
409
410[heading Description]
411If a class derived from [link beast.ref.boost__beast__async_base `async_base`] is a completion handler, then the object returned from this function will be used as the associated executor of the derived class.
412
413[endsect]
414
415[section:handler async_base::handler]
416[indexterm2 handler..async_base]
417
418
419Returns the handler associated with this object.
420[heading Synopsis]
421```
422Handler const&
423handler() const;
424```
425
426[heading Description]
427
428[endsect]
429
430[section:release_handler async_base::release_handler]
431[indexterm2 release_handler..async_base]
432
433
434Returns ownership of the handler associated with this object.
435[heading Synopsis]
436```
437Handler
438release_handler();
439```
440
441[heading Description]
442This function is used to transfer ownership of the handler to the caller, by move-construction. After the move, the only valid operations on the base object are move construction and destruction.
443
444[endsect]
445
446[section:complete async_base::complete]
447[indexterm2 complete..async_base]
448
449
450Invoke the final completion handler, maybe using post.
451[heading Synopsis]
452```
453template<
454    class... Args>
455void
456complete(
457    bool is_continuation,
458    Args&&... args);
459```
460
461[heading Description]
462This invokes the final completion handler with the specified arguments forwarded. It is undefined to call either of [link beast.ref.boost__beast__async_base.complete `complete`] or [link beast.ref.boost__beast__async_base.complete_now `complete_now`] more than once.
463Any temporary objects allocated with [link beast.ref.boost__beast__allocate_stable `beast::allocate_stable`] will be automatically destroyed before the final completion handler is invoked.
464
465[heading Parameters]
466[table [[Name][Description]]
467  [
468    [`is_continuation`
469    ]
470    [
471If this value is `false`, then the handler will be submitted to the executor using `net::post`. Otherwise the handler will be invoked as if by calling [link beast.ref.boost__beast__async_base.complete_now `complete_now`].
472    ]
473  ]
474  [
475    [`args`
476    ]
477    [
478A list of optional parameters to invoke the handler with. The completion handler must be invocable with the parameter list, or else a compilation error will result.
479    ]
480  ]
481]
482
483[endsect]
484
485[section:complete_now async_base::complete_now]
486[indexterm2 complete_now..async_base]
487
488
489Invoke the final completion handler.
490[heading Synopsis]
491```
492template<
493    class... Args>
494void
495complete_now(
496    Args&&... args);
497```
498
499[heading Description]
500This invokes the final completion handler with the specified arguments forwarded. It is undefined to call either of [link beast.ref.boost__beast__async_base.complete `complete`] or [link beast.ref.boost__beast__async_base.complete_now `complete_now`] more than once.
501Any temporary objects allocated with [link beast.ref.boost__beast__allocate_stable `beast::allocate_stable`] will be automatically destroyed before the final completion handler is invoked.
502
503[heading Parameters]
504[table [[Name][Description]]
505  [
506    [`args`
507    ]
508    [
509A list of optional parameters to invoke the handler with. The completion handler must be invocable with the parameter list, or else a compilation error will result.
510    ]
511  ]
512]
513
514[endsect]
515
516
517[endsect]
518
519[section:boost__beast__http__basic_chunk_extensions http::basic_chunk_extensions]
520
521A set of chunk extensions.
522[heading Synopsis]
523Defined in header [include_file boost/beast/http/chunk_encode.hpp]
524
525```
526template<
527    class __Allocator__>
528class basic_chunk_extensions
529```
530
531[heading Types]
532[table [[Name][Description]]
533  [
534    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.value_type value_type]]
535    ]
536    [
537
538The type of value when iterating.
539    ]
540  ]
541]
542[heading Member Functions]
543[table [[Name][Description]]
544  [
545    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.basic_chunk_extensions basic_chunk_extensions]]
546    ]
547    [
548
549Constructor.
550    ]
551  ]
552  [
553    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.begin begin]]
554    ]
555    [
556
557    ]
558  ]
559  [
560    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.clear clear]]
561    ]
562    [
563
564Clear the chunk extensions.
565    ]
566  ]
567  [
568    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.end end]]
569    ]
570    [
571
572    ]
573  ]
574  [
575    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.insert insert]]
576    ]
577    [
578
579Insert an extension name with an empty value.
580
581Insert an extension value.
582    ]
583  ]
584  [
585    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.parse parse]]
586    ]
587    [
588
589Parse a set of chunk extensions.
590    ]
591  ]
592  [
593    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.str str]]
594    ]
595    [
596
597Return the serialized representation of the chunk extension.
598    ]
599  ]
600]
601[heading Description]
602This container stores a set of chunk extensions suited for use with [link beast.ref.boost__beast__http__chunk_header `chunk_header`] and [link beast.ref.boost__beast__http__chunk_body `chunk_body`]. The container may be iterated to access the extensions in their structured form.
603Meets the requirements of ChunkExtensions
604
605[section:value_type http::basic_chunk_extensions::value_type]
606[indexterm2 value_type..http::basic_chunk_extensions]
607
608
609The type of value when iterating.
610[heading Synopsis]
611```
612using value_type = std::pair< string_view, string_view >;
613```
614
615[heading Description]
616The first element of the pair is the name, and the second element is the value which may be empty. The value is stored in its raw representation, without quotes or escapes.
617
618[endsect]
619
620[section:basic_chunk_extensions http::basic_chunk_extensions::basic_chunk_extensions]
621[indexterm2 basic_chunk_extensions..http::basic_chunk_extensions]
622
623
624Constructor.
625```
626``[link beast.ref.boost__beast__http__basic_chunk_extensions.basic_chunk_extensions.overload1 basic_chunk_extensions]``();
627  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_chunk_extensions.basic_chunk_extensions.overload1 `more...`]]``
628
629``[link beast.ref.boost__beast__http__basic_chunk_extensions.basic_chunk_extensions.overload2 basic_chunk_extensions]``(
630    basic_chunk_extensions&&);
631  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_chunk_extensions.basic_chunk_extensions.overload2 `more...`]]``
632
633``[link beast.ref.boost__beast__http__basic_chunk_extensions.basic_chunk_extensions.overload3 basic_chunk_extensions]``(
634    basic_chunk_extensions const&);
635  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_chunk_extensions.basic_chunk_extensions.overload3 `more...`]]``
636
637explicit
638``[link beast.ref.boost__beast__http__basic_chunk_extensions.basic_chunk_extensions.overload4 basic_chunk_extensions]``(
639    Allocator const& allocator);
640  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_chunk_extensions.basic_chunk_extensions.overload4 `more...`]]``
641```
642
643[section:overload1 http::basic_chunk_extensions::basic_chunk_extensions (1 of 4 overloads)]
644
645Constructor.
646[heading Synopsis]
647```
648basic_chunk_extensions();
649```
650
651[heading Description]
652
653[endsect]
654
655[section:overload2 http::basic_chunk_extensions::basic_chunk_extensions (2 of 4 overloads)]
656
657Constructor.
658[heading Synopsis]
659```
660basic_chunk_extensions(
661    basic_chunk_extensions&&);
662```
663
664[heading Description]
665
666[endsect]
667
668[section:overload3 http::basic_chunk_extensions::basic_chunk_extensions (3 of 4 overloads)]
669
670Constructor.
671[heading Synopsis]
672```
673basic_chunk_extensions(
674    basic_chunk_extensions const&);
675```
676
677[heading Description]
678
679[endsect]
680
681[section:overload4 http::basic_chunk_extensions::basic_chunk_extensions (4 of 4 overloads)]
682
683Constructor.
684[heading Synopsis]
685```
686basic_chunk_extensions(
687    Allocator const& allocator);
688```
689
690[heading Description]
691
692[heading Parameters]
693[table [[Name][Description]]
694  [
695    [`allocator`
696    ]
697    [
698The allocator to use for storing the serialized extension
699    ]
700  ]
701]
702
703[endsect]
704
705
706[endsect]
707
708[section:clear http::basic_chunk_extensions::clear]
709[indexterm2 clear..http::basic_chunk_extensions]
710
711
712Clear the chunk extensions.
713[heading Synopsis]
714```
715void
716clear();
717```
718
719[heading Description]
720This preserves the capacity of the internal string used to hold the serialized representation.
721
722[endsect]
723
724[section:parse http::basic_chunk_extensions::parse]
725[indexterm2 parse..http::basic_chunk_extensions]
726
727
728Parse a set of chunk extensions.
729[heading Synopsis]
730```
731void
732parse(
733    string_view s,
734    error_code& ec);
735```
736
737[heading Description]
738Any previous extensions will be cleared
739
740[endsect]
741
742[section:insert http::basic_chunk_extensions::insert]
743[indexterm2 insert..http::basic_chunk_extensions]
744
745
746Insert an extension name with an empty value.
747```
748void
749``[link beast.ref.boost__beast__http__basic_chunk_extensions.insert.overload1 insert]``(
750    string_view name);
751  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_chunk_extensions.insert.overload1 `more...`]]``
752```
753
754
755Insert an extension value.
756```
757void
758``[link beast.ref.boost__beast__http__basic_chunk_extensions.insert.overload2 insert]``(
759    string_view name,
760    string_view value);
761  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_chunk_extensions.insert.overload2 `more...`]]``
762```
763
764[section:overload1 http::basic_chunk_extensions::insert (1 of 2 overloads)]
765
766Insert an extension name with an empty value.
767[heading Synopsis]
768```
769void
770insert(
771    string_view name);
772```
773
774[heading Description]
775
776[heading Parameters]
777[table [[Name][Description]]
778  [
779    [`name`
780    ]
781    [
782The name of the extension
783    ]
784  ]
785]
786
787[endsect]
788
789[section:overload2 http::basic_chunk_extensions::insert (2 of 2 overloads)]
790
791Insert an extension value.
792[heading Synopsis]
793```
794void
795insert(
796    string_view name,
797    string_view value);
798```
799
800[heading Description]
801
802[heading Parameters]
803[table [[Name][Description]]
804  [
805    [`name`
806    ]
807    [
808The name of the extension
809    ]
810  ]
811  [
812    [`value`
813    ]
814    [
815The value to insert. Depending on the contents, the serialized extension may use a quoted string.
816    ]
817  ]
818]
819
820[endsect]
821
822
823[endsect]
824
825[section:str http::basic_chunk_extensions::str]
826[indexterm2 str..http::basic_chunk_extensions]
827
828
829Return the serialized representation of the chunk extension.
830[heading Synopsis]
831```
832string_view
833str() const;
834```
835
836[heading Description]
837
838[endsect]
839
840[section:begin http::basic_chunk_extensions::begin]
841[indexterm2 begin..http::basic_chunk_extensions]
842
843
844[heading Synopsis]
845```
846const_iterator
847begin() const;
848```
849
850[heading Description]
851
852[endsect]
853
854[section:end http::basic_chunk_extensions::end]
855[indexterm2 end..http::basic_chunk_extensions]
856
857
858[heading Synopsis]
859```
860const_iterator
861end() const;
862```
863
864[heading Description]
865
866[endsect]
867
868
869[endsect]
870
871[section:boost__beast__http__basic_dynamic_body http::basic_dynamic_body]
872
873A ['Body] using a ['DynamicBuffer]
874[heading Synopsis]
875Defined in header [include_file boost/beast/http/basic_dynamic_body.hpp]
876
877```
878template<
879    class __DynamicBuffer__>
880struct basic_dynamic_body
881```
882
883[heading Types]
884[table [[Name][Description]]
885  [
886    [[*[link beast.ref.boost__beast__http__basic_dynamic_body.reader reader]]
887    ]
888    [
889
890The algorithm for parsing the body.
891    ]
892  ]
893  [
894    [[*[link beast.ref.boost__beast__http__basic_dynamic_body.value_type value_type]]
895    ]
896    [
897
898The type of container used for the body.
899    ]
900  ]
901  [
902    [[*[link beast.ref.boost__beast__http__basic_dynamic_body.writer writer]]
903    ]
904    [
905
906The algorithm for serializing the body.
907    ]
908  ]
909]
910[heading Static Members]
911[table [[Name][Description]]
912  [
913    [[*[link beast.ref.boost__beast__http__basic_dynamic_body.size size]]
914    ]
915    [
916
917Returns the payload size of the body.
918    ]
919  ]
920]
921[heading Description]
922This body uses a ['DynamicBuffer] as a memory-based container for holding message payloads. Messages using this body type may be serialized and parsed.
923
924[section:value_type http::basic_dynamic_body::value_type]
925[indexterm2 value_type..http::basic_dynamic_body]
926
927
928The type of container used for the body.
929[heading Synopsis]
930```
931using value_type = DynamicBuffer;
932```
933
934[heading Description]
935This determines the type of [link beast.ref.boost__beast__http__message.body `message::body`] when this body type is used with a message container.
936
937[endsect]
938
939[section:reader http::basic_dynamic_body::reader]
940[indexterm2 reader..http::basic_dynamic_body]
941
942
943The algorithm for parsing the body.
944[heading Synopsis]
945```
946using reader = ``['implementation-defined]``;
947```
948
949[heading Description]
950Meets the requirements of ['BodyReader].
951
952[endsect]
953
954[section:writer http::basic_dynamic_body::writer]
955[indexterm2 writer..http::basic_dynamic_body]
956
957
958The algorithm for serializing the body.
959[heading Synopsis]
960```
961using writer = ``['implementation-defined]``;
962```
963
964[heading Description]
965Meets the requirements of ['BodyWriter].
966
967[endsect]
968
969[section:size http::basic_dynamic_body::size]
970[indexterm2 size..http::basic_dynamic_body]
971
972
973Returns the payload size of the body.
974[heading Synopsis]
975```
976static
977std::uint64_t
978size(
979    value_type const& v);
980```
981
982[heading Description]
983When this body is used with [link beast.ref.boost__beast__http__message.prepare_payload `message::prepare_payload`], the Content-Length will be set to the payload size, and any chunked Transfer-Encoding will be removed.
984
985[endsect]
986
987
988[endsect]
989
990[section:boost__beast__http__basic_fields http::basic_fields]
991
992A container for storing HTTP header fields.
993[heading Synopsis]
994Defined in header [include_file boost/beast/http/fields.hpp]
995
996```
997template<
998    class __Allocator__>
999class basic_fields
1000```
1001
1002[heading Types]
1003[table [[Name][Description]]
1004  [
1005    [[*[link beast.ref.boost__beast__http__basic_fields.allocator_type allocator_type]]
1006    ]
1007    [
1008
1009The type of allocator used.
1010    ]
1011  ]
1012  [
1013    [[*[link beast.ref.boost__beast__http__basic_fields.const_iterator const_iterator]]
1014    ]
1015    [
1016
1017A constant iterator to the field sequence.
1018    ]
1019  ]
1020  [
1021    [[*[link beast.ref.boost__beast__http__basic_fields.iterator iterator]]
1022    ]
1023    [
1024
1025A constant iterator to the field sequence.
1026    ]
1027  ]
1028  [
1029    [[*[link beast.ref.boost__beast__http__basic_fields.key_compare key_compare]]
1030    ]
1031    [
1032
1033A strictly less predicate for comparing keys, using a case-insensitive comparison.
1034    ]
1035  ]
1036  [
1037    [[*[link beast.ref.boost__beast__http__basic_fields__value_type value_type]]
1038    ]
1039    [
1040
1041The type of element used to represent a field.
1042    ]
1043  ]
1044  [
1045    [[*[link beast.ref.boost__beast__http__basic_fields.writer writer]]
1046    ]
1047    [
1048
1049The algorithm used to serialize the header.
1050    ]
1051  ]
1052]
1053[heading Member Functions]
1054[table [[Name][Description]]
1055  [
1056    [[*[link beast.ref.boost__beast__http__basic_fields.at at]]
1057    ]
1058    [
1059
1060Returns the value for a field, or throws an exception.
1061    ]
1062  ]
1063  [
1064    [[*[link beast.ref.boost__beast__http__basic_fields.basic_fields basic_fields]]
1065    ]
1066    [
1067
1068Constructor.
1069
1070Move constructor.
1071
1072Copy constructor.
1073    ]
1074  ]
1075  [
1076    [[*[link beast.ref.boost__beast__http__basic_fields.begin begin]]
1077    ]
1078    [
1079
1080Return a const iterator to the beginning of the field sequence.
1081    ]
1082  ]
1083  [
1084    [[*[link beast.ref.boost__beast__http__basic_fields.cbegin cbegin]]
1085    ]
1086    [
1087
1088Return a const iterator to the beginning of the field sequence.
1089    ]
1090  ]
1091  [
1092    [[*[link beast.ref.boost__beast__http__basic_fields.cend cend]]
1093    ]
1094    [
1095
1096Return a const iterator to the end of the field sequence.
1097    ]
1098  ]
1099  [
1100    [[*[link beast.ref.boost__beast__http__basic_fields.clear clear]]
1101    ]
1102    [
1103
1104Remove all fields from the container.
1105    ]
1106  ]
1107  [
1108    [[*[link beast.ref.boost__beast__http__basic_fields.count count]]
1109    ]
1110    [
1111
1112Return the number of fields with the specified name.
1113    ]
1114  ]
1115  [
1116    [[*[link beast.ref.boost__beast__http__basic_fields.end end]]
1117    ]
1118    [
1119
1120Return a const iterator to the end of the field sequence.
1121    ]
1122  ]
1123  [
1124    [[*[link beast.ref.boost__beast__http__basic_fields.equal_range equal_range]]
1125    ]
1126    [
1127
1128Returns a range of iterators to the fields with the specified name.
1129    ]
1130  ]
1131  [
1132    [[*[link beast.ref.boost__beast__http__basic_fields.erase erase]]
1133    ]
1134    [
1135
1136Remove a field.
1137
1138Remove all fields with the specified name.
1139    ]
1140  ]
1141  [
1142    [[*[link beast.ref.boost__beast__http__basic_fields.find find]]
1143    ]
1144    [
1145
1146Returns an iterator to the case-insensitive matching field.
1147
1148Returns an iterator to the case-insensitive matching field name.
1149    ]
1150  ]
1151  [
1152    [[*[link beast.ref.boost__beast__http__basic_fields.get_allocator get_allocator]]
1153    ]
1154    [
1155
1156Return a copy of the allocator associated with the container.
1157    ]
1158  ]
1159  [
1160    [[*[link beast.ref.boost__beast__http__basic_fields.insert insert]]
1161    ]
1162    [
1163
1164Insert a field.
1165
1166    ]
1167  ]
1168  [
1169    [[*[link beast.ref.boost__beast__http__basic_fields.key_comp key_comp]]
1170    ]
1171    [
1172
1173Returns a copy of the key comparison function.
1174    ]
1175  ]
1176  [
1177    [[*[link beast.ref.boost__beast__http__basic_fields.operator_eq_ operator=]]
1178    ]
1179    [
1180
1181Move assignment.
1182
1183Copy assignment.
1184    ]
1185  ]
1186  [
1187    [[*[link beast.ref.boost__beast__http__basic_fields.operator_lb__rb_ operator\[\]]]
1188    ]
1189    [
1190
1191Returns the value for a field, or `""` if it does not exist.
1192
1193Returns the value for a case-insensitive matching header, or `""` if it does not exist.
1194    ]
1195  ]
1196  [
1197    [[*[link beast.ref.boost__beast__http__basic_fields.set set]]
1198    ]
1199    [
1200
1201Set a field value, removing any other instances of that field.
1202
1203    ]
1204  ]
1205  [
1206    [[*[link beast.ref.boost__beast__http__basic_fields.swap swap]]
1207    ]
1208    [
1209
1210Return a buffer sequence representing the trailers.
1211    ]
1212  ]
1213  [
1214    [[*[link beast.ref.boost__beast__http__basic_fields._basic_fields ~basic_fields]]
1215    ]
1216    [
1217
1218Destructor.
1219    ]
1220  ]
1221]
1222[heading Protected Member Functions]
1223[table [[Name][Description]]
1224  [
1225    [[*[link beast.ref.boost__beast__http__basic_fields.get_chunked_impl get_chunked_impl]]
1226    ]
1227    [
1228
1229Returns the chunked Transfer-Encoding setting.
1230    ]
1231  ]
1232  [
1233    [[*[link beast.ref.boost__beast__http__basic_fields.get_keep_alive_impl get_keep_alive_impl]]
1234    ]
1235    [
1236
1237Returns the keep-alive setting.
1238    ]
1239  ]
1240  [
1241    [[*[link beast.ref.boost__beast__http__basic_fields.get_method_impl get_method_impl]]
1242    ]
1243    [
1244
1245Returns the request-method string.
1246    ]
1247  ]
1248  [
1249    [[*[link beast.ref.boost__beast__http__basic_fields.get_reason_impl get_reason_impl]]
1250    ]
1251    [
1252
1253Returns the response reason-phrase string.
1254    ]
1255  ]
1256  [
1257    [[*[link beast.ref.boost__beast__http__basic_fields.get_target_impl get_target_impl]]
1258    ]
1259    [
1260
1261Returns the request-target string.
1262    ]
1263  ]
1264  [
1265    [[*[link beast.ref.boost__beast__http__basic_fields.has_content_length_impl has_content_length_impl]]
1266    ]
1267    [
1268
1269Returns `true` if the Content-Length field is present.
1270    ]
1271  ]
1272  [
1273    [[*[link beast.ref.boost__beast__http__basic_fields.set_chunked_impl set_chunked_impl]]
1274    ]
1275    [
1276
1277Adjusts the chunked Transfer-Encoding value.
1278    ]
1279  ]
1280  [
1281    [[*[link beast.ref.boost__beast__http__basic_fields.set_content_length_impl set_content_length_impl]]
1282    ]
1283    [
1284
1285Sets or clears the Content-Length field.
1286    ]
1287  ]
1288  [
1289    [[*[link beast.ref.boost__beast__http__basic_fields.set_keep_alive_impl set_keep_alive_impl]]
1290    ]
1291    [
1292
1293Adjusts the Connection field.
1294    ]
1295  ]
1296  [
1297    [[*[link beast.ref.boost__beast__http__basic_fields.set_method_impl set_method_impl]]
1298    ]
1299    [
1300
1301Set or clear the method string.
1302    ]
1303  ]
1304  [
1305    [[*[link beast.ref.boost__beast__http__basic_fields.set_reason_impl set_reason_impl]]
1306    ]
1307    [
1308
1309Set or clear the reason string.
1310    ]
1311  ]
1312  [
1313    [[*[link beast.ref.boost__beast__http__basic_fields.set_target_impl set_target_impl]]
1314    ]
1315    [
1316
1317Set or clear the target string.
1318    ]
1319  ]
1320]
1321[heading Friends]
1322[table [[Name][Description]]
1323  [
1324    [[*[link beast.ref.boost__beast__http__basic_fields.swap swap]]
1325    ]
1326    [
1327
1328Swap two field containers.
1329    ]
1330  ]
1331]
1332[heading Description]
1333This container is designed to store the field value pairs that make up the fields and trailers in an HTTP message. Objects of this type are iterable, with each element holding the field name and field value.
1334Field names are stored as-is, but comparisons are case-insensitive. The container behaves as a `std::multiset`; there will be a separate value for each occurrence of the same field name. When the container is iterated the fields are presented in the order of insertion, with fields having the same name following each other consecutively.
1335Meets the requirements of ['Fields]
1336
1337[heading Template Parameters]
1338[table [[Type][Description]]
1339  [
1340    [`Allocator`
1341    ]
1342    [
1343The allocator to use.
1344    ]
1345  ]
1346]
1347
1348[section:allocator_type http::basic_fields::allocator_type]
1349[indexterm2 allocator_type..http::basic_fields]
1350
1351
1352The type of allocator used.
1353[heading Synopsis]
1354```
1355using allocator_type = Allocator;
1356```
1357
1358[heading Description]
1359
1360[endsect]
1361
1362[section:key_compare http::basic_fields::key_compare]
1363[indexterm2 key_compare..http::basic_fields]
1364
1365
1366A strictly less predicate for comparing keys, using a case-insensitive comparison.
1367[heading Synopsis]
1368```
1369using key_compare = ``['implementation-defined]``;
1370```
1371
1372[heading Description]
1373The case-comparison operation is defined only for low-ASCII characters.
1374
1375[endsect]
1376
1377[section:writer http::basic_fields::writer]
1378[indexterm2 writer..http::basic_fields]
1379
1380
1381The algorithm used to serialize the header.
1382[heading Synopsis]
1383```
1384using writer = ``['implementation-defined]``;
1385```
1386
1387[heading Description]
1388
1389[endsect]
1390
1391[section:const_iterator http::basic_fields::const_iterator]
1392[indexterm2 const_iterator..http::basic_fields]
1393
1394
1395A constant iterator to the field sequence.
1396[heading Synopsis]
1397```
1398using const_iterator = ``['implementation-defined]``;
1399```
1400
1401[heading Description]
1402
1403[endsect]
1404
1405[section:iterator http::basic_fields::iterator]
1406[indexterm2 iterator..http::basic_fields]
1407
1408
1409A constant iterator to the field sequence.
1410[heading Synopsis]
1411```
1412using iterator = const_iterator;
1413```
1414
1415[heading Description]
1416
1417[endsect]
1418
1419[section:swap http::basic_fields::swap]
1420[indexterm2 swap..http::basic_fields]
1421
1422
1423Swap two field containers.
1424```
1425template<
1426    class Alloc>
1427friend void
1428``[link beast.ref.boost__beast__http__basic_fields.swap.overload1 swap]``(
1429    basic_fields< Alloc >& lhs,
1430    basic_fields< Alloc >& rhs);
1431  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.swap.overload1 `more...`]]``
1432```
1433
1434
1435Return a buffer sequence representing the trailers.
1436```
1437void
1438``[link beast.ref.boost__beast__http__basic_fields.swap.overload2 swap]``(
1439    basic_fields& other);
1440  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.swap.overload2 `more...`]]``
1441```
1442
1443[section:overload1 http::basic_fields::swap (1 of 2 overloads)]
1444
1445Swap two field containers.
1446[heading Synopsis]
1447Defined in header [include_file boost/beast/http/fields.hpp]
1448
1449```
1450template<
1451    class Alloc>
1452friend void
1453swap(
1454    basic_fields< Alloc >& lhs,
1455    basic_fields< Alloc >& rhs);
1456```
1457
1458[heading Description]
1459
1460
1461[endsect]
1462
1463[section:overload2 http::basic_fields::swap (2 of 2 overloads)]
1464
1465Return a buffer sequence representing the trailers.
1466[heading Synopsis]
1467```
1468void
1469swap(
1470    basic_fields& other);
1471```
1472
1473[heading Description]
1474This function returns a buffer sequence holding the serialized representation of the trailer fields promised in the Accept field. Before calling this function the Accept field must contain the exact trailer fields desired. Each field must also exist.Swap this container with another
1475
1476[endsect]
1477
1478
1479[endsect]
1480
1481[section:_basic_fields http::basic_fields::~basic_fields]
1482[indexterm2 ~basic_fields..http::basic_fields]
1483
1484
1485Destructor.
1486[heading Synopsis]
1487```
1488~basic_fields();
1489```
1490
1491[heading Description]
1492
1493[endsect]
1494
1495[section:basic_fields http::basic_fields::basic_fields]
1496[indexterm2 basic_fields..http::basic_fields]
1497
1498
1499Constructor.
1500```
1501``[link beast.ref.boost__beast__http__basic_fields.basic_fields.overload1 basic_fields]``();
1502  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.basic_fields.overload1 `more...`]]``
1503
1504explicit
1505``[link beast.ref.boost__beast__http__basic_fields.basic_fields.overload2 basic_fields]``(
1506    Allocator const& alloc);
1507  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.basic_fields.overload2 `more...`]]``
1508```
1509
1510
1511Move constructor.
1512```
1513``[link beast.ref.boost__beast__http__basic_fields.basic_fields.overload3 basic_fields]``(
1514    basic_fields&&);
1515  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.basic_fields.overload3 `more...`]]``
1516
1517``[link beast.ref.boost__beast__http__basic_fields.basic_fields.overload4 basic_fields]``(
1518    basic_fields&&,
1519    Allocator const& alloc);
1520  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.basic_fields.overload4 `more...`]]``
1521```
1522
1523
1524Copy constructor.
1525```
1526``[link beast.ref.boost__beast__http__basic_fields.basic_fields.overload5 basic_fields]``(
1527    basic_fields const&);
1528  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.basic_fields.overload5 `more...`]]``
1529
1530``[link beast.ref.boost__beast__http__basic_fields.basic_fields.overload6 basic_fields]``(
1531    basic_fields const&,
1532    Allocator const& alloc);
1533  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.basic_fields.overload6 `more...`]]``
1534
1535template<
1536    class OtherAlloc>
1537``[link beast.ref.boost__beast__http__basic_fields.basic_fields.overload7 basic_fields]``(
1538    basic_fields< OtherAlloc > const&);
1539  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.basic_fields.overload7 `more...`]]``
1540
1541template<
1542    class OtherAlloc>
1543``[link beast.ref.boost__beast__http__basic_fields.basic_fields.overload8 basic_fields]``(
1544    basic_fields< OtherAlloc > const&,
1545    Allocator const& alloc);
1546  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.basic_fields.overload8 `more...`]]``
1547```
1548
1549[section:overload1 http::basic_fields::basic_fields (1 of 8 overloads)]
1550
1551Constructor.
1552[heading Synopsis]
1553```
1554basic_fields();
1555```
1556
1557[heading Description]
1558
1559[endsect]
1560
1561[section:overload2 http::basic_fields::basic_fields (2 of 8 overloads)]
1562
1563Constructor.
1564[heading Synopsis]
1565```
1566basic_fields(
1567    Allocator const& alloc);
1568```
1569
1570[heading Description]
1571
1572[heading Parameters]
1573[table [[Name][Description]]
1574  [
1575    [`alloc`
1576    ]
1577    [
1578The allocator to use.
1579    ]
1580  ]
1581]
1582
1583[endsect]
1584
1585[section:overload3 http::basic_fields::basic_fields (3 of 8 overloads)]
1586
1587Move constructor.
1588[heading Synopsis]
1589```
1590basic_fields(
1591    basic_fields&&);
1592```
1593
1594[heading Description]
1595The state of the moved-from object is as if constructed using the same allocator.
1596
1597[endsect]
1598
1599[section:overload4 http::basic_fields::basic_fields (4 of 8 overloads)]
1600
1601Move constructor.
1602[heading Synopsis]
1603```
1604basic_fields(
1605    basic_fields&&,
1606    Allocator const& alloc);
1607```
1608
1609[heading Description]
1610The state of the moved-from object is as if constructed using the same allocator.
1611
1612[heading Parameters]
1613[table [[Name][Description]]
1614  [
1615    [`alloc`
1616    ]
1617    [
1618The allocator to use.
1619    ]
1620  ]
1621]
1622
1623[endsect]
1624
1625[section:overload5 http::basic_fields::basic_fields (5 of 8 overloads)]
1626
1627Copy constructor.
1628[heading Synopsis]
1629```
1630basic_fields(
1631    basic_fields const&);
1632```
1633
1634[heading Description]
1635
1636[endsect]
1637
1638[section:overload6 http::basic_fields::basic_fields (6 of 8 overloads)]
1639
1640Copy constructor.
1641[heading Synopsis]
1642```
1643basic_fields(
1644    basic_fields const&,
1645    Allocator const& alloc);
1646```
1647
1648[heading Description]
1649
1650[heading Parameters]
1651[table [[Name][Description]]
1652  [
1653    [`alloc`
1654    ]
1655    [
1656The allocator to use.
1657    ]
1658  ]
1659]
1660
1661[endsect]
1662
1663[section:overload7 http::basic_fields::basic_fields (7 of 8 overloads)]
1664
1665Copy constructor.
1666[heading Synopsis]
1667```
1668template<
1669    class OtherAlloc>
1670basic_fields(
1671    basic_fields< OtherAlloc > const&);
1672```
1673
1674[heading Description]
1675
1676[endsect]
1677
1678[section:overload8 http::basic_fields::basic_fields (8 of 8 overloads)]
1679
1680Copy constructor.
1681[heading Synopsis]
1682```
1683template<
1684    class OtherAlloc>
1685basic_fields(
1686    basic_fields< OtherAlloc > const&,
1687    Allocator const& alloc);
1688```
1689
1690[heading Description]
1691
1692[heading Parameters]
1693[table [[Name][Description]]
1694  [
1695    [`alloc`
1696    ]
1697    [
1698The allocator to use.
1699    ]
1700  ]
1701]
1702
1703[endsect]
1704
1705
1706[endsect]
1707
1708[section:operator_eq_ http::basic_fields::operator=]
1709[indexterm2 operator=..http::basic_fields]
1710
1711
1712Move assignment.
1713```
1714basic_fields&
1715``[link beast.ref.boost__beast__http__basic_fields.operator_eq_.overload1 operator=]``(
1716    basic_fields&&);
1717  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.operator_eq_.overload1 `more...`]]``
1718```
1719
1720
1721Copy assignment.
1722```
1723basic_fields&
1724``[link beast.ref.boost__beast__http__basic_fields.operator_eq_.overload2 operator=]``(
1725    basic_fields const&);
1726  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.operator_eq_.overload2 `more...`]]``
1727
1728template<
1729    class OtherAlloc>
1730basic_fields&
1731``[link beast.ref.boost__beast__http__basic_fields.operator_eq_.overload3 operator=]``(
1732    basic_fields< OtherAlloc > const&);
1733  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.operator_eq_.overload3 `more...`]]``
1734```
1735
1736[section:overload1 http::basic_fields::operator= (1 of 3 overloads)]
1737
1738Move assignment.
1739[heading Synopsis]
1740```
1741basic_fields&
1742operator=(
1743    basic_fields&&);
1744```
1745
1746[heading Description]
1747The state of the moved-from object is as if constructed using the same allocator.
1748
1749[endsect]
1750
1751[section:overload2 http::basic_fields::operator= (2 of 3 overloads)]
1752
1753Copy assignment.
1754[heading Synopsis]
1755```
1756basic_fields&
1757operator=(
1758    basic_fields const&);
1759```
1760
1761[heading Description]
1762
1763[endsect]
1764
1765[section:overload3 http::basic_fields::operator= (3 of 3 overloads)]
1766
1767Copy assignment.
1768[heading Synopsis]
1769```
1770template<
1771    class OtherAlloc>
1772basic_fields&
1773operator=(
1774    basic_fields< OtherAlloc > const&);
1775```
1776
1777[heading Description]
1778
1779[endsect]
1780
1781
1782[endsect]
1783
1784[section:get_allocator http::basic_fields::get_allocator]
1785[indexterm2 get_allocator..http::basic_fields]
1786
1787
1788Return a copy of the allocator associated with the container.
1789[heading Synopsis]
1790```
1791allocator_type
1792get_allocator() const;
1793```
1794
1795[heading Description]
1796
1797[endsect]
1798
1799[section:at http::basic_fields::at]
1800[indexterm2 at..http::basic_fields]
1801
1802
1803Returns the value for a field, or throws an exception.
1804```
1805string_view const
1806``[link beast.ref.boost__beast__http__basic_fields.at.overload1 at]``(
1807    field name) const;
1808  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.at.overload1 `more...`]]``
1809
1810string_view const
1811``[link beast.ref.boost__beast__http__basic_fields.at.overload2 at]``(
1812    string_view name) const;
1813  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.at.overload2 `more...`]]``
1814```
1815
1816[section:overload1 http::basic_fields::at (1 of 2 overloads)]
1817
1818Returns the value for a field, or throws an exception.
1819[heading Synopsis]
1820```
1821string_view const
1822at(
1823    field name) const;
1824```
1825
1826[heading Description]
1827If more than one field with the specified name exists, the first field defined by insertion order is returned.
1828
1829[heading Parameters]
1830[table [[Name][Description]]
1831  [
1832    [`name`
1833    ]
1834    [
1835The name of the field.
1836    ]
1837  ]
1838]
1839[heading Return Value]
1840The field value.
1841[heading Exceptions]
1842[table [[Type][Thrown On]]
1843  [
1844    [`std::out_of_range`
1845    ]
1846    [
1847if the field is not found.
1848    ]
1849  ]
1850]
1851
1852[endsect]
1853
1854[section:overload2 http::basic_fields::at (2 of 2 overloads)]
1855
1856Returns the value for a field, or throws an exception.
1857[heading Synopsis]
1858```
1859string_view const
1860at(
1861    string_view name) const;
1862```
1863
1864[heading Description]
1865If more than one field with the specified name exists, the first field defined by insertion order is returned.
1866
1867[heading Parameters]
1868[table [[Name][Description]]
1869  [
1870    [`name`
1871    ]
1872    [
1873The name of the field.
1874    ]
1875  ]
1876]
1877[heading Return Value]
1878The field value.
1879[heading Exceptions]
1880[table [[Type][Thrown On]]
1881  [
1882    [`std::out_of_range`
1883    ]
1884    [
1885if the field is not found.
1886    ]
1887  ]
1888]
1889
1890[endsect]
1891
1892
1893[endsect]
1894
1895[section:operator_lb__rb_ http::basic_fields::operator\[\]]
1896[indexterm2 operator\[\]..http::basic_fields]
1897
1898
1899Returns the value for a field, or `""` if it does not exist.
1900```
1901string_view const
1902``[link beast.ref.boost__beast__http__basic_fields.operator_lb__rb_.overload1 operator\[\]]``(
1903    field name) const;
1904  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.operator_lb__rb_.overload1 `more...`]]``
1905```
1906
1907
1908Returns the value for a case-insensitive matching header, or `""` if it does not exist.
1909```
1910string_view const
1911``[link beast.ref.boost__beast__http__basic_fields.operator_lb__rb_.overload2 operator\[\]]``(
1912    string_view name) const;
1913  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.operator_lb__rb_.overload2 `more...`]]``
1914```
1915
1916[section:overload1 http::basic_fields::operator\[\] (1 of 2 overloads)]
1917
1918Returns the value for a field, or `""` if it does not exist.
1919[heading Synopsis]
1920```
1921string_view const
1922operator[](
1923    field name) const;
1924```
1925
1926[heading Description]
1927If more than one field with the specified name exists, the first field defined by insertion order is returned.
1928
1929[heading Parameters]
1930[table [[Name][Description]]
1931  [
1932    [`name`
1933    ]
1934    [
1935The name of the field.
1936    ]
1937  ]
1938]
1939
1940[endsect]
1941
1942[section:overload2 http::basic_fields::operator\[\] (2 of 2 overloads)]
1943
1944Returns the value for a case-insensitive matching header, or `""` if it does not exist.
1945[heading Synopsis]
1946```
1947string_view const
1948operator[](
1949    string_view name) const;
1950```
1951
1952[heading Description]
1953If more than one field with the specified name exists, the first field defined by insertion order is returned.
1954
1955[heading Parameters]
1956[table [[Name][Description]]
1957  [
1958    [`name`
1959    ]
1960    [
1961The name of the field.
1962    ]
1963  ]
1964]
1965
1966[endsect]
1967
1968
1969[endsect]
1970
1971[section:begin http::basic_fields::begin]
1972[indexterm2 begin..http::basic_fields]
1973
1974
1975Return a const iterator to the beginning of the field sequence.
1976[heading Synopsis]
1977```
1978const_iterator
1979begin() const;
1980```
1981
1982[heading Description]
1983
1984[endsect]
1985
1986[section:end http::basic_fields::end]
1987[indexterm2 end..http::basic_fields]
1988
1989
1990Return a const iterator to the end of the field sequence.
1991[heading Synopsis]
1992```
1993const_iterator
1994end() const;
1995```
1996
1997[heading Description]
1998
1999[endsect]
2000
2001[section:cbegin http::basic_fields::cbegin]
2002[indexterm2 cbegin..http::basic_fields]
2003
2004
2005Return a const iterator to the beginning of the field sequence.
2006[heading Synopsis]
2007```
2008const_iterator
2009cbegin() const;
2010```
2011
2012[heading Description]
2013
2014[endsect]
2015
2016[section:cend http::basic_fields::cend]
2017[indexterm2 cend..http::basic_fields]
2018
2019
2020Return a const iterator to the end of the field sequence.
2021[heading Synopsis]
2022```
2023const_iterator
2024cend() const;
2025```
2026
2027[heading Description]
2028
2029[endsect]
2030
2031[section:clear http::basic_fields::clear]
2032[indexterm2 clear..http::basic_fields]
2033
2034
2035Remove all fields from the container.
2036[heading Synopsis]
2037```
2038void
2039clear();
2040```
2041
2042[heading Description]
2043All references, pointers, or iterators referring to contained elements are invalidated. All past-the-end iterators are also invalidated.
2044
2045[heading Postconditions:]
2046
2047```
2048std::distance(this->begin(), this->end()) == 0
2049```
2050
2051
2052[endsect]
2053
2054[section:insert http::basic_fields::insert]
2055[indexterm2 insert..http::basic_fields]
2056
2057
2058Insert a field.
2059```
2060void
2061``[link beast.ref.boost__beast__http__basic_fields.insert.overload1 insert]``(
2062    field name,
2063    string_view const& value);
2064  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.insert.overload1 `more...`]]``
2065
2066void
2067``[link beast.ref.boost__beast__http__basic_fields.insert.overload3 insert]``(
2068    string_view name,
2069    string_view const& value);
2070  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.insert.overload3 `more...`]]``
2071
2072void
2073``[link beast.ref.boost__beast__http__basic_fields.insert.overload5 insert]``(
2074    field name,
2075    string_view name_string,
2076    string_view const& value);
2077  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.insert.overload5 `more...`]]``
2078```
2079
2080
2081```
2082void
2083``[link beast.ref.boost__beast__http__basic_fields.insert.overload2 insert]``(
2084    field,
2085    std::nullptr_t);
2086  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.insert.overload2 `more...`]]``
2087
2088void
2089``[link beast.ref.boost__beast__http__basic_fields.insert.overload4 insert]``(
2090    string_view,
2091    std::nullptr_t);
2092  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.insert.overload4 `more...`]]``
2093
2094void
2095``[link beast.ref.boost__beast__http__basic_fields.insert.overload6 insert]``(
2096    field,
2097    string_view,
2098    std::nullptr_t);
2099  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.insert.overload6 `more...`]]``
2100```
2101
2102[section:overload1 http::basic_fields::insert (1 of 6 overloads)]
2103
2104Insert a field.
2105[heading Synopsis]
2106```
2107void
2108insert(
2109    field name,
2110    string_view const& value);
2111```
2112
2113[heading Description]
2114If one or more fields with the same name already exist, the new field will be inserted after the last field with the matching name, in serialization order.
2115
2116[heading Parameters]
2117[table [[Name][Description]]
2118  [
2119    [`name`
2120    ]
2121    [
2122The field name.
2123    ]
2124  ]
2125  [
2126    [`value`
2127    ]
2128    [
2129The value of the field, as a [link beast.ref.boost__beast__string_view `string_view`]
2130    ]
2131  ]
2132]
2133
2134[endsect]
2135
2136[section:overload2 http::basic_fields::insert (2 of 6 overloads)]
2137
2138[heading Synopsis]
2139```
2140void
2141insert(
2142    field,
2143    std::nullptr_t);
2144```
2145
2146[heading Description]
2147
2148[endsect]
2149
2150[section:overload3 http::basic_fields::insert (3 of 6 overloads)]
2151
2152Insert a field.
2153[heading Synopsis]
2154```
2155void
2156insert(
2157    string_view name,
2158    string_view const& value);
2159```
2160
2161[heading Description]
2162If one or more fields with the same name already exist, the new field will be inserted after the last field with the matching name, in serialization order.
2163
2164[heading Parameters]
2165[table [[Name][Description]]
2166  [
2167    [`name`
2168    ]
2169    [
2170The field name.
2171    ]
2172  ]
2173  [
2174    [`value`
2175    ]
2176    [
2177The value of the field, as a [link beast.ref.boost__beast__string_view `string_view`]
2178    ]
2179  ]
2180]
2181
2182[endsect]
2183
2184[section:overload4 http::basic_fields::insert (4 of 6 overloads)]
2185
2186[heading Synopsis]
2187```
2188void
2189insert(
2190    string_view,
2191    std::nullptr_t);
2192```
2193
2194[heading Description]
2195
2196[endsect]
2197
2198[section:overload5 http::basic_fields::insert (5 of 6 overloads)]
2199
2200Insert a field.
2201[heading Synopsis]
2202```
2203void
2204insert(
2205    field name,
2206    string_view name_string,
2207    string_view const& value);
2208```
2209
2210[heading Description]
2211If one or more fields with the same name already exist, the new field will be inserted after the last field with the matching name, in serialization order.
2212
2213[heading Parameters]
2214[table [[Name][Description]]
2215  [
2216    [`name`
2217    ]
2218    [
2219The field name.
2220    ]
2221  ]
2222  [
2223    [`name_string`
2224    ]
2225    [
2226The literal text corresponding to the field name. If name != [link beast.ref.boost__beast__http__field `field::unknown`], then this value must be equal to `to_string(name)` using a case-insensitive comparison, otherwise the behavior is undefined.
2227    ]
2228  ]
2229  [
2230    [`value`
2231    ]
2232    [
2233The value of the field, as a [link beast.ref.boost__beast__string_view `string_view`]
2234    ]
2235  ]
2236]
2237
2238[endsect]
2239
2240[section:overload6 http::basic_fields::insert (6 of 6 overloads)]
2241
2242[heading Synopsis]
2243```
2244void
2245insert(
2246    field,
2247    string_view,
2248    std::nullptr_t);
2249```
2250
2251[heading Description]
2252
2253[endsect]
2254
2255
2256[endsect]
2257
2258[section:set http::basic_fields::set]
2259[indexterm2 set..http::basic_fields]
2260
2261
2262Set a field value, removing any other instances of that field.
2263```
2264void
2265``[link beast.ref.boost__beast__http__basic_fields.set.overload1 set]``(
2266    field name,
2267    string_view const& value);
2268  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.set.overload1 `more...`]]``
2269
2270void
2271``[link beast.ref.boost__beast__http__basic_fields.set.overload3 set]``(
2272    string_view name,
2273    string_view const& value);
2274  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.set.overload3 `more...`]]``
2275```
2276
2277
2278```
2279void
2280``[link beast.ref.boost__beast__http__basic_fields.set.overload2 set]``(
2281    field,
2282    std::nullptr_t);
2283  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.set.overload2 `more...`]]``
2284
2285void
2286``[link beast.ref.boost__beast__http__basic_fields.set.overload4 set]``(
2287    string_view,
2288    std::nullptr_t);
2289  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.set.overload4 `more...`]]``
2290```
2291
2292[section:overload1 http::basic_fields::set (1 of 4 overloads)]
2293
2294Set a field value, removing any other instances of that field.
2295[heading Synopsis]
2296```
2297void
2298set(
2299    field name,
2300    string_view const& value);
2301```
2302
2303[heading Description]
2304First removes any values with matching field names, then inserts the new field value.
2305
2306[heading Parameters]
2307[table [[Name][Description]]
2308  [
2309    [`name`
2310    ]
2311    [
2312The field name.
2313    ]
2314  ]
2315  [
2316    [`value`
2317    ]
2318    [
2319The value of the field, as a [link beast.ref.boost__beast__string_view `string_view`]
2320    ]
2321  ]
2322]
2323[heading Return Value]
2324The field value.
2325
2326[endsect]
2327
2328[section:overload2 http::basic_fields::set (2 of 4 overloads)]
2329
2330[heading Synopsis]
2331```
2332void
2333set(
2334    field,
2335    std::nullptr_t);
2336```
2337
2338[heading Description]
2339
2340[endsect]
2341
2342[section:overload3 http::basic_fields::set (3 of 4 overloads)]
2343
2344Set a field value, removing any other instances of that field.
2345[heading Synopsis]
2346```
2347void
2348set(
2349    string_view name,
2350    string_view const& value);
2351```
2352
2353[heading Description]
2354First removes any values with matching field names, then inserts the new field value.
2355
2356[heading Parameters]
2357[table [[Name][Description]]
2358  [
2359    [`name`
2360    ]
2361    [
2362The field name.
2363    ]
2364  ]
2365  [
2366    [`value`
2367    ]
2368    [
2369The value of the field, as a [link beast.ref.boost__beast__string_view `string_view`]
2370    ]
2371  ]
2372]
2373
2374[endsect]
2375
2376[section:overload4 http::basic_fields::set (4 of 4 overloads)]
2377
2378[heading Synopsis]
2379```
2380void
2381set(
2382    string_view,
2383    std::nullptr_t);
2384```
2385
2386[heading Description]
2387
2388[endsect]
2389
2390
2391[endsect]
2392
2393[section:erase http::basic_fields::erase]
2394[indexterm2 erase..http::basic_fields]
2395
2396
2397Remove a field.
2398```
2399const_iterator
2400``[link beast.ref.boost__beast__http__basic_fields.erase.overload1 erase]``(
2401    const_iterator pos);
2402  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.erase.overload1 `more...`]]``
2403```
2404
2405
2406Remove all fields with the specified name.
2407```
2408std::size_t
2409``[link beast.ref.boost__beast__http__basic_fields.erase.overload2 erase]``(
2410    field name);
2411  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.erase.overload2 `more...`]]``
2412
2413std::size_t
2414``[link beast.ref.boost__beast__http__basic_fields.erase.overload3 erase]``(
2415    string_view name);
2416  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.erase.overload3 `more...`]]``
2417```
2418
2419[section:overload1 http::basic_fields::erase (1 of 3 overloads)]
2420
2421Remove a field.
2422[heading Synopsis]
2423```
2424const_iterator
2425erase(
2426    const_iterator pos);
2427```
2428
2429[heading Description]
2430References and iterators to the erased elements are invalidated. Other references and iterators are not affected.
2431
2432[heading Parameters]
2433[table [[Name][Description]]
2434  [
2435    [`pos`
2436    ]
2437    [
2438An iterator to the element to remove.
2439    ]
2440  ]
2441]
2442[heading Return Value]
2443An iterator following the last removed element. If the iterator refers to the last element, the [link beast.ref.boost__beast__http__basic_fields.end `end()`] iterator is returned.
2444
2445[endsect]
2446
2447[section:overload2 http::basic_fields::erase (2 of 3 overloads)]
2448
2449Remove all fields with the specified name.
2450[heading Synopsis]
2451```
2452std::size_t
2453erase(
2454    field name);
2455```
2456
2457[heading Description]
2458All fields with the same field name are erased from the container. References and iterators to the erased elements are invalidated. Other references and iterators are not affected.
2459
2460[heading Parameters]
2461[table [[Name][Description]]
2462  [
2463    [`name`
2464    ]
2465    [
2466The field name.
2467    ]
2468  ]
2469]
2470[heading Return Value]
2471The number of fields removed.
2472
2473[endsect]
2474
2475[section:overload3 http::basic_fields::erase (3 of 3 overloads)]
2476
2477Remove all fields with the specified name.
2478[heading Synopsis]
2479```
2480std::size_t
2481erase(
2482    string_view name);
2483```
2484
2485[heading Description]
2486All fields with the same field name are erased from the container. References and iterators to the erased elements are invalidated. Other references and iterators are not affected.
2487
2488[heading Parameters]
2489[table [[Name][Description]]
2490  [
2491    [`name`
2492    ]
2493    [
2494The field name.
2495    ]
2496  ]
2497]
2498[heading Return Value]
2499The number of fields removed.
2500
2501[endsect]
2502
2503
2504[endsect]
2505
2506[section:count http::basic_fields::count]
2507[indexterm2 count..http::basic_fields]
2508
2509
2510Return the number of fields with the specified name.
2511```
2512std::size_t
2513``[link beast.ref.boost__beast__http__basic_fields.count.overload1 count]``(
2514    field name) const;
2515  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.count.overload1 `more...`]]``
2516
2517std::size_t
2518``[link beast.ref.boost__beast__http__basic_fields.count.overload2 count]``(
2519    string_view name) const;
2520  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.count.overload2 `more...`]]``
2521```
2522
2523[section:overload1 http::basic_fields::count (1 of 2 overloads)]
2524
2525Return the number of fields with the specified name.
2526[heading Synopsis]
2527```
2528std::size_t
2529count(
2530    field name) const;
2531```
2532
2533[heading Description]
2534
2535[heading Parameters]
2536[table [[Name][Description]]
2537  [
2538    [`name`
2539    ]
2540    [
2541The field name.
2542    ]
2543  ]
2544]
2545
2546[endsect]
2547
2548[section:overload2 http::basic_fields::count (2 of 2 overloads)]
2549
2550Return the number of fields with the specified name.
2551[heading Synopsis]
2552```
2553std::size_t
2554count(
2555    string_view name) const;
2556```
2557
2558[heading Description]
2559
2560[heading Parameters]
2561[table [[Name][Description]]
2562  [
2563    [`name`
2564    ]
2565    [
2566The field name.
2567    ]
2568  ]
2569]
2570
2571[endsect]
2572
2573
2574[endsect]
2575
2576[section:find http::basic_fields::find]
2577[indexterm2 find..http::basic_fields]
2578
2579
2580Returns an iterator to the case-insensitive matching field.
2581```
2582const_iterator
2583``[link beast.ref.boost__beast__http__basic_fields.find.overload1 find]``(
2584    field name) const;
2585  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.find.overload1 `more...`]]``
2586```
2587
2588
2589Returns an iterator to the case-insensitive matching field name.
2590```
2591const_iterator
2592``[link beast.ref.boost__beast__http__basic_fields.find.overload2 find]``(
2593    string_view name) const;
2594  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.find.overload2 `more...`]]``
2595```
2596
2597[section:overload1 http::basic_fields::find (1 of 2 overloads)]
2598
2599Returns an iterator to the case-insensitive matching field.
2600[heading Synopsis]
2601```
2602const_iterator
2603find(
2604    field name) const;
2605```
2606
2607[heading Description]
2608If more than one field with the specified name exists, the first field defined by insertion order is returned.
2609
2610[heading Parameters]
2611[table [[Name][Description]]
2612  [
2613    [`name`
2614    ]
2615    [
2616The field name.
2617    ]
2618  ]
2619]
2620[heading Return Value]
2621An iterator to the matching field, or [link beast.ref.boost__beast__http__basic_fields.end `end()`] if no match was found.
2622
2623[endsect]
2624
2625[section:overload2 http::basic_fields::find (2 of 2 overloads)]
2626
2627Returns an iterator to the case-insensitive matching field name.
2628[heading Synopsis]
2629```
2630const_iterator
2631find(
2632    string_view name) const;
2633```
2634
2635[heading Description]
2636If more than one field with the specified name exists, the first field defined by insertion order is returned.
2637
2638[heading Parameters]
2639[table [[Name][Description]]
2640  [
2641    [`name`
2642    ]
2643    [
2644The field name.
2645    ]
2646  ]
2647]
2648[heading Return Value]
2649An iterator to the matching field, or [link beast.ref.boost__beast__http__basic_fields.end `end()`] if no match was found.
2650
2651[endsect]
2652
2653
2654[endsect]
2655
2656[section:equal_range http::basic_fields::equal_range]
2657[indexterm2 equal_range..http::basic_fields]
2658
2659
2660Returns a range of iterators to the fields with the specified name.
2661```
2662std::pair< const_iterator, const_iterator >
2663``[link beast.ref.boost__beast__http__basic_fields.equal_range.overload1 equal_range]``(
2664    field name) const;
2665  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.equal_range.overload1 `more...`]]``
2666
2667std::pair< const_iterator, const_iterator >
2668``[link beast.ref.boost__beast__http__basic_fields.equal_range.overload2 equal_range]``(
2669    string_view name) const;
2670  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields.equal_range.overload2 `more...`]]``
2671```
2672
2673[section:overload1 http::basic_fields::equal_range (1 of 2 overloads)]
2674
2675Returns a range of iterators to the fields with the specified name.
2676[heading Synopsis]
2677```
2678std::pair< const_iterator, const_iterator >
2679equal_range(
2680    field name) const;
2681```
2682
2683[heading Description]
2684
2685[heading Parameters]
2686[table [[Name][Description]]
2687  [
2688    [`name`
2689    ]
2690    [
2691The field name.
2692    ]
2693  ]
2694]
2695[heading Return Value]
2696A range of iterators to fields with the same name, otherwise an empty range.
2697
2698[endsect]
2699
2700[section:overload2 http::basic_fields::equal_range (2 of 2 overloads)]
2701
2702Returns a range of iterators to the fields with the specified name.
2703[heading Synopsis]
2704```
2705std::pair< const_iterator, const_iterator >
2706equal_range(
2707    string_view name) const;
2708```
2709
2710[heading Description]
2711
2712[heading Parameters]
2713[table [[Name][Description]]
2714  [
2715    [`name`
2716    ]
2717    [
2718The field name.
2719    ]
2720  ]
2721]
2722[heading Return Value]
2723A range of iterators to fields with the same name, otherwise an empty range.
2724
2725[endsect]
2726
2727
2728[endsect]
2729
2730[section:key_comp http::basic_fields::key_comp]
2731[indexterm2 key_comp..http::basic_fields]
2732
2733
2734Returns a copy of the key comparison function.
2735[heading Synopsis]
2736```
2737key_compare
2738key_comp() const;
2739```
2740
2741[heading Description]
2742
2743[endsect]
2744
2745[section:get_method_impl http::basic_fields::get_method_impl]
2746[indexterm2 get_method_impl..http::basic_fields]
2747
2748
2749Returns the request-method string.
2750[heading Synopsis]
2751```
2752string_view
2753get_method_impl() const;
2754```
2755
2756[heading Description]
2757
2758[heading Remarks]
2759Only called for requests.
2760
2761[endsect]
2762
2763[section:get_target_impl http::basic_fields::get_target_impl]
2764[indexterm2 get_target_impl..http::basic_fields]
2765
2766
2767Returns the request-target string.
2768[heading Synopsis]
2769```
2770string_view
2771get_target_impl() const;
2772```
2773
2774[heading Description]
2775
2776[heading Remarks]
2777Only called for requests.
2778
2779[endsect]
2780
2781[section:get_reason_impl http::basic_fields::get_reason_impl]
2782[indexterm2 get_reason_impl..http::basic_fields]
2783
2784
2785Returns the response reason-phrase string.
2786[heading Synopsis]
2787```
2788string_view
2789get_reason_impl() const;
2790```
2791
2792[heading Description]
2793
2794[heading Remarks]
2795Only called for responses.
2796
2797[endsect]
2798
2799[section:get_chunked_impl http::basic_fields::get_chunked_impl]
2800[indexterm2 get_chunked_impl..http::basic_fields]
2801
2802
2803Returns the chunked Transfer-Encoding setting.
2804[heading Synopsis]
2805```
2806bool
2807get_chunked_impl() const;
2808```
2809
2810[heading Description]
2811
2812[endsect]
2813
2814[section:get_keep_alive_impl http::basic_fields::get_keep_alive_impl]
2815[indexterm2 get_keep_alive_impl..http::basic_fields]
2816
2817
2818Returns the keep-alive setting.
2819[heading Synopsis]
2820```
2821bool
2822get_keep_alive_impl(
2823    unsigned version) const;
2824```
2825
2826[heading Description]
2827
2828[endsect]
2829
2830[section:has_content_length_impl http::basic_fields::has_content_length_impl]
2831[indexterm2 has_content_length_impl..http::basic_fields]
2832
2833
2834Returns `true` if the Content-Length field is present.
2835[heading Synopsis]
2836```
2837bool
2838has_content_length_impl() const;
2839```
2840
2841[heading Description]
2842
2843[endsect]
2844
2845[section:set_method_impl http::basic_fields::set_method_impl]
2846[indexterm2 set_method_impl..http::basic_fields]
2847
2848
2849Set or clear the method string.
2850[heading Synopsis]
2851```
2852void
2853set_method_impl(
2854    string_view s);
2855```
2856
2857[heading Description]
2858
2859[heading Remarks]
2860Only called for requests.
2861
2862[endsect]
2863
2864[section:set_target_impl http::basic_fields::set_target_impl]
2865[indexterm2 set_target_impl..http::basic_fields]
2866
2867
2868Set or clear the target string.
2869[heading Synopsis]
2870```
2871void
2872set_target_impl(
2873    string_view s);
2874```
2875
2876[heading Description]
2877
2878[heading Remarks]
2879Only called for requests.
2880
2881[endsect]
2882
2883[section:set_reason_impl http::basic_fields::set_reason_impl]
2884[indexterm2 set_reason_impl..http::basic_fields]
2885
2886
2887Set or clear the reason string.
2888[heading Synopsis]
2889```
2890void
2891set_reason_impl(
2892    string_view s);
2893```
2894
2895[heading Description]
2896
2897[heading Remarks]
2898Only called for responses.
2899
2900[endsect]
2901
2902[section:set_chunked_impl http::basic_fields::set_chunked_impl]
2903[indexterm2 set_chunked_impl..http::basic_fields]
2904
2905
2906Adjusts the chunked Transfer-Encoding value.
2907[heading Synopsis]
2908```
2909void
2910set_chunked_impl(
2911    bool value);
2912```
2913
2914[heading Description]
2915
2916[endsect]
2917
2918[section:set_content_length_impl http::basic_fields::set_content_length_impl]
2919[indexterm2 set_content_length_impl..http::basic_fields]
2920
2921
2922Sets or clears the Content-Length field.
2923[heading Synopsis]
2924```
2925void
2926set_content_length_impl(
2927    boost::optional< std::uint64_t > const& value);
2928```
2929
2930[heading Description]
2931
2932[endsect]
2933
2934[section:set_keep_alive_impl http::basic_fields::set_keep_alive_impl]
2935[indexterm2 set_keep_alive_impl..http::basic_fields]
2936
2937
2938Adjusts the Connection field.
2939[heading Synopsis]
2940```
2941void
2942set_keep_alive_impl(
2943    unsigned version,
2944    bool keep_alive);
2945```
2946
2947[heading Description]
2948
2949[endsect]
2950
2951
2952[endsect]
2953
2954[section:boost__beast__http__basic_file_body http::basic_file_body]
2955
2956A message body represented by a file on the filesystem.
2957[heading Synopsis]
2958Defined in header [include_file boost/beast/http/basic_file_body.hpp]
2959
2960```
2961template<
2962    class File>
2963struct basic_file_body
2964```
2965
2966[heading Types]
2967[table [[Name][Description]]
2968  [
2969    [[*[link beast.ref.boost__beast__http__basic_file_body.file_type file_type]]
2970    ]
2971    [
2972
2973The type of File this body uses.
2974    ]
2975  ]
2976  [
2977    [[*[link beast.ref.boost__beast__http__basic_file_body__reader reader]]
2978    ]
2979    [
2980
2981Algorithm for storing buffers when parsing.
2982    ]
2983  ]
2984  [
2985    [[*[link beast.ref.boost__beast__http__basic_file_body__value_type value_type]]
2986    ]
2987    [
2988
2989The type of the [link beast.ref.boost__beast__http__message.body `message::body`] member.
2990    ]
2991  ]
2992  [
2993    [[*[link beast.ref.boost__beast__http__basic_file_body__writer writer]]
2994    ]
2995    [
2996
2997Algorithm for retrieving buffers when serializing.
2998    ]
2999  ]
3000]
3001[heading Static Members]
3002[table [[Name][Description]]
3003  [
3004    [[*[link beast.ref.boost__beast__http__basic_file_body.size size]]
3005    ]
3006    [
3007
3008Returns the size of the body.
3009    ]
3010  ]
3011]
3012[heading Description]
3013Messages with this type have bodies represented by a file on the file system. When parsing a message using this body type, the data is stored in the file pointed to by the path, which must be writable. When serializing, the implementation will read the file and present those octets as the body content. This may be used to serve content from a directory as part of a web service.
3014
3015[heading Template Parameters]
3016[table [[Type][Description]]
3017  [
3018    [`File`
3019    ]
3020    [
3021The implementation to use for accessing files. This type must meet the requirements of ['File].
3022    ]
3023  ]
3024]
3025
3026[section:file_type http::basic_file_body::file_type]
3027[indexterm2 file_type..http::basic_file_body]
3028
3029
3030The type of File this body uses.
3031[heading Synopsis]
3032```
3033using file_type = File;
3034```
3035
3036[heading Description]
3037
3038[endsect]
3039
3040[section:size http::basic_file_body::size]
3041[indexterm2 size..http::basic_file_body]
3042
3043
3044Returns the size of the body.
3045[heading Synopsis]
3046```
3047static
3048std::uint64_t
3049size(
3050    value_type const& body);
3051```
3052
3053[heading Description]
3054
3055[heading Parameters]
3056[table [[Name][Description]]
3057  [
3058    [`body`
3059    ]
3060    [
3061The file body to use
3062    ]
3063  ]
3064]
3065
3066[endsect]
3067
3068
3069[endsect]
3070
3071[section:boost__beast__basic_flat_buffer basic_flat_buffer]
3072
3073A dynamic buffer providing buffer sequences of length one.
3074[heading Synopsis]
3075Defined in header [include_file boost/beast/core/flat_buffer.hpp]
3076
3077```
3078template<
3079    class __Allocator__>
3080class basic_flat_buffer
3081```
3082
3083[heading Types]
3084[table [[Name][Description]]
3085  [
3086    [[*[link beast.ref.boost__beast__basic_flat_buffer.allocator_type allocator_type]]
3087    ]
3088    [
3089
3090The type of allocator used.
3091    ]
3092  ]
3093  [
3094    [[*[link beast.ref.boost__beast__basic_flat_buffer.const_buffers_type const_buffers_type]]
3095    ]
3096    [
3097
3098The ConstBufferSequence used to represent the readable bytes.
3099    ]
3100  ]
3101  [
3102    [[*[link beast.ref.boost__beast__basic_flat_buffer.mutable_buffers_type mutable_buffers_type]]
3103    ]
3104    [
3105
3106The MutableBufferSequence used to represent the writable bytes.
3107    ]
3108  ]
3109]
3110[heading Member Functions]
3111[table [[Name][Description]]
3112  [
3113    [[*[link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer basic_flat_buffer]]
3114    ]
3115    [
3116
3117Constructor.
3118
3119Move Constructor.
3120
3121Copy Constructor.
3122    ]
3123  ]
3124  [
3125    [[*[link beast.ref.boost__beast__basic_flat_buffer.capacity capacity]]
3126    ]
3127    [
3128
3129Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
3130    ]
3131  ]
3132  [
3133    [[*[link beast.ref.boost__beast__basic_flat_buffer.cdata cdata]]
3134    ]
3135    [
3136
3137Returns a constant buffer sequence representing the readable bytes.
3138    ]
3139  ]
3140  [
3141    [[*[link beast.ref.boost__beast__basic_flat_buffer.clear clear]]
3142    ]
3143    [
3144
3145Set the size of the readable and writable bytes to zero.
3146    ]
3147  ]
3148  [
3149    [[*[link beast.ref.boost__beast__basic_flat_buffer.commit commit]]
3150    ]
3151    [
3152
3153Append writable bytes to the readable bytes.
3154    ]
3155  ]
3156  [
3157    [[*[link beast.ref.boost__beast__basic_flat_buffer.consume consume]]
3158    ]
3159    [
3160
3161Remove bytes from beginning of the readable bytes.
3162    ]
3163  ]
3164  [
3165    [[*[link beast.ref.boost__beast__basic_flat_buffer.data data]]
3166    ]
3167    [
3168
3169Returns a constant buffer sequence representing the readable bytes.
3170
3171Returns a mutable buffer sequence representing the readable bytes.
3172    ]
3173  ]
3174  [
3175    [[*[link beast.ref.boost__beast__basic_flat_buffer.get_allocator get_allocator]]
3176    ]
3177    [
3178
3179Returns a copy of the allocator used.
3180    ]
3181  ]
3182  [
3183    [[*[link beast.ref.boost__beast__basic_flat_buffer.max_size max_size]]
3184    ]
3185    [
3186
3187Set the maximum allowed capacity.
3188
3189Return the maximum number of bytes, both readable and writable, that can ever be held.
3190    ]
3191  ]
3192  [
3193    [[*[link beast.ref.boost__beast__basic_flat_buffer.operator_eq_ operator=]]
3194    ]
3195    [
3196
3197Move Assignment.
3198
3199Copy Assignment.
3200
3201Copy assignment.
3202    ]
3203  ]
3204  [
3205    [[*[link beast.ref.boost__beast__basic_flat_buffer.prepare prepare]]
3206    ]
3207    [
3208
3209Returns a mutable buffer sequence representing writable bytes.
3210    ]
3211  ]
3212  [
3213    [[*[link beast.ref.boost__beast__basic_flat_buffer.reserve reserve]]
3214    ]
3215    [
3216
3217Guarantee a minimum capacity.
3218    ]
3219  ]
3220  [
3221    [[*[link beast.ref.boost__beast__basic_flat_buffer.shrink_to_fit shrink_to_fit]]
3222    ]
3223    [
3224
3225Request the removal of unused capacity.
3226    ]
3227  ]
3228  [
3229    [[*[link beast.ref.boost__beast__basic_flat_buffer.size size]]
3230    ]
3231    [
3232
3233Returns the number of readable bytes.
3234    ]
3235  ]
3236  [
3237    [[*[link beast.ref.boost__beast__basic_flat_buffer._basic_flat_buffer ~basic_flat_buffer]]
3238    ]
3239    [
3240
3241Destructor.
3242    ]
3243  ]
3244]
3245[heading Friends]
3246[table [[Name][Description]]
3247  [
3248    [[*[link beast.ref.boost__beast__basic_flat_buffer.swap swap]]
3249    ]
3250    [
3251
3252Exchange two dynamic buffers.
3253    ]
3254  ]
3255]
3256[heading Description]
3257A dynamic buffer encapsulates memory storage that may be automatically resized as required, where the memory is divided into two regions: readable bytes followed by writable bytes. These memory regions are internal to the dynamic buffer, but direct access to the elements is provided to permit them to be efficiently used with I/O operations.
3258Objects of this type meet the requirements of ['DynamicBuffer] and have the following additional properties:
3259
3260* A mutable buffer sequence representing the readable bytes is returned by [link beast.ref.boost__beast__basic_flat_buffer.data `data`] when `this` is non-const.
3261
3262* A configurable maximum buffer size may be set upon construction. Attempts to exceed the buffer size will throw `std::length_error`.
3263
3264* Buffer sequences representing the readable and writable bytes, returned by [link beast.ref.boost__beast__basic_flat_buffer.data `data`] and [link beast.ref.boost__beast__basic_flat_buffer.prepare `prepare`], will have length one.
3265
3266Upon construction, a maximum size for the buffer may be specified. If this limit is exceeded, the `std::length_error` exception will be thrown.
3267
3268[heading Remarks]
3269This class is designed for use with algorithms that take dynamic buffers as parameters, and are optimized for the case where the input sequence or output sequence is stored in a single contiguous buffer.
3270
3271[section:allocator_type basic_flat_buffer::allocator_type]
3272[indexterm2 allocator_type..basic_flat_buffer]
3273
3274
3275The type of allocator used.
3276[heading Synopsis]
3277```
3278using allocator_type = Allocator;
3279```
3280
3281[heading Description]
3282
3283[endsect]
3284
3285[section:const_buffers_type basic_flat_buffer::const_buffers_type]
3286[indexterm2 const_buffers_type..basic_flat_buffer]
3287
3288
3289The ConstBufferSequence used to represent the readable bytes.
3290[heading Synopsis]
3291```
3292using const_buffers_type = net::const_buffer;
3293```
3294
3295[heading Description]
3296
3297[endsect]
3298
3299[section:mutable_buffers_type basic_flat_buffer::mutable_buffers_type]
3300[indexterm2 mutable_buffers_type..basic_flat_buffer]
3301
3302
3303The MutableBufferSequence used to represent the writable bytes.
3304[heading Synopsis]
3305```
3306using mutable_buffers_type = net::mutable_buffer;
3307```
3308
3309[heading Description]
3310
3311[endsect]
3312
3313[section:swap basic_flat_buffer::swap]
3314[indexterm2 swap..basic_flat_buffer]
3315
3316
3317Exchange two dynamic buffers.
3318[heading Synopsis]
3319Defined in header [include_file boost/beast/core/flat_buffer.hpp]
3320
3321```
3322template<
3323    class Alloc>
3324friend void
3325swap(
3326    basic_flat_buffer< Alloc >&,
3327    basic_flat_buffer< Alloc >&);
3328```
3329
3330[heading Description]
3331
3332
3333[endsect]
3334
3335[section:_basic_flat_buffer basic_flat_buffer::~basic_flat_buffer]
3336[indexterm2 ~basic_flat_buffer..basic_flat_buffer]
3337
3338
3339Destructor.
3340[heading Synopsis]
3341```
3342~basic_flat_buffer();
3343```
3344
3345[heading Description]
3346
3347[endsect]
3348
3349[section:basic_flat_buffer basic_flat_buffer::basic_flat_buffer]
3350[indexterm2 basic_flat_buffer..basic_flat_buffer]
3351
3352
3353Constructor.
3354```
3355``[link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload1 basic_flat_buffer]``();
3356  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload1 `more...`]]``
3357
3358explicit
3359``[link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload2 basic_flat_buffer]``(
3360    std::size_t limit);
3361  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload2 `more...`]]``
3362
3363explicit
3364``[link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload3 basic_flat_buffer]``(
3365    Allocator const& alloc);
3366  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload3 `more...`]]``
3367
3368``[link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload4 basic_flat_buffer]``(
3369    std::size_t limit,
3370    Allocator const& alloc);
3371  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload4 `more...`]]``
3372```
3373
3374
3375Move Constructor.
3376```
3377``[link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload5 basic_flat_buffer]``(
3378    basic_flat_buffer&& other);
3379  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload5 `more...`]]``
3380
3381``[link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload6 basic_flat_buffer]``(
3382    basic_flat_buffer&& other,
3383    Allocator const& alloc);
3384  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload6 `more...`]]``
3385```
3386
3387
3388Copy Constructor.
3389```
3390``[link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload7 basic_flat_buffer]``(
3391    basic_flat_buffer const& other);
3392  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload7 `more...`]]``
3393
3394``[link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload8 basic_flat_buffer]``(
3395    basic_flat_buffer const& other,
3396    Allocator const& alloc);
3397  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload8 `more...`]]``
3398
3399template<
3400    class OtherAlloc>
3401``[link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload9 basic_flat_buffer]``(
3402    basic_flat_buffer< OtherAlloc > const& other);
3403  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload9 `more...`]]``
3404
3405template<
3406    class OtherAlloc>
3407``[link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload10 basic_flat_buffer]``(
3408    basic_flat_buffer< OtherAlloc > const& other,
3409    Allocator const& alloc);
3410  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer.overload10 `more...`]]``
3411```
3412
3413[section:overload1 basic_flat_buffer::basic_flat_buffer (1 of 10 overloads)]
3414
3415Constructor.
3416[heading Synopsis]
3417```
3418basic_flat_buffer();
3419```
3420
3421[heading Description]
3422After construction, [link beast.ref.boost__beast__basic_flat_buffer.capacity `capacity`] will return zero, and [link beast.ref.boost__beast__basic_flat_buffer.max_size `max_size`] will return the largest value which may be passed to the allocator's `allocate` function.
3423
3424[endsect]
3425
3426[section:overload2 basic_flat_buffer::basic_flat_buffer (2 of 10 overloads)]
3427
3428Constructor.
3429[heading Synopsis]
3430```
3431basic_flat_buffer(
3432    std::size_t limit);
3433```
3434
3435[heading Description]
3436After construction, [link beast.ref.boost__beast__basic_flat_buffer.capacity `capacity`] will return zero, and [link beast.ref.boost__beast__basic_flat_buffer.max_size `max_size`] will return the specified value of `limit`.
3437
3438[heading Parameters]
3439[table [[Name][Description]]
3440  [
3441    [`limit`
3442    ]
3443    [
3444The desired maximum size.
3445    ]
3446  ]
3447]
3448
3449[endsect]
3450
3451[section:overload3 basic_flat_buffer::basic_flat_buffer (3 of 10 overloads)]
3452
3453Constructor.
3454[heading Synopsis]
3455```
3456basic_flat_buffer(
3457    Allocator const& alloc);
3458```
3459
3460[heading Description]
3461After construction, [link beast.ref.boost__beast__basic_flat_buffer.capacity `capacity`] will return zero, and [link beast.ref.boost__beast__basic_flat_buffer.max_size `max_size`] will return the largest value which may be passed to the allocator's `allocate` function.
3462
3463[heading Parameters]
3464[table [[Name][Description]]
3465  [
3466    [`alloc`
3467    ]
3468    [
3469The allocator to use for the object.
3470    ]
3471  ]
3472]
3473[heading Exception Safety]
3474
3475No-throw guarantee.
3476
3477[endsect]
3478
3479[section:overload4 basic_flat_buffer::basic_flat_buffer (4 of 10 overloads)]
3480
3481Constructor.
3482[heading Synopsis]
3483```
3484basic_flat_buffer(
3485    std::size_t limit,
3486    Allocator const& alloc);
3487```
3488
3489[heading Description]
3490After construction, [link beast.ref.boost__beast__basic_flat_buffer.capacity `capacity`] will return zero, and [link beast.ref.boost__beast__basic_flat_buffer.max_size `max_size`] will return the specified value of `limit`.
3491
3492[heading Parameters]
3493[table [[Name][Description]]
3494  [
3495    [`limit`
3496    ]
3497    [
3498The desired maximum size.
3499    ]
3500  ]
3501  [
3502    [`alloc`
3503    ]
3504    [
3505The allocator to use for the object.
3506    ]
3507  ]
3508]
3509[heading Exception Safety]
3510
3511No-throw guarantee.
3512
3513[endsect]
3514
3515[section:overload5 basic_flat_buffer::basic_flat_buffer (5 of 10 overloads)]
3516
3517Move Constructor.
3518[heading Synopsis]
3519```
3520basic_flat_buffer(
3521    basic_flat_buffer&& other);
3522```
3523
3524[heading Description]
3525The container is constructed with the contents of `other` using move semantics. The maximum size will be the same as the moved-from object.
3526Buffer sequences previously obtained from `other` using [link beast.ref.boost__beast__basic_flat_buffer.data `data`] or [link beast.ref.boost__beast__basic_flat_buffer.prepare `prepare`] remain valid after the move.
3527
3528[heading Parameters]
3529[table [[Name][Description]]
3530  [
3531    [`other`
3532    ]
3533    [
3534The object to move from. After the move, the moved-from object will have zero capacity, zero readable bytes, and zero writable bytes.
3535    ]
3536  ]
3537]
3538[heading Exception Safety]
3539
3540No-throw guarantee.
3541
3542[endsect]
3543
3544[section:overload6 basic_flat_buffer::basic_flat_buffer (6 of 10 overloads)]
3545
3546Move Constructor.
3547[heading Synopsis]
3548```
3549basic_flat_buffer(
3550    basic_flat_buffer&& other,
3551    Allocator const& alloc);
3552```
3553
3554[heading Description]
3555Using `alloc` as the allocator for the new container, the contents of `other` are moved. If `alloc != other.get_allocator()`, this results in a copy. The maximum size will be the same as the moved-from object.
3556Buffer sequences previously obtained from `other` using [link beast.ref.boost__beast__basic_flat_buffer.data `data`] or [link beast.ref.boost__beast__basic_flat_buffer.prepare `prepare`] become invalid after the move.
3557
3558[heading Parameters]
3559[table [[Name][Description]]
3560  [
3561    [`other`
3562    ]
3563    [
3564The object to move from. After the move, the moved-from object will have zero capacity, zero readable bytes, and zero writable bytes.
3565    ]
3566  ]
3567  [
3568    [`alloc`
3569    ]
3570    [
3571The allocator to use for the object.
3572    ]
3573  ]
3574]
3575[heading Exceptions]
3576[table [[Type][Thrown On]]
3577  [
3578    [`std::length_error`
3579    ]
3580    [
3581if `other.size()` exceeds the maximum allocation size of `alloc`.
3582    ]
3583  ]
3584]
3585
3586[endsect]
3587
3588[section:overload7 basic_flat_buffer::basic_flat_buffer (7 of 10 overloads)]
3589
3590Copy Constructor.
3591[heading Synopsis]
3592```
3593basic_flat_buffer(
3594    basic_flat_buffer const& other);
3595```
3596
3597[heading Description]
3598This container is constructed with the contents of `other` using copy semantics. The maximum size will be the same as the copied object.
3599
3600[heading Parameters]
3601[table [[Name][Description]]
3602  [
3603    [`other`
3604    ]
3605    [
3606The object to copy from.
3607    ]
3608  ]
3609]
3610[heading Exceptions]
3611[table [[Type][Thrown On]]
3612  [
3613    [`std::length_error`
3614    ]
3615    [
3616if `other.size()` exceeds the maximum allocation size of the allocator.
3617    ]
3618  ]
3619]
3620
3621[endsect]
3622
3623[section:overload8 basic_flat_buffer::basic_flat_buffer (8 of 10 overloads)]
3624
3625Copy Constructor.
3626[heading Synopsis]
3627```
3628basic_flat_buffer(
3629    basic_flat_buffer const& other,
3630    Allocator const& alloc);
3631```
3632
3633[heading Description]
3634This container is constructed with the contents of `other` using copy semantics and the specified allocator. The maximum size will be the same as the copied object.
3635
3636[heading Parameters]
3637[table [[Name][Description]]
3638  [
3639    [`other`
3640    ]
3641    [
3642The object to copy from.
3643    ]
3644  ]
3645  [
3646    [`alloc`
3647    ]
3648    [
3649The allocator to use for the object.
3650    ]
3651  ]
3652]
3653[heading Exceptions]
3654[table [[Type][Thrown On]]
3655  [
3656    [`std::length_error`
3657    ]
3658    [
3659if `other.size()` exceeds the maximum allocation size of `alloc`.
3660    ]
3661  ]
3662]
3663
3664[endsect]
3665
3666[section:overload9 basic_flat_buffer::basic_flat_buffer (9 of 10 overloads)]
3667
3668Copy Constructor.
3669[heading Synopsis]
3670```
3671template<
3672    class OtherAlloc>
3673basic_flat_buffer(
3674    basic_flat_buffer< OtherAlloc > const& other);
3675```
3676
3677[heading Description]
3678This container is constructed with the contents of `other` using copy semantics. The maximum size will be the same as the copied object.
3679
3680[heading Parameters]
3681[table [[Name][Description]]
3682  [
3683    [`other`
3684    ]
3685    [
3686The object to copy from.
3687    ]
3688  ]
3689]
3690[heading Exceptions]
3691[table [[Type][Thrown On]]
3692  [
3693    [`std::length_error`
3694    ]
3695    [
3696if `other.size()` exceeds the maximum allocation size of the allocator.
3697    ]
3698  ]
3699]
3700
3701[endsect]
3702
3703[section:overload10 basic_flat_buffer::basic_flat_buffer (10 of 10 overloads)]
3704
3705Copy Constructor.
3706[heading Synopsis]
3707```
3708template<
3709    class OtherAlloc>
3710basic_flat_buffer(
3711    basic_flat_buffer< OtherAlloc > const& other,
3712    Allocator const& alloc);
3713```
3714
3715[heading Description]
3716This container is constructed with the contents of `other` using copy semantics. The maximum size will be the same as the copied object.
3717
3718[heading Parameters]
3719[table [[Name][Description]]
3720  [
3721    [`other`
3722    ]
3723    [
3724The object to copy from.
3725    ]
3726  ]
3727  [
3728    [`alloc`
3729    ]
3730    [
3731The allocator to use for the object.
3732    ]
3733  ]
3734]
3735[heading Exceptions]
3736[table [[Type][Thrown On]]
3737  [
3738    [`std::length_error`
3739    ]
3740    [
3741if `other.size()` exceeds the maximum allocation size of `alloc`.
3742    ]
3743  ]
3744]
3745
3746[endsect]
3747
3748
3749[endsect]
3750
3751[section:operator_eq_ basic_flat_buffer::operator=]
3752[indexterm2 operator=..basic_flat_buffer]
3753
3754
3755Move Assignment.
3756```
3757basic_flat_buffer&
3758``[link beast.ref.boost__beast__basic_flat_buffer.operator_eq_.overload1 operator=]``(
3759    basic_flat_buffer&& other);
3760  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.operator_eq_.overload1 `more...`]]``
3761```
3762
3763
3764Copy Assignment.
3765```
3766basic_flat_buffer&
3767``[link beast.ref.boost__beast__basic_flat_buffer.operator_eq_.overload2 operator=]``(
3768    basic_flat_buffer const& other);
3769  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.operator_eq_.overload2 `more...`]]``
3770```
3771
3772
3773Copy assignment.
3774```
3775template<
3776    class OtherAlloc>
3777basic_flat_buffer&
3778``[link beast.ref.boost__beast__basic_flat_buffer.operator_eq_.overload3 operator=]``(
3779    basic_flat_buffer< OtherAlloc > const& other);
3780  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.operator_eq_.overload3 `more...`]]``
3781```
3782
3783[section:overload1 basic_flat_buffer::operator= (1 of 3 overloads)]
3784
3785Move Assignment.
3786[heading Synopsis]
3787```
3788basic_flat_buffer&
3789operator=(
3790    basic_flat_buffer&& other);
3791```
3792
3793[heading Description]
3794The container is assigned with the contents of `other` using move semantics. The maximum size will be the same as the moved-from object.
3795Buffer sequences previously obtained from `other` using [link beast.ref.boost__beast__basic_flat_buffer.data `data`] or [link beast.ref.boost__beast__basic_flat_buffer.prepare `prepare`] remain valid after the move.
3796
3797[heading Parameters]
3798[table [[Name][Description]]
3799  [
3800    [`other`
3801    ]
3802    [
3803The object to move from. After the move, the moved-from object will have zero capacity, zero readable bytes, and zero writable bytes.
3804    ]
3805  ]
3806]
3807[heading Exception Safety]
3808
3809No-throw guarantee.
3810
3811[endsect]
3812
3813[section:overload2 basic_flat_buffer::operator= (2 of 3 overloads)]
3814
3815Copy Assignment.
3816[heading Synopsis]
3817```
3818basic_flat_buffer&
3819operator=(
3820    basic_flat_buffer const& other);
3821```
3822
3823[heading Description]
3824The container is assigned with the contents of `other` using copy semantics. The maximum size will be the same as the copied object.
3825After the copy, `this` will have zero writable bytes.
3826
3827[heading Parameters]
3828[table [[Name][Description]]
3829  [
3830    [`other`
3831    ]
3832    [
3833The object to copy from.
3834    ]
3835  ]
3836]
3837[heading Exceptions]
3838[table [[Type][Thrown On]]
3839  [
3840    [`std::length_error`
3841    ]
3842    [
3843if `other.size()` exceeds the maximum allocation size of the allocator.
3844    ]
3845  ]
3846]
3847
3848[endsect]
3849
3850[section:overload3 basic_flat_buffer::operator= (3 of 3 overloads)]
3851
3852Copy assignment.
3853[heading Synopsis]
3854```
3855template<
3856    class OtherAlloc>
3857basic_flat_buffer&
3858operator=(
3859    basic_flat_buffer< OtherAlloc > const& other);
3860```
3861
3862[heading Description]
3863The container is assigned with the contents of `other` using copy semantics. The maximum size will be the same as the copied object.
3864After the copy, `this` will have zero writable bytes.
3865
3866[heading Parameters]
3867[table [[Name][Description]]
3868  [
3869    [`other`
3870    ]
3871    [
3872The object to copy from.
3873    ]
3874  ]
3875]
3876[heading Exceptions]
3877[table [[Type][Thrown On]]
3878  [
3879    [`std::length_error`
3880    ]
3881    [
3882if `other.size()` exceeds the maximum allocation size of the allocator.
3883    ]
3884  ]
3885]
3886
3887[endsect]
3888
3889
3890[endsect]
3891
3892[section:get_allocator basic_flat_buffer::get_allocator]
3893[indexterm2 get_allocator..basic_flat_buffer]
3894
3895
3896Returns a copy of the allocator used.
3897[heading Synopsis]
3898```
3899allocator_type
3900get_allocator() const;
3901```
3902
3903[heading Description]
3904
3905[endsect]
3906
3907[section:max_size basic_flat_buffer::max_size]
3908[indexterm2 max_size..basic_flat_buffer]
3909
3910
3911Set the maximum allowed capacity.
3912```
3913void
3914``[link beast.ref.boost__beast__basic_flat_buffer.max_size.overload1 max_size]``(
3915    std::size_t n);
3916  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.max_size.overload1 `more...`]]``
3917```
3918
3919
3920Return the maximum number of bytes, both readable and writable, that can ever be held.
3921```
3922std::size_t
3923``[link beast.ref.boost__beast__basic_flat_buffer.max_size.overload2 max_size]``() const;
3924  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.max_size.overload2 `more...`]]``
3925```
3926
3927[section:overload1 basic_flat_buffer::max_size (1 of 2 overloads)]
3928
3929Set the maximum allowed capacity.
3930[heading Synopsis]
3931```
3932void
3933max_size(
3934    std::size_t n);
3935```
3936
3937[heading Description]
3938This function changes the currently configured upper limit on capacity to the specified value.
3939
3940[heading Parameters]
3941[table [[Name][Description]]
3942  [
3943    [`n`
3944    ]
3945    [
3946The maximum number of bytes ever allowed for capacity.
3947    ]
3948  ]
3949]
3950[heading Exception Safety]
3951
3952No-throw guarantee.
3953
3954[endsect]
3955
3956[section:overload2 basic_flat_buffer::max_size (2 of 2 overloads)]
3957
3958Return the maximum number of bytes, both readable and writable, that can ever be held.
3959[heading Synopsis]
3960```
3961std::size_t
3962max_size() const;
3963```
3964
3965[heading Description]
3966
3967[endsect]
3968
3969
3970[endsect]
3971
3972[section:reserve basic_flat_buffer::reserve]
3973[indexterm2 reserve..basic_flat_buffer]
3974
3975
3976Guarantee a minimum capacity.
3977[heading Synopsis]
3978```
3979void
3980reserve(
3981    std::size_t n);
3982```
3983
3984[heading Description]
3985This function adjusts the internal storage (if necessary) to guarantee space for at least `n` bytes.
3986Buffer sequences previously obtained using [link beast.ref.boost__beast__basic_flat_buffer.data `data`] or [link beast.ref.boost__beast__basic_flat_buffer.prepare `prepare`] become invalid.
3987
3988[heading Parameters]
3989[table [[Name][Description]]
3990  [
3991    [`n`
3992    ]
3993    [
3994The minimum number of byte for the new capacity. If this value is greater than the maximum size, then the maximum size will be adjusted upwards to this value.
3995    ]
3996  ]
3997]
3998[heading Exception Safety]
3999
4000Basic guarantee.
4001
4002[heading Exceptions]
4003[table [[Type][Thrown On]]
4004  [
4005    [`std::length_error`
4006    ]
4007    [
4008if n is larger than the maximum allocation size of the allocator.
4009    ]
4010  ]
4011]
4012
4013[endsect]
4014
4015[section:shrink_to_fit basic_flat_buffer::shrink_to_fit]
4016[indexterm2 shrink_to_fit..basic_flat_buffer]
4017
4018
4019Request the removal of unused capacity.
4020[heading Synopsis]
4021```
4022void
4023shrink_to_fit();
4024```
4025
4026[heading Description]
4027This function attempts to reduce [link beast.ref.boost__beast__basic_flat_buffer.capacity `capacity()`] to [link beast.ref.boost__beast__basic_flat_buffer.size `size()`], which may not succeed.
4028
4029[heading Exception Safety]
4030
4031No-throw guarantee.
4032
4033[endsect]
4034
4035[section:clear basic_flat_buffer::clear]
4036[indexterm2 clear..basic_flat_buffer]
4037
4038
4039Set the size of the readable and writable bytes to zero.
4040[heading Synopsis]
4041```
4042void
4043clear();
4044```
4045
4046[heading Description]
4047This clears the buffer without changing capacity. Buffer sequences previously obtained using [link beast.ref.boost__beast__basic_flat_buffer.data `data`] or [link beast.ref.boost__beast__basic_flat_buffer.prepare `prepare`] become invalid.
4048
4049[heading Exception Safety]
4050
4051No-throw guarantee.
4052
4053[endsect]
4054
4055[section:size basic_flat_buffer::size]
4056[indexterm2 size..basic_flat_buffer]
4057
4058
4059Returns the number of readable bytes.
4060[heading Synopsis]
4061```
4062std::size_t
4063size() const;
4064```
4065
4066[heading Description]
4067
4068[endsect]
4069
4070[section:capacity basic_flat_buffer::capacity]
4071[indexterm2 capacity..basic_flat_buffer]
4072
4073
4074Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
4075[heading Synopsis]
4076```
4077std::size_t
4078capacity() const;
4079```
4080
4081[heading Description]
4082
4083[endsect]
4084
4085[section:data basic_flat_buffer::data]
4086[indexterm2 data..basic_flat_buffer]
4087
4088
4089Returns a constant buffer sequence representing the readable bytes.
4090```
4091const_buffers_type
4092``[link beast.ref.boost__beast__basic_flat_buffer.data.overload1 data]``() const;
4093  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.data.overload1 `more...`]]``
4094```
4095
4096
4097Returns a mutable buffer sequence representing the readable bytes.
4098```
4099mutable_buffers_type
4100``[link beast.ref.boost__beast__basic_flat_buffer.data.overload2 data]``();
4101  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_flat_buffer.data.overload2 `more...`]]``
4102```
4103
4104[section:overload1 basic_flat_buffer::data (1 of 2 overloads)]
4105
4106Returns a constant buffer sequence representing the readable bytes.
4107[heading Synopsis]
4108```
4109const_buffers_type
4110data() const;
4111```
4112
4113[heading Description]
4114
4115[endsect]
4116
4117[section:overload2 basic_flat_buffer::data (2 of 2 overloads)]
4118
4119Returns a mutable buffer sequence representing the readable bytes.
4120[heading Synopsis]
4121```
4122mutable_buffers_type
4123data();
4124```
4125
4126[heading Description]
4127
4128[endsect]
4129
4130
4131[endsect]
4132
4133[section:cdata basic_flat_buffer::cdata]
4134[indexterm2 cdata..basic_flat_buffer]
4135
4136
4137Returns a constant buffer sequence representing the readable bytes.
4138[heading Synopsis]
4139```
4140const_buffers_type
4141cdata() const;
4142```
4143
4144[heading Description]
4145
4146[endsect]
4147
4148[section:prepare basic_flat_buffer::prepare]
4149[indexterm2 prepare..basic_flat_buffer]
4150
4151
4152Returns a mutable buffer sequence representing writable bytes.
4153[heading Synopsis]
4154```
4155mutable_buffers_type
4156prepare(
4157    std::size_t n);
4158```
4159
4160[heading Description]
4161Returns a mutable buffer sequence representing the writable bytes containing exactly `n` bytes of storage. Memory may be reallocated as needed.
4162All buffers sequences previously obtained using [link beast.ref.boost__beast__basic_flat_buffer.data `data`] or [link beast.ref.boost__beast__basic_flat_buffer.prepare `prepare`] become invalid.
4163
4164[heading Parameters]
4165[table [[Name][Description]]
4166  [
4167    [`n`
4168    ]
4169    [
4170The desired number of bytes in the returned buffer sequence.
4171    ]
4172  ]
4173]
4174[heading Exceptions]
4175[table [[Type][Thrown On]]
4176  [
4177    [`std::length_error`
4178    ]
4179    [
4180if [link beast.ref.boost__beast__basic_flat_buffer.size `size()`] + n exceeds either [link beast.ref.boost__beast__basic_flat_buffer.max_size `max_size()`] or the allocator's maximum allocation size.
4181    ]
4182  ]
4183]
4184[heading Exception Safety]
4185
4186Strong guarantee.
4187
4188[endsect]
4189
4190[section:commit basic_flat_buffer::commit]
4191[indexterm2 commit..basic_flat_buffer]
4192
4193
4194Append writable bytes to the readable bytes.
4195[heading Synopsis]
4196```
4197void
4198commit(
4199    std::size_t n);
4200```
4201
4202[heading Description]
4203Appends n bytes from the start of the writable bytes to the end of the readable bytes. The remainder of the writable bytes are discarded. If n is greater than the number of writable bytes, all writable bytes are appended to the readable bytes.
4204All buffers sequences previously obtained using [link beast.ref.boost__beast__basic_flat_buffer.data `data`] or [link beast.ref.boost__beast__basic_flat_buffer.prepare `prepare`] become invalid.
4205
4206[heading Parameters]
4207[table [[Name][Description]]
4208  [
4209    [`n`
4210    ]
4211    [
4212The number of bytes to append. If this number is greater than the number of writable bytes, all writable bytes are appended.
4213    ]
4214  ]
4215]
4216[heading Exception Safety]
4217
4218No-throw guarantee.
4219
4220[endsect]
4221
4222[section:consume basic_flat_buffer::consume]
4223[indexterm2 consume..basic_flat_buffer]
4224
4225
4226Remove bytes from beginning of the readable bytes.
4227[heading Synopsis]
4228```
4229void
4230consume(
4231    std::size_t n);
4232```
4233
4234[heading Description]
4235Removes n bytes from the beginning of the readable bytes.
4236All buffers sequences previously obtained using [link beast.ref.boost__beast__basic_flat_buffer.data `data`] or [link beast.ref.boost__beast__basic_flat_buffer.prepare `prepare`] become invalid.
4237
4238[heading Parameters]
4239[table [[Name][Description]]
4240  [
4241    [`n`
4242    ]
4243    [
4244The number of bytes to remove. If this number is greater than the number of readable bytes, all readable bytes are removed.
4245    ]
4246  ]
4247]
4248[heading Exception Safety]
4249
4250No-throw guarantee.
4251
4252[endsect]
4253
4254
4255[endsect]
4256
4257[section:boost__beast__basic_multi_buffer basic_multi_buffer]
4258
4259A dynamic buffer providing sequences of variable length.
4260[heading Synopsis]
4261Defined in header [include_file boost/beast/core/multi_buffer.hpp]
4262
4263```
4264template<
4265    class __Allocator__>
4266class basic_multi_buffer
4267```
4268
4269[heading Types]
4270[table [[Name][Description]]
4271  [
4272    [[*[link beast.ref.boost__beast__basic_multi_buffer.allocator_type allocator_type]]
4273    ]
4274    [
4275
4276The type of allocator used.
4277    ]
4278  ]
4279  [
4280    [[*[link beast.ref.boost__beast__basic_multi_buffer.const_buffers_type const_buffers_type]]
4281    ]
4282    [
4283
4284The ConstBufferSequence used to represent the readable bytes.
4285    ]
4286  ]
4287  [
4288    [[*[link beast.ref.boost__beast__basic_multi_buffer.mutable_buffers_type mutable_buffers_type]]
4289    ]
4290    [
4291
4292The MutableBufferSequence used to represent the writable bytes.
4293    ]
4294  ]
4295]
4296[heading Member Functions]
4297[table [[Name][Description]]
4298  [
4299    [[*[link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer basic_multi_buffer]]
4300    ]
4301    [
4302
4303Constructor.
4304
4305Move Constructor.
4306
4307Copy Constructor.
4308    ]
4309  ]
4310  [
4311    [[*[link beast.ref.boost__beast__basic_multi_buffer.capacity capacity]]
4312    ]
4313    [
4314
4315Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
4316    ]
4317  ]
4318  [
4319    [[*[link beast.ref.boost__beast__basic_multi_buffer.cdata cdata]]
4320    ]
4321    [
4322
4323Returns a constant buffer sequence representing the readable bytes.
4324    ]
4325  ]
4326  [
4327    [[*[link beast.ref.boost__beast__basic_multi_buffer.clear clear]]
4328    ]
4329    [
4330
4331Set the size of the readable and writable bytes to zero.
4332    ]
4333  ]
4334  [
4335    [[*[link beast.ref.boost__beast__basic_multi_buffer.commit commit]]
4336    ]
4337    [
4338
4339Append writable bytes to the readable bytes.
4340    ]
4341  ]
4342  [
4343    [[*[link beast.ref.boost__beast__basic_multi_buffer.consume consume]]
4344    ]
4345    [
4346
4347Remove bytes from beginning of the readable bytes.
4348    ]
4349  ]
4350  [
4351    [[*[link beast.ref.boost__beast__basic_multi_buffer.data data]]
4352    ]
4353    [
4354
4355Returns a constant buffer sequence representing the readable bytes.
4356
4357Returns a mutable buffer sequence representing the readable bytes.
4358    ]
4359  ]
4360  [
4361    [[*[link beast.ref.boost__beast__basic_multi_buffer.get_allocator get_allocator]]
4362    ]
4363    [
4364
4365Returns a copy of the allocator used.
4366    ]
4367  ]
4368  [
4369    [[*[link beast.ref.boost__beast__basic_multi_buffer.max_size max_size]]
4370    ]
4371    [
4372
4373Set the maximum allowed capacity.
4374
4375Return the maximum number of bytes, both readable and writable, that can ever be held.
4376    ]
4377  ]
4378  [
4379    [[*[link beast.ref.boost__beast__basic_multi_buffer.operator_eq_ operator=]]
4380    ]
4381    [
4382
4383Move Assignment.
4384
4385Copy Assignment.
4386    ]
4387  ]
4388  [
4389    [[*[link beast.ref.boost__beast__basic_multi_buffer.prepare prepare]]
4390    ]
4391    [
4392
4393Returns a mutable buffer sequence representing writable bytes.
4394    ]
4395  ]
4396  [
4397    [[*[link beast.ref.boost__beast__basic_multi_buffer.reserve reserve]]
4398    ]
4399    [
4400
4401Guarantee a minimum capacity.
4402    ]
4403  ]
4404  [
4405    [[*[link beast.ref.boost__beast__basic_multi_buffer.shrink_to_fit shrink_to_fit]]
4406    ]
4407    [
4408
4409Reallocate the buffer to fit the readable bytes exactly.
4410    ]
4411  ]
4412  [
4413    [[*[link beast.ref.boost__beast__basic_multi_buffer.size size]]
4414    ]
4415    [
4416
4417Returns the number of readable bytes.
4418    ]
4419  ]
4420  [
4421    [[*[link beast.ref.boost__beast__basic_multi_buffer._basic_multi_buffer ~basic_multi_buffer]]
4422    ]
4423    [
4424
4425Destructor.
4426    ]
4427  ]
4428]
4429[heading Friends]
4430[table [[Name][Description]]
4431  [
4432    [[*[link beast.ref.boost__beast__basic_multi_buffer.swap swap]]
4433    ]
4434    [
4435
4436Exchange two dynamic buffers.
4437    ]
4438  ]
4439]
4440[heading Description]
4441A dynamic buffer encapsulates memory storage that may be automatically resized as required, where the memory is divided into two regions: readable bytes followed by writable bytes. These memory regions are internal to the dynamic buffer, but direct access to the elements is provided to permit them to be efficiently used with I/O operations.
4442The implementation uses a sequence of one or more byte arrays of varying sizes to represent the readable and writable bytes. Additional byte array objects are appended to the sequence to accommodate changes in the desired size. The behavior and implementation of this container is most similar to `std::deque`.
4443Objects of this type meet the requirements of ['DynamicBuffer] and have the following additional properties:
4444
4445* A mutable buffer sequence representing the readable bytes is returned by [link beast.ref.boost__beast__basic_multi_buffer.data `data`] when `this` is non-const.
4446
4447* Buffer sequences representing the readable and writable bytes, returned by [link beast.ref.boost__beast__basic_multi_buffer.data `data`] and [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`], may have length greater than one.
4448
4449* A configurable maximum size may be set upon construction and adjusted afterwards. Calls to [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] that would exceed this size will throw `std::length_error`.
4450
4451* Sequences previously obtained using [link beast.ref.boost__beast__basic_multi_buffer.data `data`] remain valid after calls to [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] or [link beast.ref.boost__beast__basic_multi_buffer.commit `commit`].
4452
4453[heading Template Parameters]
4454[table [[Type][Description]]
4455  [
4456    [`Allocator`
4457    ]
4458    [
4459The allocator to use for managing memory.
4460    ]
4461  ]
4462]
4463
4464[section:const_buffers_type basic_multi_buffer::const_buffers_type]
4465[indexterm2 const_buffers_type..basic_multi_buffer]
4466
4467
4468The ConstBufferSequence used to represent the readable bytes.
4469[heading Synopsis]
4470```
4471using const_buffers_type = ``['implementation-defined]``;
4472```
4473
4474[heading Description]
4475
4476[endsect]
4477
4478[section:mutable_buffers_type basic_multi_buffer::mutable_buffers_type]
4479[indexterm2 mutable_buffers_type..basic_multi_buffer]
4480
4481
4482The MutableBufferSequence used to represent the writable bytes.
4483[heading Synopsis]
4484```
4485using mutable_buffers_type = ``['implementation-defined]``;
4486```
4487
4488[heading Description]
4489
4490[endsect]
4491
4492[section:allocator_type basic_multi_buffer::allocator_type]
4493[indexterm2 allocator_type..basic_multi_buffer]
4494
4495
4496The type of allocator used.
4497[heading Synopsis]
4498```
4499using allocator_type = Allocator;
4500```
4501
4502[heading Description]
4503
4504[endsect]
4505
4506[section:swap basic_multi_buffer::swap]
4507[indexterm2 swap..basic_multi_buffer]
4508
4509
4510Exchange two dynamic buffers.
4511[heading Synopsis]
4512Defined in header [include_file boost/beast/core/multi_buffer.hpp]
4513
4514```
4515template<
4516    class Alloc>
4517friend void
4518swap(
4519    basic_multi_buffer< Alloc >& lhs,
4520    basic_multi_buffer< Alloc >& rhs);
4521```
4522
4523[heading Description]
4524
4525
4526[endsect]
4527
4528[section:_basic_multi_buffer basic_multi_buffer::~basic_multi_buffer]
4529[indexterm2 ~basic_multi_buffer..basic_multi_buffer]
4530
4531
4532Destructor.
4533[heading Synopsis]
4534```
4535~basic_multi_buffer();
4536```
4537
4538[heading Description]
4539
4540[endsect]
4541
4542[section:basic_multi_buffer basic_multi_buffer::basic_multi_buffer]
4543[indexterm2 basic_multi_buffer..basic_multi_buffer]
4544
4545
4546Constructor.
4547```
4548``[link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload1 basic_multi_buffer]``();
4549  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload1 `more...`]]``
4550
4551explicit
4552``[link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload2 basic_multi_buffer]``(
4553    std::size_t limit);
4554  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload2 `more...`]]``
4555
4556explicit
4557``[link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload3 basic_multi_buffer]``(
4558    Allocator const& alloc);
4559  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload3 `more...`]]``
4560
4561``[link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload4 basic_multi_buffer]``(
4562    std::size_t limit,
4563    Allocator const& alloc);
4564  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload4 `more...`]]``
4565```
4566
4567
4568Move Constructor.
4569```
4570``[link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload5 basic_multi_buffer]``(
4571    basic_multi_buffer&& other);
4572  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload5 `more...`]]``
4573
4574``[link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload6 basic_multi_buffer]``(
4575    basic_multi_buffer&& other,
4576    Allocator const& alloc);
4577  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload6 `more...`]]``
4578```
4579
4580
4581Copy Constructor.
4582```
4583``[link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload7 basic_multi_buffer]``(
4584    basic_multi_buffer const& other);
4585  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload7 `more...`]]``
4586
4587``[link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload8 basic_multi_buffer]``(
4588    basic_multi_buffer const& other,
4589    Allocator const& alloc);
4590  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload8 `more...`]]``
4591
4592template<
4593    class OtherAlloc>
4594``[link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload9 basic_multi_buffer]``(
4595    basic_multi_buffer< OtherAlloc > const& other);
4596  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload9 `more...`]]``
4597
4598template<
4599    class OtherAlloc>
4600``[link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload10 basic_multi_buffer]``(
4601    basic_multi_buffer< OtherAlloc > const& other,
4602    allocator_type const& alloc);
4603  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer.overload10 `more...`]]``
4604```
4605
4606[section:overload1 basic_multi_buffer::basic_multi_buffer (1 of 10 overloads)]
4607
4608Constructor.
4609[heading Synopsis]
4610```
4611basic_multi_buffer();
4612```
4613
4614[heading Description]
4615After construction, [link beast.ref.boost__beast__basic_multi_buffer.capacity `capacity`] will return zero, and [link beast.ref.boost__beast__basic_multi_buffer.max_size `max_size`] will return the largest value which may be passed to the allocator's `allocate` function.
4616
4617[endsect]
4618
4619[section:overload2 basic_multi_buffer::basic_multi_buffer (2 of 10 overloads)]
4620
4621Constructor.
4622[heading Synopsis]
4623```
4624basic_multi_buffer(
4625    std::size_t limit);
4626```
4627
4628[heading Description]
4629After construction, [link beast.ref.boost__beast__basic_multi_buffer.capacity `capacity`] will return zero, and [link beast.ref.boost__beast__basic_multi_buffer.max_size `max_size`] will return the specified value of `limit`.
4630
4631[heading Parameters]
4632[table [[Name][Description]]
4633  [
4634    [`limit`
4635    ]
4636    [
4637The desired maximum size.
4638    ]
4639  ]
4640]
4641
4642[endsect]
4643
4644[section:overload3 basic_multi_buffer::basic_multi_buffer (3 of 10 overloads)]
4645
4646Constructor.
4647[heading Synopsis]
4648```
4649basic_multi_buffer(
4650    Allocator const& alloc);
4651```
4652
4653[heading Description]
4654After construction, [link beast.ref.boost__beast__basic_multi_buffer.capacity `capacity`] will return zero, and [link beast.ref.boost__beast__basic_multi_buffer.max_size `max_size`] will return the largest value which may be passed to the allocator's `allocate` function.
4655
4656[heading Parameters]
4657[table [[Name][Description]]
4658  [
4659    [`alloc`
4660    ]
4661    [
4662The allocator to use for the object.
4663    ]
4664  ]
4665]
4666[heading Exception Safety]
4667
4668No-throw guarantee.
4669
4670[endsect]
4671
4672[section:overload4 basic_multi_buffer::basic_multi_buffer (4 of 10 overloads)]
4673
4674Constructor.
4675[heading Synopsis]
4676```
4677basic_multi_buffer(
4678    std::size_t limit,
4679    Allocator const& alloc);
4680```
4681
4682[heading Description]
4683After construction, [link beast.ref.boost__beast__basic_multi_buffer.capacity `capacity`] will return zero, and [link beast.ref.boost__beast__basic_multi_buffer.max_size `max_size`] will return the specified value of `limit`.
4684
4685[heading Parameters]
4686[table [[Name][Description]]
4687  [
4688    [`limit`
4689    ]
4690    [
4691The desired maximum size.
4692    ]
4693  ]
4694  [
4695    [`alloc`
4696    ]
4697    [
4698The allocator to use for the object.
4699    ]
4700  ]
4701]
4702[heading Exception Safety]
4703
4704No-throw guarantee.
4705
4706[endsect]
4707
4708[section:overload5 basic_multi_buffer::basic_multi_buffer (5 of 10 overloads)]
4709
4710Move Constructor.
4711[heading Synopsis]
4712```
4713basic_multi_buffer(
4714    basic_multi_buffer&& other);
4715```
4716
4717[heading Description]
4718The container is constructed with the contents of `other` using move semantics. The maximum size will be the same as the moved-from object.
4719Buffer sequences previously obtained from `other` using [link beast.ref.boost__beast__basic_multi_buffer.data `data`] or [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] remain valid after the move.
4720
4721[heading Parameters]
4722[table [[Name][Description]]
4723  [
4724    [`other`
4725    ]
4726    [
4727The object to move from. After the move, the moved-from object will have zero capacity, zero readable bytes, and zero writable bytes.
4728    ]
4729  ]
4730]
4731[heading Exception Safety]
4732
4733No-throw guarantee.
4734
4735[endsect]
4736
4737[section:overload6 basic_multi_buffer::basic_multi_buffer (6 of 10 overloads)]
4738
4739Move Constructor.
4740[heading Synopsis]
4741```
4742basic_multi_buffer(
4743    basic_multi_buffer&& other,
4744    Allocator const& alloc);
4745```
4746
4747[heading Description]
4748Using `alloc` as the allocator for the new container, the contents of `other` are moved. If `alloc != other.get_allocator()`, this results in a copy. The maximum size will be the same as the moved-from object.
4749Buffer sequences previously obtained from `other` using [link beast.ref.boost__beast__basic_multi_buffer.data `data`] or [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] become invalid after the move.
4750
4751[heading Parameters]
4752[table [[Name][Description]]
4753  [
4754    [`other`
4755    ]
4756    [
4757The object to move from. After the move, the moved-from object will have zero capacity, zero readable bytes, and zero writable bytes.
4758    ]
4759  ]
4760  [
4761    [`alloc`
4762    ]
4763    [
4764The allocator to use for the object.
4765    ]
4766  ]
4767]
4768[heading Exceptions]
4769[table [[Type][Thrown On]]
4770  [
4771    [`std::length_error`
4772    ]
4773    [
4774if `other.size()` exceeds the maximum allocation size of `alloc`.
4775    ]
4776  ]
4777]
4778
4779[endsect]
4780
4781[section:overload7 basic_multi_buffer::basic_multi_buffer (7 of 10 overloads)]
4782
4783Copy Constructor.
4784[heading Synopsis]
4785```
4786basic_multi_buffer(
4787    basic_multi_buffer const& other);
4788```
4789
4790[heading Description]
4791This container is constructed with the contents of `other` using copy semantics. The maximum size will be the same as the copied object.
4792
4793[heading Parameters]
4794[table [[Name][Description]]
4795  [
4796    [`other`
4797    ]
4798    [
4799The object to copy from.
4800    ]
4801  ]
4802]
4803[heading Exceptions]
4804[table [[Type][Thrown On]]
4805  [
4806    [`std::length_error`
4807    ]
4808    [
4809if `other.size()` exceeds the maximum allocation size of the allocator.
4810    ]
4811  ]
4812]
4813
4814[endsect]
4815
4816[section:overload8 basic_multi_buffer::basic_multi_buffer (8 of 10 overloads)]
4817
4818Copy Constructor.
4819[heading Synopsis]
4820```
4821basic_multi_buffer(
4822    basic_multi_buffer const& other,
4823    Allocator const& alloc);
4824```
4825
4826[heading Description]
4827This container is constructed with the contents of `other` using copy semantics and the specified allocator. The maximum size will be the same as the copied object.
4828
4829[heading Parameters]
4830[table [[Name][Description]]
4831  [
4832    [`other`
4833    ]
4834    [
4835The object to copy from.
4836    ]
4837  ]
4838  [
4839    [`alloc`
4840    ]
4841    [
4842The allocator to use for the object.
4843    ]
4844  ]
4845]
4846[heading Exceptions]
4847[table [[Type][Thrown On]]
4848  [
4849    [`std::length_error`
4850    ]
4851    [
4852if `other.size()` exceeds the maximum allocation size of `alloc`.
4853    ]
4854  ]
4855]
4856
4857[endsect]
4858
4859[section:overload9 basic_multi_buffer::basic_multi_buffer (9 of 10 overloads)]
4860
4861Copy Constructor.
4862[heading Synopsis]
4863```
4864template<
4865    class OtherAlloc>
4866basic_multi_buffer(
4867    basic_multi_buffer< OtherAlloc > const& other);
4868```
4869
4870[heading Description]
4871This container is constructed with the contents of `other` using copy semantics. The maximum size will be the same as the copied object.
4872
4873[heading Parameters]
4874[table [[Name][Description]]
4875  [
4876    [`other`
4877    ]
4878    [
4879The object to copy from.
4880    ]
4881  ]
4882]
4883[heading Exceptions]
4884[table [[Type][Thrown On]]
4885  [
4886    [`std::length_error`
4887    ]
4888    [
4889if `other.size()` exceeds the maximum allocation size of the allocator.
4890    ]
4891  ]
4892]
4893
4894[endsect]
4895
4896[section:overload10 basic_multi_buffer::basic_multi_buffer (10 of 10 overloads)]
4897
4898Copy Constructor.
4899[heading Synopsis]
4900```
4901template<
4902    class OtherAlloc>
4903basic_multi_buffer(
4904    basic_multi_buffer< OtherAlloc > const& other,
4905    allocator_type const& alloc);
4906```
4907
4908[heading Description]
4909This container is constructed with the contents of `other` using copy semantics. The maximum size will be the same as the copied object.
4910
4911[heading Parameters]
4912[table [[Name][Description]]
4913  [
4914    [`other`
4915    ]
4916    [
4917The object to copy from.
4918    ]
4919  ]
4920  [
4921    [`alloc`
4922    ]
4923    [
4924The allocator to use for the object.
4925    ]
4926  ]
4927]
4928[heading Exceptions]
4929[table [[Type][Thrown On]]
4930  [
4931    [`std::length_error`
4932    ]
4933    [
4934if `other.size()` exceeds the maximum allocation size of `alloc`.
4935    ]
4936  ]
4937]
4938
4939[endsect]
4940
4941
4942[endsect]
4943
4944[section:operator_eq_ basic_multi_buffer::operator=]
4945[indexterm2 operator=..basic_multi_buffer]
4946
4947
4948Move Assignment.
4949```
4950basic_multi_buffer&
4951``[link beast.ref.boost__beast__basic_multi_buffer.operator_eq_.overload1 operator=]``(
4952    basic_multi_buffer&& other);
4953  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.operator_eq_.overload1 `more...`]]``
4954```
4955
4956
4957Copy Assignment.
4958```
4959basic_multi_buffer&
4960``[link beast.ref.boost__beast__basic_multi_buffer.operator_eq_.overload2 operator=]``(
4961    basic_multi_buffer const& other);
4962  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.operator_eq_.overload2 `more...`]]``
4963
4964template<
4965    class OtherAlloc>
4966basic_multi_buffer&
4967``[link beast.ref.boost__beast__basic_multi_buffer.operator_eq_.overload3 operator=]``(
4968    basic_multi_buffer< OtherAlloc > const& other);
4969  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.operator_eq_.overload3 `more...`]]``
4970```
4971
4972[section:overload1 basic_multi_buffer::operator= (1 of 3 overloads)]
4973
4974Move Assignment.
4975[heading Synopsis]
4976```
4977basic_multi_buffer&
4978operator=(
4979    basic_multi_buffer&& other);
4980```
4981
4982[heading Description]
4983The container is assigned with the contents of `other` using move semantics. The maximum size will be the same as the moved-from object.
4984Buffer sequences previously obtained from `other` using [link beast.ref.boost__beast__basic_multi_buffer.data `data`] or [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] remain valid after the move.
4985
4986[heading Parameters]
4987[table [[Name][Description]]
4988  [
4989    [`other`
4990    ]
4991    [
4992The object to move from. After the move, the moved-from object will have zero capacity, zero readable bytes, and zero writable bytes.
4993    ]
4994  ]
4995]
4996
4997[endsect]
4998
4999[section:overload2 basic_multi_buffer::operator= (2 of 3 overloads)]
5000
5001Copy Assignment.
5002[heading Synopsis]
5003```
5004basic_multi_buffer&
5005operator=(
5006    basic_multi_buffer const& other);
5007```
5008
5009[heading Description]
5010The container is assigned with the contents of `other` using copy semantics. The maximum size will be the same as the copied object.
5011After the copy, `this` will have zero writable bytes.
5012
5013[heading Parameters]
5014[table [[Name][Description]]
5015  [
5016    [`other`
5017    ]
5018    [
5019The object to copy from.
5020    ]
5021  ]
5022]
5023[heading Exceptions]
5024[table [[Type][Thrown On]]
5025  [
5026    [`std::length_error`
5027    ]
5028    [
5029if `other.size()` exceeds the maximum allocation size of the allocator.
5030    ]
5031  ]
5032]
5033
5034[endsect]
5035
5036[section:overload3 basic_multi_buffer::operator= (3 of 3 overloads)]
5037
5038Copy Assignment.
5039[heading Synopsis]
5040```
5041template<
5042    class OtherAlloc>
5043basic_multi_buffer&
5044operator=(
5045    basic_multi_buffer< OtherAlloc > const& other);
5046```
5047
5048[heading Description]
5049The container is assigned with the contents of `other` using copy semantics. The maximum size will be the same as the copied object.
5050After the copy, `this` will have zero writable bytes.
5051
5052[heading Parameters]
5053[table [[Name][Description]]
5054  [
5055    [`other`
5056    ]
5057    [
5058The object to copy from.
5059    ]
5060  ]
5061]
5062[heading Exceptions]
5063[table [[Type][Thrown On]]
5064  [
5065    [`std::length_error`
5066    ]
5067    [
5068if `other.size()` exceeds the maximum allocation size of the allocator.
5069    ]
5070  ]
5071]
5072
5073[endsect]
5074
5075
5076[endsect]
5077
5078[section:get_allocator basic_multi_buffer::get_allocator]
5079[indexterm2 get_allocator..basic_multi_buffer]
5080
5081
5082Returns a copy of the allocator used.
5083[heading Synopsis]
5084```
5085allocator_type
5086get_allocator() const;
5087```
5088
5089[heading Description]
5090
5091[endsect]
5092
5093[section:max_size basic_multi_buffer::max_size]
5094[indexterm2 max_size..basic_multi_buffer]
5095
5096
5097Set the maximum allowed capacity.
5098```
5099void
5100``[link beast.ref.boost__beast__basic_multi_buffer.max_size.overload1 max_size]``(
5101    std::size_t n);
5102  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.max_size.overload1 `more...`]]``
5103```
5104
5105
5106Return the maximum number of bytes, both readable and writable, that can ever be held.
5107```
5108size_type
5109``[link beast.ref.boost__beast__basic_multi_buffer.max_size.overload2 max_size]``() const;
5110  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.max_size.overload2 `more...`]]``
5111```
5112
5113[section:overload1 basic_multi_buffer::max_size (1 of 2 overloads)]
5114
5115Set the maximum allowed capacity.
5116[heading Synopsis]
5117```
5118void
5119max_size(
5120    std::size_t n);
5121```
5122
5123[heading Description]
5124This function changes the currently configured upper limit on capacity to the specified value.
5125
5126[heading Parameters]
5127[table [[Name][Description]]
5128  [
5129    [`n`
5130    ]
5131    [
5132The maximum number of bytes ever allowed for capacity.
5133    ]
5134  ]
5135]
5136[heading Exception Safety]
5137
5138No-throw guarantee.
5139
5140[endsect]
5141
5142[section:overload2 basic_multi_buffer::max_size (2 of 2 overloads)]
5143
5144Return the maximum number of bytes, both readable and writable, that can ever be held.
5145[heading Synopsis]
5146```
5147size_type
5148max_size() const;
5149```
5150
5151[heading Description]
5152
5153[endsect]
5154
5155
5156[endsect]
5157
5158[section:reserve basic_multi_buffer::reserve]
5159[indexterm2 reserve..basic_multi_buffer]
5160
5161
5162Guarantee a minimum capacity.
5163[heading Synopsis]
5164```
5165void
5166reserve(
5167    std::size_t n);
5168```
5169
5170[heading Description]
5171This function adjusts the internal storage (if necessary) to guarantee space for at least `n` bytes.
5172Buffer sequences previously obtained using [link beast.ref.boost__beast__basic_multi_buffer.data `data`] remain valid, while buffer sequences previously obtained using [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] become invalid.
5173
5174[heading Parameters]
5175[table [[Name][Description]]
5176  [
5177    [`n`
5178    ]
5179    [
5180The minimum number of byte for the new capacity. If this value is greater than the maximum size, then the maximum size will be adjusted upwards to this value.
5181    ]
5182  ]
5183]
5184[heading Exceptions]
5185[table [[Type][Thrown On]]
5186  [
5187    [`std::length_error`
5188    ]
5189    [
5190if n is larger than the maximum allocation size of the allocator.
5191    ]
5192  ]
5193]
5194[heading Exception Safety]
5195
5196Strong guarantee.
5197
5198[endsect]
5199
5200[section:shrink_to_fit basic_multi_buffer::shrink_to_fit]
5201[indexterm2 shrink_to_fit..basic_multi_buffer]
5202
5203
5204Reallocate the buffer to fit the readable bytes exactly.
5205[heading Synopsis]
5206```
5207void
5208shrink_to_fit();
5209```
5210
5211[heading Description]
5212Buffer sequences previously obtained using [link beast.ref.boost__beast__basic_multi_buffer.data `data`] or [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] become invalid.
5213
5214[heading Exception Safety]
5215
5216Strong guarantee.
5217
5218[endsect]
5219
5220[section:clear basic_multi_buffer::clear]
5221[indexterm2 clear..basic_multi_buffer]
5222
5223
5224Set the size of the readable and writable bytes to zero.
5225[heading Synopsis]
5226```
5227void
5228clear();
5229```
5230
5231[heading Description]
5232This clears the buffer without changing capacity. Buffer sequences previously obtained using [link beast.ref.boost__beast__basic_multi_buffer.data `data`] or [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] become invalid.
5233
5234[heading Exception Safety]
5235
5236No-throw guarantee.
5237
5238[endsect]
5239
5240[section:size basic_multi_buffer::size]
5241[indexterm2 size..basic_multi_buffer]
5242
5243
5244Returns the number of readable bytes.
5245[heading Synopsis]
5246```
5247size_type
5248size() const;
5249```
5250
5251[heading Description]
5252
5253[endsect]
5254
5255[section:capacity basic_multi_buffer::capacity]
5256[indexterm2 capacity..basic_multi_buffer]
5257
5258
5259Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
5260[heading Synopsis]
5261```
5262std::size_t
5263capacity() const;
5264```
5265
5266[heading Description]
5267
5268[endsect]
5269
5270[section:data basic_multi_buffer::data]
5271[indexterm2 data..basic_multi_buffer]
5272
5273
5274Returns a constant buffer sequence representing the readable bytes.
5275```
5276const_buffers_type
5277``[link beast.ref.boost__beast__basic_multi_buffer.data.overload1 data]``() const;
5278  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.data.overload1 `more...`]]``
5279```
5280
5281
5282Returns a mutable buffer sequence representing the readable bytes.
5283```
5284mutable_buffers_type
5285``[link beast.ref.boost__beast__basic_multi_buffer.data.overload2 data]``();
5286  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_multi_buffer.data.overload2 `more...`]]``
5287```
5288
5289[section:overload1 basic_multi_buffer::data (1 of 2 overloads)]
5290
5291Returns a constant buffer sequence representing the readable bytes.
5292[heading Synopsis]
5293```
5294const_buffers_type
5295data() const;
5296```
5297
5298[heading Description]
5299
5300[heading Remarks]
5301The sequence may contain multiple contiguous memory regions.
5302
5303[endsect]
5304
5305[section:overload2 basic_multi_buffer::data (2 of 2 overloads)]
5306
5307Returns a mutable buffer sequence representing the readable bytes.
5308[heading Synopsis]
5309```
5310mutable_buffers_type
5311data();
5312```
5313
5314[heading Description]
5315
5316[heading Remarks]
5317The sequence may contain multiple contiguous memory regions.
5318
5319[endsect]
5320
5321
5322[endsect]
5323
5324[section:cdata basic_multi_buffer::cdata]
5325[indexterm2 cdata..basic_multi_buffer]
5326
5327
5328Returns a constant buffer sequence representing the readable bytes.
5329[heading Synopsis]
5330```
5331const_buffers_type
5332cdata() const;
5333```
5334
5335[heading Description]
5336
5337[heading Remarks]
5338The sequence may contain multiple contiguous memory regions.
5339
5340[endsect]
5341
5342[section:prepare basic_multi_buffer::prepare]
5343[indexterm2 prepare..basic_multi_buffer]
5344
5345
5346Returns a mutable buffer sequence representing writable bytes.
5347[heading Synopsis]
5348```
5349mutable_buffers_type
5350prepare(
5351    size_type n);
5352```
5353
5354[heading Description]
5355Returns a mutable buffer sequence representing the writable bytes containing exactly `n` bytes of storage. Memory may be reallocated as needed.
5356All buffer sequences previously obtained using [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] are invalidated. Buffer sequences previously obtained using [link beast.ref.boost__beast__basic_multi_buffer.data `data`] remain valid.
5357
5358[heading Parameters]
5359[table [[Name][Description]]
5360  [
5361    [`n`
5362    ]
5363    [
5364The desired number of bytes in the returned buffer sequence.
5365    ]
5366  ]
5367]
5368[heading Exceptions]
5369[table [[Type][Thrown On]]
5370  [
5371    [`std::length_error`
5372    ]
5373    [
5374if [link beast.ref.boost__beast__basic_multi_buffer.size `size()`] + n exceeds [link beast.ref.boost__beast__basic_multi_buffer.max_size `max_size()`].
5375    ]
5376  ]
5377]
5378[heading Exception Safety]
5379
5380Strong guarantee.
5381
5382[endsect]
5383
5384[section:commit basic_multi_buffer::commit]
5385[indexterm2 commit..basic_multi_buffer]
5386
5387
5388Append writable bytes to the readable bytes.
5389[heading Synopsis]
5390```
5391void
5392commit(
5393    size_type n);
5394```
5395
5396[heading Description]
5397Appends n bytes from the start of the writable bytes to the end of the readable bytes. The remainder of the writable bytes are discarded. If n is greater than the number of writable bytes, all writable bytes are appended to the readable bytes.
5398All buffer sequences previously obtained using [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] are invalidated. Buffer sequences previously obtained using [link beast.ref.boost__beast__basic_multi_buffer.data `data`] remain valid.
5399
5400[heading Parameters]
5401[table [[Name][Description]]
5402  [
5403    [`n`
5404    ]
5405    [
5406The number of bytes to append. If this number is greater than the number of writable bytes, all writable bytes are appended.
5407    ]
5408  ]
5409]
5410[heading Exception Safety]
5411
5412No-throw guarantee.
5413
5414[endsect]
5415
5416[section:consume basic_multi_buffer::consume]
5417[indexterm2 consume..basic_multi_buffer]
5418
5419
5420Remove bytes from beginning of the readable bytes.
5421[heading Synopsis]
5422```
5423void
5424consume(
5425    size_type n);
5426```
5427
5428[heading Description]
5429Removes n bytes from the beginning of the readable bytes.
5430All buffers sequences previously obtained using [link beast.ref.boost__beast__basic_multi_buffer.data `data`] or [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] are invalidated.
5431
5432[heading Parameters]
5433[table [[Name][Description]]
5434  [
5435    [`n`
5436    ]
5437    [
5438The number of bytes to remove. If this number is greater than the number of readable bytes, all readable bytes are removed.
5439    ]
5440  ]
5441]
5442[heading Exception Safety]
5443
5444No-throw guarantee.
5445
5446[endsect]
5447
5448
5449[endsect]
5450
5451[section:boost__beast__http__basic_parser http::basic_parser]
5452
5453A parser for decoding HTTP/1 wire format messages.
5454[heading Synopsis]
5455Defined in header [include_file boost/beast/http/basic_parser.hpp]
5456
5457```
5458template<
5459    bool isRequest>
5460class basic_parser :
5461    private basic_parser_base
5462```
5463
5464[heading Types]
5465[table [[Name][Description]]
5466  [
5467    [[*[link beast.ref.boost__beast__http__basic_parser.is_request is_request]]
5468    ]
5469    [
5470
5471`true` if this parser parses requests, `false` for responses.
5472    ]
5473  ]
5474]
5475[heading Member Functions]
5476[table [[Name][Description]]
5477  [
5478    [[*[link beast.ref.boost__beast__http__basic_parser.basic_parser basic_parser]]
5479    ]
5480    [
5481
5482Copy constructor.
5483    ]
5484  ]
5485  [
5486    [[*[link beast.ref.boost__beast__http__basic_parser.body_limit body_limit]]
5487    ]
5488    [
5489
5490Set the limit on the payload body.
5491    ]
5492  ]
5493  [
5494    [[*[link beast.ref.boost__beast__http__basic_parser.chunked chunked]]
5495    ]
5496    [
5497
5498Returns `true` if the last value for Transfer-Encoding is "chunked".
5499    ]
5500  ]
5501  [
5502    [[*[link beast.ref.boost__beast__http__basic_parser.content_length content_length]]
5503    ]
5504    [
5505
5506Returns the optional value of Content-Length if known.
5507    ]
5508  ]
5509  [
5510    [[*[link beast.ref.boost__beast__http__basic_parser.content_length_remaining content_length_remaining]]
5511    ]
5512    [
5513
5514Returns the remaining content length if known.
5515    ]
5516  ]
5517  [
5518    [[*[link beast.ref.boost__beast__http__basic_parser.eager eager]]
5519    ]
5520    [
5521
5522Returns `true` if the eager parse option is set.
5523
5524Set the eager parse option.
5525    ]
5526  ]
5527  [
5528    [[*[link beast.ref.boost__beast__http__basic_parser.got_some got_some]]
5529    ]
5530    [
5531
5532Returns `true` if the parser has received at least one byte of input.
5533    ]
5534  ]
5535  [
5536    [[*[link beast.ref.boost__beast__http__basic_parser.header_limit header_limit]]
5537    ]
5538    [
5539
5540Set a limit on the total size of the header.
5541    ]
5542  ]
5543  [
5544    [[*[link beast.ref.boost__beast__http__basic_parser.is_done is_done]]
5545    ]
5546    [
5547
5548Returns `true` if the message is complete.
5549    ]
5550  ]
5551  [
5552    [[*[link beast.ref.boost__beast__http__basic_parser.is_header_done is_header_done]]
5553    ]
5554    [
5555
5556Returns `true` if a the parser has produced the full header.
5557    ]
5558  ]
5559  [
5560    [[*[link beast.ref.boost__beast__http__basic_parser.keep_alive keep_alive]]
5561    ]
5562    [
5563
5564Returns `true` if the message has keep-alive connection semantics.
5565    ]
5566  ]
5567  [
5568    [[*[link beast.ref.boost__beast__http__basic_parser.need_eof need_eof]]
5569    ]
5570    [
5571
5572Returns `true` if the message semantics require an end of file.
5573    ]
5574  ]
5575  [
5576    [[*[link beast.ref.boost__beast__http__basic_parser.operator_eq_ operator=]]
5577    ]
5578    [
5579
5580Copy assignment.
5581    ]
5582  ]
5583  [
5584    [[*[link beast.ref.boost__beast__http__basic_parser.put put]]
5585    ]
5586    [
5587
5588Write a buffer sequence to the parser.
5589    ]
5590  ]
5591  [
5592    [[*[link beast.ref.boost__beast__http__basic_parser.put_eof put_eof]]
5593    ]
5594    [
5595
5596Inform the parser that the end of stream was reached.
5597    ]
5598  ]
5599  [
5600    [[*[link beast.ref.boost__beast__http__basic_parser.skip skip]]
5601    ]
5602    [
5603
5604Returns `true` if the skip parse option is set.
5605
5606Set the skip parse option.
5607    ]
5608  ]
5609  [
5610    [[*[link beast.ref.boost__beast__http__basic_parser.upgrade upgrade]]
5611    ]
5612    [
5613
5614Returns `true` if the message is an upgrade message.
5615    ]
5616  ]
5617  [
5618    [[*[link beast.ref.boost__beast__http__basic_parser._basic_parser ~basic_parser]]
5619    ]
5620    [
5621
5622Destructor.
5623    ]
5624  ]
5625]
5626[heading Protected Member Functions]
5627[table [[Name][Description]]
5628  [
5629    [[*[link beast.ref.boost__beast__http__basic_parser.basic_parser basic_parser]]
5630    ]
5631    [
5632
5633Default constructor.
5634
5635Move constructor.
5636    ]
5637  ]
5638  [
5639    [[*[link beast.ref.boost__beast__http__basic_parser.on_body_impl on_body_impl]]
5640    ]
5641    [
5642
5643Called each time additional data is received representing the content body.
5644    ]
5645  ]
5646  [
5647    [[*[link beast.ref.boost__beast__http__basic_parser.on_body_init_impl on_body_init_impl]]
5648    ]
5649    [
5650
5651Called once before the body is processed.
5652    ]
5653  ]
5654  [
5655    [[*[link beast.ref.boost__beast__http__basic_parser.on_chunk_body_impl on_chunk_body_impl]]
5656    ]
5657    [
5658
5659Called each time additional data is received representing part of a body chunk.
5660    ]
5661  ]
5662  [
5663    [[*[link beast.ref.boost__beast__http__basic_parser.on_chunk_header_impl on_chunk_header_impl]]
5664    ]
5665    [
5666
5667Called each time a new chunk header of a chunk encoded body is received.
5668    ]
5669  ]
5670  [
5671    [[*[link beast.ref.boost__beast__http__basic_parser.on_field_impl on_field_impl]]
5672    ]
5673    [
5674
5675Called once for each complete field in the HTTP header.
5676    ]
5677  ]
5678  [
5679    [[*[link beast.ref.boost__beast__http__basic_parser.on_finish_impl on_finish_impl]]
5680    ]
5681    [
5682
5683Called once when the complete message is received.
5684    ]
5685  ]
5686  [
5687    [[*[link beast.ref.boost__beast__http__basic_parser.on_header_impl on_header_impl]]
5688    ]
5689    [
5690
5691Called once after the complete HTTP header is received.
5692    ]
5693  ]
5694  [
5695    [[*[link beast.ref.boost__beast__http__basic_parser.on_request_impl on_request_impl]]
5696    ]
5697    [
5698
5699Called after receiving the request-line.
5700    ]
5701  ]
5702  [
5703    [[*[link beast.ref.boost__beast__http__basic_parser.on_response_impl on_response_impl]]
5704    ]
5705    [
5706
5707Called after receiving the status-line.
5708    ]
5709  ]
5710  [
5711    [[*[link beast.ref.boost__beast__http__basic_parser.operator_eq_ operator=]]
5712    ]
5713    [
5714
5715Move assignment.
5716    ]
5717  ]
5718]
5719[heading Description]
5720This parser is designed to efficiently parse messages in the HTTP/1 wire format. It allocates no memory when input is presented as a single contiguous buffer, and uses minimal state. It will handle chunked encoding and it understands the semantics of the Connection, Content-Length, and Upgrade fields. The parser is optimized for the case where the input buffer sequence consists of a single contiguous buffer. The [link beast.ref.boost__beast__basic_flat_buffer `beast::basic_flat_buffer`] class is provided, which guarantees that the input sequence of the stream buffer will be represented by exactly one contiguous buffer. To ensure the optimum performance of the parser, use [link beast.ref.boost__beast__basic_flat_buffer `beast::basic_flat_buffer`] with HTTP algorithms such as [link beast.ref.boost__beast__http__read `read`], [link beast.ref.boost__beast__http__read_some `read_some`], [link beast.ref.boost__beast__http__async_read `async_read`], and [link beast.ref.boost__beast__http__async_read_some `async_read_some`]. Alternatively, the caller may use custom techniques to ensure that the structured portion of the HTTP message (header or chunk header) is contained in a linear buffer.
5721The interface to the parser uses virtual member functions. To use this class, derive your type from [link beast.ref.boost__beast__http__basic_parser `basic_parser`]. When bytes are presented, the implementation will make a series of zero or more calls to virtual functions, which the derived class must implement.
5722Every virtual function must be provided by the derived class, or else a compilation error will be generated. The implementation will make sure that `ec` is clear before each virtual function is invoked. If a virtual function sets an error, it is propagated out of the parser to the caller.
5723
5724[heading Template Parameters]
5725[table [[Type][Description]]
5726  [
5727    [`isRequest`
5728    ]
5729    [
5730A `bool` indicating whether the parser will be presented with request or response message.
5731    ]
5732  ]
5733]
5734[heading Remarks]
5735If the parser encounters a field value with obs-fold longer than 4 kilobytes in length, an error is generated.
5736
5737[section:is_request http::basic_parser::is_request]
5738[indexterm2 is_request..http::basic_parser]
5739
5740
5741`true` if this parser parses requests, `false` for responses.
5742[heading Synopsis]
5743```
5744using is_request = std::integral_constant< bool, isRequest >;
5745```
5746
5747[heading Description]
5748
5749[endsect]
5750
5751[section:basic_parser http::basic_parser::basic_parser]
5752[indexterm2 basic_parser..http::basic_parser]
5753
5754
5755Default constructor.
5756```
5757``[link beast.ref.boost__beast__http__basic_parser.basic_parser.overload1 basic_parser]``();
5758  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_parser.basic_parser.overload1 `more...`]]``
5759```
5760
5761
5762Move constructor.
5763```
5764``[link beast.ref.boost__beast__http__basic_parser.basic_parser.overload2 basic_parser]``(
5765    basic_parser&&);
5766  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_parser.basic_parser.overload2 `more...`]]``
5767```
5768
5769
5770Copy constructor.
5771```
5772``[link beast.ref.boost__beast__http__basic_parser.basic_parser.overload3 basic_parser]``(
5773    basic_parser const&);
5774  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_parser.basic_parser.overload3 `more...`]]``
5775```
5776
5777[section:overload1 http::basic_parser::basic_parser (1 of 3 overloads)]
5778
5779Default constructor.
5780[heading Synopsis]
5781```
5782basic_parser();
5783```
5784
5785[heading Description]
5786
5787[endsect]
5788
5789[section:overload2 http::basic_parser::basic_parser (2 of 3 overloads)]
5790
5791Move constructor.
5792[heading Synopsis]
5793```
5794basic_parser(
5795    basic_parser&&);
5796```
5797
5798[heading Description]
5799
5800[heading Remarks]
5801
5802After the move, the only valid operation on the moved-from object is destruction.
5803
5804[endsect]
5805
5806[section:overload3 http::basic_parser::basic_parser (3 of 3 overloads)]
5807
5808Copy constructor.
5809[heading Synopsis]
5810```
5811basic_parser(
5812    basic_parser const&);
5813```
5814
5815[heading Description]
5816
5817[endsect]
5818
5819
5820[endsect]
5821
5822[section:operator_eq_ http::basic_parser::operator=]
5823[indexterm2 operator=..http::basic_parser]
5824
5825
5826Move assignment.
5827```
5828basic_parser&
5829``[link beast.ref.boost__beast__http__basic_parser.operator_eq_.overload1 operator=]``(
5830    basic_parser&&);
5831  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_parser.operator_eq_.overload1 `more...`]]``
5832```
5833
5834
5835Copy assignment.
5836```
5837basic_parser&
5838``[link beast.ref.boost__beast__http__basic_parser.operator_eq_.overload2 operator=]``(
5839    basic_parser const&);
5840  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_parser.operator_eq_.overload2 `more...`]]``
5841```
5842
5843[section:overload1 http::basic_parser::operator= (1 of 2 overloads)]
5844
5845Move assignment.
5846[heading Synopsis]
5847```
5848basic_parser&
5849operator=(
5850    basic_parser&&);
5851```
5852
5853[heading Description]
5854
5855[endsect]
5856
5857[section:overload2 http::basic_parser::operator= (2 of 2 overloads)]
5858
5859Copy assignment.
5860[heading Synopsis]
5861```
5862basic_parser&
5863operator=(
5864    basic_parser const&);
5865```
5866
5867[heading Description]
5868
5869[endsect]
5870
5871
5872[endsect]
5873
5874[section:on_request_impl http::basic_parser::on_request_impl]
5875[indexterm2 on_request_impl..http::basic_parser]
5876
5877
5878Called after receiving the request-line.
5879[heading Synopsis]
5880```
5881void
5882on_request_impl(
5883    verb method,
5884    string_view method_str,
5885    string_view target,
5886    int version,
5887    error_code& ec);
5888```
5889
5890[heading Description]
5891This virtual function is invoked after receiving a request-line when parsing HTTP requests. It can only be called when `isRequest == true`.
5892
5893[heading Parameters]
5894[table [[Name][Description]]
5895  [
5896    [`method`
5897    ]
5898    [
5899The verb enumeration. If the method string is not one of the predefined strings, this value will be [link beast.ref.boost__beast__http__field `verb::unknown`].
5900    ]
5901  ]
5902  [
5903    [`method_str`
5904    ]
5905    [
5906The unmodified string representing the verb.
5907    ]
5908  ]
5909  [
5910    [`target`
5911    ]
5912    [
5913The request-target.
5914    ]
5915  ]
5916  [
5917    [`version`
5918    ]
5919    [
5920The HTTP-version. This will be 10 for HTTP/1.0, and 11 for HTTP/1.1.
5921    ]
5922  ]
5923  [
5924    [`ec`
5925    ]
5926    [
5927An output parameter which the function may set to indicate an error. The error will be clear before this function is invoked.
5928    ]
5929  ]
5930]
5931
5932[endsect]
5933
5934[section:on_response_impl http::basic_parser::on_response_impl]
5935[indexterm2 on_response_impl..http::basic_parser]
5936
5937
5938Called after receiving the status-line.
5939[heading Synopsis]
5940```
5941void
5942on_response_impl(
5943    int code,
5944    string_view reason,
5945    int version,
5946    error_code& ec);
5947```
5948
5949[heading Description]
5950This virtual function is invoked after receiving a status-line when parsing HTTP responses. It can only be called when `isRequest == false`.
5951
5952[heading Parameters]
5953[table [[Name][Description]]
5954  [
5955    [`code`
5956    ]
5957    [
5958The numeric status code.
5959    ]
5960  ]
5961  [
5962    [`reason`
5963    ]
5964    [
5965The reason-phrase. Note that this value is now obsolete, and only provided for historical or diagnostic purposes.
5966    ]
5967  ]
5968  [
5969    [`version`
5970    ]
5971    [
5972The HTTP-version. This will be 10 for HTTP/1.0, and 11 for HTTP/1.1.
5973    ]
5974  ]
5975  [
5976    [`ec`
5977    ]
5978    [
5979An output parameter which the function may set to indicate an error. The error will be clear before this function is invoked.
5980    ]
5981  ]
5982]
5983
5984[endsect]
5985
5986[section:on_field_impl http::basic_parser::on_field_impl]
5987[indexterm2 on_field_impl..http::basic_parser]
5988
5989
5990Called once for each complete field in the HTTP header.
5991[heading Synopsis]
5992```
5993void
5994on_field_impl(
5995    field name,
5996    string_view name_string,
5997    string_view value,
5998    error_code& ec);
5999```
6000
6001[heading Description]
6002This virtual function is invoked for each field that is received while parsing an HTTP message.
6003
6004[heading Parameters]
6005[table [[Name][Description]]
6006  [
6007    [`name`
6008    ]
6009    [
6010The known field enum value. If the name of the field is not recognized, this value will be [link beast.ref.boost__beast__http__field `field::unknown`].
6011    ]
6012  ]
6013  [
6014    [`name_string`
6015    ]
6016    [
6017The exact name of the field as received from the input, represented as a string.
6018    ]
6019  ]
6020  [
6021    [`value`
6022    ]
6023    [
6024A string holding the value of the field.
6025    ]
6026  ]
6027  [
6028    [`ec`
6029    ]
6030    [
6031An output parameter which the function may set to indicate an error. The error will be clear before this function is invoked.
6032    ]
6033  ]
6034]
6035
6036[endsect]
6037
6038[section:on_header_impl http::basic_parser::on_header_impl]
6039[indexterm2 on_header_impl..http::basic_parser]
6040
6041
6042Called once after the complete HTTP header is received.
6043[heading Synopsis]
6044```
6045void
6046on_header_impl(
6047    error_code& ec);
6048```
6049
6050[heading Description]
6051This virtual function is invoked once, after the complete HTTP header is received while parsing a message.
6052
6053[heading Parameters]
6054[table [[Name][Description]]
6055  [
6056    [`ec`
6057    ]
6058    [
6059An output parameter which the function may set to indicate an error. The error will be clear before this function is invoked.
6060    ]
6061  ]
6062]
6063
6064[endsect]
6065
6066[section:on_body_init_impl http::basic_parser::on_body_init_impl]
6067[indexterm2 on_body_init_impl..http::basic_parser]
6068
6069
6070Called once before the body is processed.
6071[heading Synopsis]
6072```
6073void
6074on_body_init_impl(
6075    boost::optional< std::uint64_t > const& content_length,
6076    error_code& ec);
6077```
6078
6079[heading Description]
6080This virtual function is invoked once, before the content body is processed (but after the complete header is received).
6081
6082[heading Parameters]
6083[table [[Name][Description]]
6084  [
6085    [`content_length`
6086    ]
6087    [
6088A value representing the content length in bytes if the length is known (this can include a zero length). Otherwise, the value will be `boost::none`.
6089    ]
6090  ]
6091  [
6092    [`ec`
6093    ]
6094    [
6095An output parameter which the function may set to indicate an error. The error will be clear before this function is invoked.
6096    ]
6097  ]
6098]
6099
6100[endsect]
6101
6102[section:on_body_impl http::basic_parser::on_body_impl]
6103[indexterm2 on_body_impl..http::basic_parser]
6104
6105
6106Called each time additional data is received representing the content body.
6107[heading Synopsis]
6108```
6109std::size_t
6110on_body_impl(
6111    string_view body,
6112    error_code& ec);
6113```
6114
6115[heading Description]
6116This virtual function is invoked for each piece of the body which is received while parsing of a message. This function is only used when no chunked transfer encoding is present.
6117
6118[heading Parameters]
6119[table [[Name][Description]]
6120  [
6121    [`body`
6122    ]
6123    [
6124A string holding the additional body contents. This may contain nulls or unprintable characters.
6125    ]
6126  ]
6127  [
6128    [`ec`
6129    ]
6130    [
6131An output parameter which the function may set to indicate an error. The error will be clear before this function is invoked.
6132    ]
6133  ]
6134]
6135[heading See Also]
6136[link beast.ref.boost__beast__http__basic_parser.on_chunk_body_impl `on_chunk_body_impl`]
6137
6138[endsect]
6139
6140[section:on_chunk_header_impl http::basic_parser::on_chunk_header_impl]
6141[indexterm2 on_chunk_header_impl..http::basic_parser]
6142
6143
6144Called each time a new chunk header of a chunk encoded body is received.
6145[heading Synopsis]
6146```
6147void
6148on_chunk_header_impl(
6149    std::uint64_t size,
6150    string_view extensions,
6151    error_code& ec);
6152```
6153
6154[heading Description]
6155This function is invoked each time a new chunk header is received. The function is only used when the chunked transfer encoding is present.
6156
6157[heading Parameters]
6158[table [[Name][Description]]
6159  [
6160    [`size`
6161    ]
6162    [
6163The size of this chunk, in bytes.
6164    ]
6165  ]
6166  [
6167    [`extensions`
6168    ]
6169    [
6170A string containing the entire chunk extensions. This may be empty, indicating no extensions are present.
6171    ]
6172  ]
6173  [
6174    [`ec`
6175    ]
6176    [
6177An output parameter which the function may set to indicate an error. The error will be clear before this function is invoked.
6178    ]
6179  ]
6180]
6181
6182[endsect]
6183
6184[section:on_chunk_body_impl http::basic_parser::on_chunk_body_impl]
6185[indexterm2 on_chunk_body_impl..http::basic_parser]
6186
6187
6188Called each time additional data is received representing part of a body chunk.
6189[heading Synopsis]
6190```
6191std::size_t
6192on_chunk_body_impl(
6193    std::uint64_t remain,
6194    string_view body,
6195    error_code& ec);
6196```
6197
6198[heading Description]
6199This virtual function is invoked for each piece of the body which is received while parsing of a message. This function is only used when no chunked transfer encoding is present.
6200
6201[heading Parameters]
6202[table [[Name][Description]]
6203  [
6204    [`remain`
6205    ]
6206    [
6207The number of bytes remaining in this chunk. This includes the contents of passed `body`. If this value is zero, then this represents the final chunk.
6208    ]
6209  ]
6210  [
6211    [`body`
6212    ]
6213    [
6214A string holding the additional body contents. This may contain nulls or unprintable characters.
6215    ]
6216  ]
6217  [
6218    [`ec`
6219    ]
6220    [
6221An output parameter which the function may set to indicate an error. The error will be clear before this function is invoked.
6222    ]
6223  ]
6224]
6225[heading Return Value]
6226This function should return the number of bytes actually consumed from the `body` value. Any bytes that are not consumed on this call will be presented in a subsequent call.
6227[heading See Also]
6228[link beast.ref.boost__beast__http__basic_parser.on_body_impl `on_body_impl`]
6229
6230[endsect]
6231
6232[section:on_finish_impl http::basic_parser::on_finish_impl]
6233[indexterm2 on_finish_impl..http::basic_parser]
6234
6235
6236Called once when the complete message is received.
6237[heading Synopsis]
6238```
6239void
6240on_finish_impl(
6241    error_code& ec);
6242```
6243
6244[heading Description]
6245This virtual function is invoked once, after successfully parsing a complete HTTP message.
6246
6247[heading Parameters]
6248[table [[Name][Description]]
6249  [
6250    [`ec`
6251    ]
6252    [
6253An output parameter which the function may set to indicate an error. The error will be clear before this function is invoked.
6254    ]
6255  ]
6256]
6257
6258[endsect]
6259
6260[section:_basic_parser http::basic_parser::~basic_parser]
6261[indexterm2 ~basic_parser..http::basic_parser]
6262
6263
6264Destructor.
6265[heading Synopsis]
6266```
6267virtual
6268~basic_parser();
6269```
6270
6271[heading Description]
6272
6273[endsect]
6274
6275[section:got_some http::basic_parser::got_some]
6276[indexterm2 got_some..http::basic_parser]
6277
6278
6279Returns `true` if the parser has received at least one byte of input.
6280[heading Synopsis]
6281```
6282bool
6283got_some() const;
6284```
6285
6286[heading Description]
6287
6288[endsect]
6289
6290[section:is_done http::basic_parser::is_done]
6291[indexterm2 is_done..http::basic_parser]
6292
6293
6294Returns `true` if the message is complete.
6295[heading Synopsis]
6296```
6297bool
6298is_done() const;
6299```
6300
6301[heading Description]
6302The message is complete after the full header is prduced and one of the following is true:
6303
6304* The skip body option was set.
6305
6306* The semantics of the message indicate there is no body.
6307
6308* The semantics of the message indicate a body is expected, and the entire body was parsed.
6309
6310
6311[endsect]
6312
6313[section:is_header_done http::basic_parser::is_header_done]
6314[indexterm2 is_header_done..http::basic_parser]
6315
6316
6317Returns `true` if a the parser has produced the full header.
6318[heading Synopsis]
6319```
6320bool
6321is_header_done() const;
6322```
6323
6324[heading Description]
6325
6326[endsect]
6327
6328[section:upgrade http::basic_parser::upgrade]
6329[indexterm2 upgrade..http::basic_parser]
6330
6331
6332Returns `true` if the message is an upgrade message.
6333[heading Synopsis]
6334```
6335bool
6336upgrade() const;
6337```
6338
6339[heading Description]
6340
6341[heading Remarks]
6342The return value is undefined unless [link beast.ref.boost__beast__http__basic_parser.is_header_done `is_header_done`] would return `true`.
6343
6344[endsect]
6345
6346[section:chunked http::basic_parser::chunked]
6347[indexterm2 chunked..http::basic_parser]
6348
6349
6350Returns `true` if the last value for Transfer-Encoding is "chunked".
6351[heading Synopsis]
6352```
6353bool
6354chunked() const;
6355```
6356
6357[heading Description]
6358
6359[heading Remarks]
6360The return value is undefined unless [link beast.ref.boost__beast__http__basic_parser.is_header_done `is_header_done`] would return `true`.
6361
6362[endsect]
6363
6364[section:keep_alive http::basic_parser::keep_alive]
6365[indexterm2 keep_alive..http::basic_parser]
6366
6367
6368Returns `true` if the message has keep-alive connection semantics.
6369[heading Synopsis]
6370```
6371bool
6372keep_alive() const;
6373```
6374
6375[heading Description]
6376This function always returns `false` if [link beast.ref.boost__beast__http__basic_parser.need_eof `need_eof`] would return `false`.
6377
6378[heading Remarks]
6379The return value is undefined unless [link beast.ref.boost__beast__http__basic_parser.is_header_done `is_header_done`] would return `true`.
6380
6381[endsect]
6382
6383[section:content_length http::basic_parser::content_length]
6384[indexterm2 content_length..http::basic_parser]
6385
6386
6387Returns the optional value of Content-Length if known.
6388[heading Synopsis]
6389```
6390boost::optional< std::uint64_t >
6391content_length() const;
6392```
6393
6394[heading Description]
6395
6396[heading Remarks]
6397The return value is undefined unless [link beast.ref.boost__beast__http__basic_parser.is_header_done `is_header_done`] would return `true`.
6398
6399[endsect]
6400
6401[section:content_length_remaining http::basic_parser::content_length_remaining]
6402[indexterm2 content_length_remaining..http::basic_parser]
6403
6404
6405Returns the remaining content length if known.
6406[heading Synopsis]
6407```
6408boost::optional< std::uint64_t >
6409content_length_remaining() const;
6410```
6411
6412[heading Description]
6413If the message header specifies a Content-Length, the return value will be the number of bytes remaining in the payload body have not yet been parsed.
6414
6415[heading Remarks]
6416The return value is undefined unless [link beast.ref.boost__beast__http__basic_parser.is_header_done `is_header_done`] would return `true`.
6417
6418[endsect]
6419
6420[section:need_eof http::basic_parser::need_eof]
6421[indexterm2 need_eof..http::basic_parser]
6422
6423
6424Returns `true` if the message semantics require an end of file.
6425[heading Synopsis]
6426```
6427bool
6428need_eof() const;
6429```
6430
6431[heading Description]
6432Depending on the contents of the header, the parser may require and end of file notification to know where the end of the body lies. If this function returns `true` it will be necessary to call [link beast.ref.boost__beast__http__basic_parser.put_eof `put_eof`] when there will never be additional data from the input.
6433
6434[endsect]
6435
6436[section:body_limit http::basic_parser::body_limit]
6437[indexterm2 body_limit..http::basic_parser]
6438
6439
6440Set the limit on the payload body.
6441[heading Synopsis]
6442```
6443void
6444body_limit(
6445    boost::optional< std::uint64_t > v);
6446```
6447
6448[heading Description]
6449This function sets the maximum allowed size of the payload body, before any encodings except chunked have been removed. Depending on the message semantics, one of these cases will apply:
6450
6451* The Content-Length is specified and exceeds the limit. In this case the result [link beast.ref.boost__beast__http__error `error::body_limit`] is returned immediately after the header is parsed.
6452
6453* The Content-Length is unspecified and the chunked encoding is not specified as the last encoding. In this case the end of message is determined by the end of file indicator on the associated stream or input source. If a sufficient number of body payload octets are presented to the parser to exceed the configured limit, the parse fails with the result [link beast.ref.boost__beast__http__error `error::body_limit`]
6454
6455* The Transfer-Encoding specifies the chunked encoding as the last encoding. In this case, when the number of payload body octets produced by removing the chunked encoding exceeds the configured limit, the parse fails with the result [link beast.ref.boost__beast__http__error `error::body_limit`].
6456
6457Setting the limit after any body octets have been parsed results in undefined behavior.
6458The default limit is 1MB for requests and 8MB for responses.
6459
6460[heading Parameters]
6461[table [[Name][Description]]
6462  [
6463    [`v`
6464    ]
6465    [
6466An optional integral value representing the body limit. If this is equal to `boost::none`, then the body limit is disabled.
6467    ]
6468  ]
6469]
6470
6471[endsect]
6472
6473[section:header_limit http::basic_parser::header_limit]
6474[indexterm2 header_limit..http::basic_parser]
6475
6476
6477Set a limit on the total size of the header.
6478[heading Synopsis]
6479```
6480void
6481header_limit(
6482    std::uint32_t v);
6483```
6484
6485[heading Description]
6486This function sets the maximum allowed size of the header including all field name, value, and delimiter characters and also including the CRLF sequences in the serialized input. If the end of the header is not found within the limit of the header size, the error [link beast.ref.boost__beast__http__error `error::header_limit`] is returned by [link beast.ref.boost__beast__http__basic_parser.put `put`].
6487Setting the limit after any header octets have been parsed results in undefined behavior.
6488
6489[endsect]
6490
6491[section:eager http::basic_parser::eager]
6492[indexterm2 eager..http::basic_parser]
6493
6494
6495Returns `true` if the eager parse option is set.
6496```
6497bool
6498``[link beast.ref.boost__beast__http__basic_parser.eager.overload1 eager]``() const;
6499  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_parser.eager.overload1 `more...`]]``
6500```
6501
6502
6503Set the eager parse option.
6504```
6505void
6506``[link beast.ref.boost__beast__http__basic_parser.eager.overload2 eager]``(
6507    bool v);
6508  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_parser.eager.overload2 `more...`]]``
6509```
6510
6511[section:overload1 http::basic_parser::eager (1 of 2 overloads)]
6512
6513Returns `true` if the eager parse option is set.
6514[heading Synopsis]
6515```
6516bool
6517eager() const;
6518```
6519
6520[heading Description]
6521
6522[endsect]
6523
6524[section:overload2 http::basic_parser::eager (2 of 2 overloads)]
6525
6526Set the eager parse option.
6527[heading Synopsis]
6528```
6529void
6530eager(
6531    bool v);
6532```
6533
6534[heading Description]
6535Normally the parser returns after successfully parsing a structured element (header, chunk header, or chunk body) even if there are octets remaining in the input. This is necessary when attempting to parse the header first, or when the caller wants to inspect information which may be invalidated by subsequent parsing, such as a chunk extension. The `eager` option controls whether the parser keeps going after parsing structured element if there are octets remaining in the buffer and no error occurs. This option is automatically set or cleared during certain stream operations to improve performance with no change in functionality.
6536The default setting is `false`.
6537
6538[heading Parameters]
6539[table [[Name][Description]]
6540  [
6541    [`v`
6542    ]
6543    [
6544`true` to set the eager parse option or `false` to disable it.
6545    ]
6546  ]
6547]
6548
6549[endsect]
6550
6551
6552[endsect]
6553
6554[section:skip http::basic_parser::skip]
6555[indexterm2 skip..http::basic_parser]
6556
6557
6558Returns `true` if the skip parse option is set.
6559```
6560bool
6561``[link beast.ref.boost__beast__http__basic_parser.skip.overload1 skip]``() const;
6562  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_parser.skip.overload1 `more...`]]``
6563```
6564
6565
6566Set the skip parse option.
6567```
6568void
6569``[link beast.ref.boost__beast__http__basic_parser.skip.overload2 skip]``(
6570    bool v);
6571  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_parser.skip.overload2 `more...`]]``
6572```
6573
6574[section:overload1 http::basic_parser::skip (1 of 2 overloads)]
6575
6576Returns `true` if the skip parse option is set.
6577[heading Synopsis]
6578```
6579bool
6580skip() const;
6581```
6582
6583[heading Description]
6584
6585[endsect]
6586
6587[section:overload2 http::basic_parser::skip (2 of 2 overloads)]
6588
6589Set the skip parse option.
6590[heading Synopsis]
6591```
6592void
6593skip(
6594    bool v);
6595```
6596
6597[heading Description]
6598This option controls whether or not the parser expects to see an HTTP body, regardless of the presence or absence of certain fields such as Content-Length or a chunked Transfer-Encoding. Depending on the request, some responses do not carry a body. For example, a 200 response to a CONNECT request from a tunneling proxy, or a response to a HEAD request. In these cases, callers may use this function inform the parser that no body is expected. The parser will consider the message complete after the header has been received.
6599
6600[heading Parameters]
6601[table [[Name][Description]]
6602  [
6603    [`v`
6604    ]
6605    [
6606`true` to set the skip body option or `false` to disable it.
6607    ]
6608  ]
6609]
6610[heading Remarks]
6611This function must called before any bytes are processed.
6612
6613[endsect]
6614
6615
6616[endsect]
6617
6618[section:put http::basic_parser::put]
6619[indexterm2 put..http::basic_parser]
6620
6621
6622Write a buffer sequence to the parser.
6623[heading Synopsis]
6624```
6625template<
6626    class __ConstBufferSequence__>
6627std::size_t
6628put(
6629    ConstBufferSequence const& buffers,
6630    error_code& ec);
6631```
6632
6633[heading Description]
6634This function attempts to incrementally parse the HTTP message data stored in the caller provided buffers. Upon success, a positive return value indicates that the parser made forward progress, consuming that number of bytes.
6635In some cases there may be an insufficient number of octets in the input buffer in order to make forward progress. This is indicated by the code [link beast.ref.boost__beast__http__error `error::need_more`]. When this happens, the caller should place additional bytes into the buffer sequence and call [link beast.ref.boost__beast__http__basic_parser.put `put`] again.
6636The error code [link beast.ref.boost__beast__http__error `error::need_more`] is special. When this error is returned, a subsequent call to [link beast.ref.boost__beast__http__basic_parser.put `put`] may succeed if the buffers have been updated. Otherwise, upon error the parser may not be restarted.
6637
6638[heading Parameters]
6639[table [[Name][Description]]
6640  [
6641    [`buffers`
6642    ]
6643    [
6644An object meeting the requirements of ['ConstBufferSequence] that represents the next chunk of message data. If the length of this buffer sequence is one, the implementation will not allocate additional memory. The class [link beast.ref.boost__beast__basic_flat_buffer `beast::basic_flat_buffer`] is provided as one way to meet this requirement
6645    ]
6646  ]
6647  [
6648    [`ec`
6649    ]
6650    [
6651Set to the error, if any occurred.
6652    ]
6653  ]
6654]
6655[heading Return Value]
6656The number of octets consumed in the buffer sequence. The caller should remove these octets even if the error is set.
6657
6658[endsect]
6659
6660[section:put_eof http::basic_parser::put_eof]
6661[indexterm2 put_eof..http::basic_parser]
6662
6663
6664Inform the parser that the end of stream was reached.
6665[heading Synopsis]
6666```
6667void
6668put_eof(
6669    error_code& ec);
6670```
6671
6672[heading Description]
6673In certain cases, HTTP needs to know where the end of the stream is. For example, sometimes servers send responses without Content-Length and expect the client to consume input (for the body) until EOF. Callbacks and errors will still be processed as usual.
6674This is typically called when a read from the underlying stream object sets the error code to `net::error::eof`.
6675
6676[heading Remarks]
6677Only valid after parsing a complete header.
6678[heading Parameters]
6679[table [[Name][Description]]
6680  [
6681    [`ec`
6682    ]
6683    [
6684Set to the error, if any occurred.
6685    ]
6686  ]
6687]
6688
6689[endsect]
6690
6691
6692[endsect]
6693
6694[section:boost__beast__basic_stream basic_stream]
6695
6696A stream socket wrapper with timeouts, an executor, and a rate limit policy.
6697[heading Synopsis]
6698Defined in header [include_file boost/beast/core/basic_stream.hpp]
6699
6700```
6701template<
6702    class __Protocol__,
6703    class __Executor__ = net::any_io_executor,
6704    class __RatePolicy__ = ``[link beast.ref.boost__beast__unlimited_rate_policy unlimited_rate_policy]``>
6705class basic_stream
6706```
6707
6708[heading Types]
6709[table [[Name][Description]]
6710  [
6711    [[*[link beast.ref.boost__beast__basic_stream.endpoint_type endpoint_type]]
6712    ]
6713    [
6714
6715The endpoint type.
6716    ]
6717  ]
6718  [
6719    [[*[link beast.ref.boost__beast__basic_stream.executor_type executor_type]]
6720    ]
6721    [
6722
6723The type of the executor associated with the stream.
6724    ]
6725  ]
6726  [
6727    [[*[link beast.ref.boost__beast__basic_stream.protocol_type protocol_type]]
6728    ]
6729    [
6730
6731The protocol type.
6732    ]
6733  ]
6734  [
6735    [[*[link beast.ref.boost__beast__basic_stream__rebind_executor rebind_executor]]
6736    ]
6737    [
6738
6739Rebinds the stream type to another executor.
6740    ]
6741  ]
6742  [
6743    [[*[link beast.ref.boost__beast__basic_stream.socket_type socket_type]]
6744    ]
6745    [
6746
6747The type of the underlying socket.
6748    ]
6749  ]
6750]
6751[heading Member Functions]
6752[table [[Name][Description]]
6753  [
6754    [[*[link beast.ref.boost__beast__basic_stream.async_connect async_connect]]
6755    ]
6756    [
6757
6758Connect the stream to the specified endpoint asynchronously.
6759
6760Establishes a connection by trying each endpoint in a sequence asynchronously.
6761    ]
6762  ]
6763  [
6764    [[*[link beast.ref.boost__beast__basic_stream.async_read_some async_read_some]]
6765    ]
6766    [
6767
6768Read some data asynchronously.
6769    ]
6770  ]
6771  [
6772    [[*[link beast.ref.boost__beast__basic_stream.async_write_some async_write_some]]
6773    ]
6774    [
6775
6776Write some data asynchronously.
6777    ]
6778  ]
6779  [
6780    [[*[link beast.ref.boost__beast__basic_stream.basic_stream basic_stream]]
6781    ]
6782    [
6783
6784Constructor.
6785
6786Move constructor.
6787    ]
6788  ]
6789  [
6790    [[*[link beast.ref.boost__beast__basic_stream.cancel cancel]]
6791    ]
6792    [
6793
6794Cancel all asynchronous operations associated with the socket.
6795    ]
6796  ]
6797  [
6798    [[*[link beast.ref.boost__beast__basic_stream.close close]]
6799    ]
6800    [
6801
6802Close the timed stream.
6803    ]
6804  ]
6805  [
6806    [[*[link beast.ref.boost__beast__basic_stream.connect connect]]
6807    ]
6808    [
6809
6810Connect the stream to the specified endpoint.
6811
6812Establishes a connection by trying each endpoint in a sequence.
6813    ]
6814  ]
6815  [
6816    [[*[link beast.ref.boost__beast__basic_stream.expires_after expires_after]]
6817    ]
6818    [
6819
6820Set the timeout for the next logical operation.
6821    ]
6822  ]
6823  [
6824    [[*[link beast.ref.boost__beast__basic_stream.expires_at expires_at]]
6825    ]
6826    [
6827
6828Set the timeout for the next logical operation.
6829    ]
6830  ]
6831  [
6832    [[*[link beast.ref.boost__beast__basic_stream.expires_never expires_never]]
6833    ]
6834    [
6835
6836Disable the timeout for the next logical operation.
6837    ]
6838  ]
6839  [
6840    [[*[link beast.ref.boost__beast__basic_stream.get_executor get_executor]]
6841    ]
6842    [
6843
6844Get the executor associated with the object.
6845    ]
6846  ]
6847  [
6848    [[*[link beast.ref.boost__beast__basic_stream.operator_eq_ operator=]]
6849    ]
6850    [
6851
6852Move assignment (deleted).
6853    ]
6854  ]
6855  [
6856    [[*[link beast.ref.boost__beast__basic_stream.rate_policy rate_policy]]
6857    ]
6858    [
6859
6860Returns the rate policy associated with the object.
6861    ]
6862  ]
6863  [
6864    [[*[link beast.ref.boost__beast__basic_stream.read_some read_some]]
6865    ]
6866    [
6867
6868Read some data.
6869    ]
6870  ]
6871  [
6872    [[*[link beast.ref.boost__beast__basic_stream.release_socket release_socket]]
6873    ]
6874    [
6875
6876Release ownership of the underlying socket.
6877    ]
6878  ]
6879  [
6880    [[*[link beast.ref.boost__beast__basic_stream.socket socket]]
6881    ]
6882    [
6883
6884Return a reference to the underlying socket.
6885    ]
6886  ]
6887  [
6888    [[*[link beast.ref.boost__beast__basic_stream.write_some write_some]]
6889    ]
6890    [
6891
6892Write some data.
6893    ]
6894  ]
6895  [
6896    [[*[link beast.ref.boost__beast__basic_stream._basic_stream ~basic_stream]]
6897    ]
6898    [
6899
6900Destructor.
6901    ]
6902  ]
6903]
6904[heading Description]
6905This stream wraps a `net::basic_stream_socket` to provide the following features:
6906
6907* An ['Executor] may be associated with the stream, which will be used to invoke any completion handlers which do not already have an associated executor. This achieves support for [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1322r0.html [P1322R0] Networking TS enhancement to enable custom I/O executors].
6908
6909* Timeouts may be specified for each logical asynchronous operation performing any reading, writing, or connecting.
6910
6911* A ['RatePolicy] may be associated with the stream, to implement rate limiting through the policy's interface.
6912
6913Although the stream supports multiple concurrent outstanding asynchronous operations, the stream object is not thread-safe. The caller is responsible for ensuring that the stream is accessed from only one thread at a time. This includes the times when the stream, and its underlying socket, are accessed by the networking implementation. To meet this thread safety requirement, all asynchronous operations must be performed by the stream within the same implicit strand (only one thread `net::io_context::run`) or within the same explicit strand, such as an instance of `net::strand`.
6914Completion handlers with explicit associated executors (such as those arising from use of `net::bind_executor`) will be invoked by the stream using the associated executor. Otherwise, the completion handler will be invoked by the executor associated with the stream upon construction. The type of executor used with this stream must meet the following requirements:
6915
6916* Function objects submitted to the executor shall never run concurrently with each other.
6917
6918The executor type `net::strand` meets these requirements. Use of a strand as the executor in the stream class template offers an additional notational convenience: the strand does not need to be specified in each individual initiating function call.
6919Unlike other stream wrappers, the underlying socket is accessed through the [link beast.ref.boost__beast__basic_stream.socket `socket`] member function instead of `next_layer`. This causes the [link beast.ref.boost__beast__basic_stream `basic_stream`] to be returned in calls to [link beast.ref.boost__beast__get_lowest_layer `get_lowest_layer`].
6920
6921[heading Usage]
6922
6923To use this stream declare an instance of the class. Then, before each logical operation for which a timeout is desired, call [link beast.ref.boost__beast__basic_stream.expires_after `expires_after`] with a duration, or call [link beast.ref.boost__beast__basic_stream.expires_at `expires_at`] with a time point. Alternatively, call [link beast.ref.boost__beast__basic_stream.expires_never `expires_never`] to disable the timeout for subsequent logical operations. A logical operation is any series of one or more direct or indirect calls to the timeout stream's asynchronous read, asynchronous write, or asynchronous connect functions.
6924When a timeout is set and a mixed operation is performed (one that includes both reads and writes, for example) the timeout applies to all of the intermediate asynchronous operations used in the enclosing operation. This allows timeouts to be applied to stream algorithms which were not written specifically to allow for timeouts, when those algorithms are passed a timeout stream with a timeout set.
6925When a timeout occurs the socket will be closed, canceling any pending I/O operations. The completion handlers for these canceled operations will be invoked with the error [link beast.ref.boost__beast__error `beast::error::timeout`].
6926
6927[heading Examples]
6928
6929This function reads an HTTP request with a timeout, then sends the HTTP response with a different timeout.
6930
6931```
6932void process_http_1 (tcp_stream& stream, net::yield_context yield)
6933{
6934    flat_buffer buffer;
6935    http::request<http::empty_body> req;
6936
6937    // Read the request, with a 15 second timeout
6938    stream.expires_after(std::chrono::seconds(15));
6939    http::async_read(stream, buffer, req, yield);
6940
6941    // Calculate the response
6942    http::response<http::string_body> res = make_response(req);
6943
6944    // Send the response, with a 30 second timeout.
6945    stream.expires_after (std::chrono::seconds(30));
6946    http::async_write (stream, res, yield);
6947}
6948```
6949
6950The example above could be expressed using a single timeout with a simple modification. The function that follows first reads an HTTP request then sends the HTTP response, with a single timeout that applies to the entire combined operation of reading and writing:
6951
6952```
6953void process_http_2 (tcp_stream& stream, net::yield_context yield)
6954{
6955    flat_buffer buffer;
6956    http::request<http::empty_body> req;
6957
6958    // Require that the read and write combined take no longer than 30 seconds
6959    stream.expires_after(std::chrono::seconds(30));
6960
6961    http::async_read(stream, buffer, req, yield);
6962
6963    http::response<http::string_body> res = make_response(req);
6964    http::async_write (stream, res, yield);
6965}
6966```
6967
6968Some stream algorithms, such as `ssl::stream::async_handshake` perform both reads and writes. A timeout set before calling the initiating function of such composite stream algorithms will apply to the entire composite operation. For example, a timeout may be set on performing the SSL handshake thusly:
6969
6970```
6971void do_ssl_handshake (net::ssl::stream<tcp_stream>& stream, net::yield_context yield)
6972{
6973    // Require that the SSL handshake take no longer than 10 seconds
6974    stream.expires_after(std::chrono::seconds(10));
6975
6976    stream.async_handshake(net::ssl::stream_base::client, yield);
6977}
6978```
6979
6980
6981[heading Blocking I/O]
6982
6983Synchronous functions behave identically as that of the wrapped `net::basic_stream_socket`. Timeouts are not available when performing blocking calls.
6984
6985[heading Template Parameters]
6986[table [[Type][Description]]
6987  [
6988    [`Protocol`
6989    ]
6990    [
6991A type meeting the requirements of ['Protocol] representing the protocol the protocol to use for the basic stream socket. A common choice is `net::ip::tcp`.
6992    ]
6993  ]
6994  [
6995    [`Executor`
6996    ]
6997    [
6998A type meeting the requirements of ['Executor] to be used for submitting all completion handlers which do not already have an associated executor. If this type is omitted, the default of `net::any_io_executor` will be used.
6999    ]
7000  ]
7001]
7002[heading Thread Safety]
7003
7004['Distinct objects]: Safe.
7005
7006
7007['Shared objects]: Unsafe. The application must also ensure that all asynchronous operations are performed within the same implicit or explicit strand.
7008[heading See Also]
7009
7010* [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1322r0.html [P1322R0] Networking TS enhancement to enable custom I/O executors].
7011
7012
7013[section:socket_type basic_stream::socket_type]
7014[indexterm2 socket_type..basic_stream]
7015
7016
7017The type of the underlying socket.
7018[heading Synopsis]
7019```
7020using socket_type = net::basic_stream_socket< Protocol, Executor >;
7021```
7022
7023[heading Description]
7024
7025[endsect]
7026
7027[section:executor_type basic_stream::executor_type]
7028[indexterm2 executor_type..basic_stream]
7029
7030
7031The type of the executor associated with the stream.
7032[heading Synopsis]
7033```
7034using executor_type = beast::executor_type< socket_type >;
7035```
7036
7037[heading Description]
7038This will be the type of executor used to invoke completion handlers which do not have an explicit associated executor.
7039
7040[endsect]
7041
7042[section:protocol_type basic_stream::protocol_type]
7043[indexterm2 protocol_type..basic_stream]
7044
7045
7046The protocol type.
7047[heading Synopsis]
7048```
7049using protocol_type = Protocol;
7050```
7051
7052[heading Description]
7053
7054[endsect]
7055
7056[section:endpoint_type basic_stream::endpoint_type]
7057[indexterm2 endpoint_type..basic_stream]
7058
7059
7060The endpoint type.
7061[heading Synopsis]
7062```
7063using endpoint_type = typename Protocol::endpoint;
7064```
7065
7066[heading Description]
7067
7068[endsect]
7069
7070[section:_basic_stream basic_stream::~basic_stream]
7071[indexterm2 ~basic_stream..basic_stream]
7072
7073
7074Destructor.
7075[heading Synopsis]
7076```
7077~basic_stream();
7078```
7079
7080[heading Description]
7081This function destroys the stream, cancelling any outstanding asynchronous operations associated with the socket as if by calling cancel.
7082
7083[endsect]
7084
7085[section:basic_stream basic_stream::basic_stream]
7086[indexterm2 basic_stream..basic_stream]
7087
7088
7089Constructor.
7090```
7091template<
7092    class... Args>
7093explicit
7094``[link beast.ref.boost__beast__basic_stream.basic_stream.overload1 basic_stream]``(
7095    Args&&... args);
7096  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.basic_stream.overload1 `more...`]]``
7097
7098template<
7099    class RatePolicy_,
7100    class... Args>
7101explicit
7102``[link beast.ref.boost__beast__basic_stream.basic_stream.overload2 basic_stream]``(
7103    RatePolicy_&& policy,
7104    Args&&... args);
7105  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.basic_stream.overload2 `more...`]]``
7106```
7107
7108
7109Move constructor.
7110```
7111``[link beast.ref.boost__beast__basic_stream.basic_stream.overload3 basic_stream]``(
7112    basic_stream&& other);
7113  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.basic_stream.overload3 `more...`]]``
7114```
7115
7116[section:overload1 basic_stream::basic_stream (1 of 3 overloads)]
7117
7118Constructor.
7119[heading Synopsis]
7120```
7121template<
7122    class... Args>
7123basic_stream(
7124    Args&&... args);
7125```
7126
7127[heading Description]
7128This constructor creates the stream by forwarding all arguments to the underlying socket. The socket then needs to be open and connected or accepted before data can be sent or received on it.
7129
7130[heading Parameters]
7131[table [[Name][Description]]
7132  [
7133    [`args`
7134    ]
7135    [
7136A list of parameters forwarded to the constructor of the underlying socket.
7137    ]
7138  ]
7139]
7140
7141[endsect]
7142
7143[section:overload2 basic_stream::basic_stream (2 of 3 overloads)]
7144
7145Constructor.
7146[heading Synopsis]
7147```
7148template<
7149    class RatePolicy_,
7150    class... Args>
7151basic_stream(
7152    RatePolicy_&& policy,
7153    Args&&... args);
7154```
7155
7156[heading Description]
7157This constructor creates the stream with the specified rate policy, and forwards all remaining arguments to the underlying socket. The socket then needs to be open and connected or accepted before data can be sent or received on it.
7158
7159[heading Parameters]
7160[table [[Name][Description]]
7161  [
7162    [`policy`
7163    ]
7164    [
7165The rate policy object to use. The stream will take ownership of this object by decay-copy.
7166    ]
7167  ]
7168  [
7169    [`args`
7170    ]
7171    [
7172A list of parameters forwarded to the constructor of the underlying socket.
7173    ]
7174  ]
7175]
7176
7177[endsect]
7178
7179[section:overload3 basic_stream::basic_stream (3 of 3 overloads)]
7180
7181Move constructor.
7182[heading Synopsis]
7183```
7184basic_stream(
7185    basic_stream&& other);
7186```
7187
7188[heading Description]
7189
7190[heading Parameters]
7191[table [[Name][Description]]
7192  [
7193    [`other`
7194    ]
7195    [
7196The other object from which the move will occur.
7197    ]
7198  ]
7199]
7200[heading Remarks]
7201Following the move, the moved-from object is in the same state as if newly constructed.
7202
7203[endsect]
7204
7205
7206[endsect]
7207
7208[section:operator_eq_ basic_stream::operator=]
7209[indexterm2 operator=..basic_stream]
7210
7211
7212Move assignment (deleted).
7213[heading Synopsis]
7214```
7215basic_stream&
7216operator=(
7217    basic_stream&&);
7218```
7219
7220[heading Description]
7221
7222[endsect]
7223
7224[section:socket basic_stream::socket]
7225[indexterm2 socket..basic_stream]
7226
7227
7228Return a reference to the underlying socket.
7229```
7230socket_type&
7231``[link beast.ref.boost__beast__basic_stream.socket.overload1 socket]``();
7232  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.socket.overload1 `more...`]]``
7233
7234socket_type const&
7235``[link beast.ref.boost__beast__basic_stream.socket.overload2 socket]``() const;
7236  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.socket.overload2 `more...`]]``
7237```
7238
7239[section:overload1 basic_stream::socket (1 of 2 overloads)]
7240
7241Return a reference to the underlying socket.
7242[heading Synopsis]
7243```
7244socket_type&
7245socket();
7246```
7247
7248[heading Description]
7249
7250[endsect]
7251
7252[section:overload2 basic_stream::socket (2 of 2 overloads)]
7253
7254Return a reference to the underlying socket.
7255[heading Synopsis]
7256```
7257socket_type const&
7258socket() const;
7259```
7260
7261[heading Description]
7262
7263[endsect]
7264
7265
7266[endsect]
7267
7268[section:release_socket basic_stream::release_socket]
7269[indexterm2 release_socket..basic_stream]
7270
7271
7272Release ownership of the underlying socket.
7273[heading Synopsis]
7274```
7275socket_type
7276release_socket();
7277```
7278
7279[heading Description]
7280This function causes all outstanding asynchronous connect, read, and write operations to be canceled as if by a call to [link beast.ref.boost__beast__basic_stream.cancel `cancel`]. Ownership of the underlying socket is then transferred to the caller.
7281
7282[endsect]
7283
7284[section:rate_policy basic_stream::rate_policy]
7285[indexterm2 rate_policy..basic_stream]
7286
7287
7288Returns the rate policy associated with the object.
7289```
7290RatePolicy&
7291``[link beast.ref.boost__beast__basic_stream.rate_policy.overload1 rate_policy]``();
7292  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.rate_policy.overload1 `more...`]]``
7293
7294RatePolicy const&
7295``[link beast.ref.boost__beast__basic_stream.rate_policy.overload2 rate_policy]``() const;
7296  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.rate_policy.overload2 `more...`]]``
7297```
7298
7299[section:overload1 basic_stream::rate_policy (1 of 2 overloads)]
7300
7301Returns the rate policy associated with the object.
7302[heading Synopsis]
7303```
7304RatePolicy&
7305rate_policy();
7306```
7307
7308[heading Description]
7309
7310[endsect]
7311
7312[section:overload2 basic_stream::rate_policy (2 of 2 overloads)]
7313
7314Returns the rate policy associated with the object.
7315[heading Synopsis]
7316```
7317RatePolicy const&
7318rate_policy() const;
7319```
7320
7321[heading Description]
7322
7323[endsect]
7324
7325
7326[endsect]
7327
7328[section:expires_after basic_stream::expires_after]
7329[indexterm2 expires_after..basic_stream]
7330
7331
7332Set the timeout for the next logical operation.
7333[heading Synopsis]
7334```
7335void
7336expires_after(
7337    net::steady_timer::duration expiry_time);
7338```
7339
7340[heading Description]
7341This sets either the read timer, the write timer, or both timers to expire after the specified amount of time has elapsed. If a timer expires when the corresponding asynchronous operation is outstanding, the stream will be closed and any outstanding operations will complete with the error [link beast.ref.boost__beast__error `beast::error::timeout`]. Otherwise, if the timer expires while no operations are outstanding, and the expiraton is not set again, the next operation will time out immediately.
7342The timer applies collectively to any asynchronous reads or writes initiated after the expiration is set, until the expiration is set again. A call to [link beast.ref.boost__beast__basic_stream.async_connect `async_connect`] counts as both a read and a write.
7343
7344[heading Parameters]
7345[table [[Name][Description]]
7346  [
7347    [`expiry_time`
7348    ]
7349    [
7350The amount of time after which a logical operation should be considered timed out.
7351    ]
7352  ]
7353]
7354
7355[endsect]
7356
7357[section:expires_at basic_stream::expires_at]
7358[indexterm2 expires_at..basic_stream]
7359
7360
7361Set the timeout for the next logical operation.
7362[heading Synopsis]
7363```
7364void
7365expires_at(
7366    net::steady_timer::time_point expiry_time);
7367```
7368
7369[heading Description]
7370This sets either the read timer, the write timer, or both timers to expire at the specified time point. If a timer expires when the corresponding asynchronous operation is outstanding, the stream will be closed and any outstanding operations will complete with the error [link beast.ref.boost__beast__error `beast::error::timeout`]. Otherwise, if the timer expires while no operations are outstanding, and the expiraton is not set again, the next operation will time out immediately.
7371The timer applies collectively to any asynchronous reads or writes initiated after the expiration is set, until the expiration is set again. A call to [link beast.ref.boost__beast__basic_stream.async_connect `async_connect`] counts as both a read and a write.
7372
7373[heading Parameters]
7374[table [[Name][Description]]
7375  [
7376    [`expiry_time`
7377    ]
7378    [
7379The time point after which a logical operation should be considered timed out.
7380    ]
7381  ]
7382]
7383
7384[endsect]
7385
7386[section:expires_never basic_stream::expires_never]
7387[indexterm2 expires_never..basic_stream]
7388
7389
7390Disable the timeout for the next logical operation.
7391[heading Synopsis]
7392```
7393void
7394expires_never();
7395```
7396
7397[heading Description]
7398
7399[endsect]
7400
7401[section:cancel basic_stream::cancel]
7402[indexterm2 cancel..basic_stream]
7403
7404
7405Cancel all asynchronous operations associated with the socket.
7406[heading Synopsis]
7407```
7408void
7409cancel();
7410```
7411
7412[heading Description]
7413This function causes all outstanding asynchronous connect, read, and write operations to finish immediately. Completion handlers for cancelled operations will receive the error `net::error::operation_aborted`. Completion handlers not yet invoked whose operations have completed, will receive the error corresponding to the result of the operation (which may indicate success).
7414
7415[endsect]
7416
7417[section:close basic_stream::close]
7418[indexterm2 close..basic_stream]
7419
7420
7421Close the timed stream.
7422[heading Synopsis]
7423```
7424void
7425close();
7426```
7427
7428[heading Description]
7429This cancels all of the outstanding asynchronous operations as if by calling [link beast.ref.boost__beast__basic_stream.cancel `cancel`], and closes the underlying socket.
7430
7431[endsect]
7432
7433[section:get_executor basic_stream::get_executor]
7434[indexterm2 get_executor..basic_stream]
7435
7436
7437Get the executor associated with the object.
7438[heading Synopsis]
7439```
7440executor_type
7441get_executor();
7442```
7443
7444[heading Description]
7445This function may be used to obtain the executor object that the stream uses to dispatch completion handlers without an assocaited executor.
7446
7447[heading Return Value]
7448A copy of the executor that stream will use to dispatch handlers.
7449
7450[endsect]
7451
7452[section:connect basic_stream::connect]
7453[indexterm2 connect..basic_stream]
7454
7455
7456Connect the stream to the specified endpoint.
7457```
7458void
7459``[link beast.ref.boost__beast__basic_stream.connect.overload1 connect]``(
7460    endpoint_type const& ep);
7461  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.connect.overload1 `more...`]]``
7462
7463void
7464``[link beast.ref.boost__beast__basic_stream.connect.overload2 connect]``(
7465    endpoint_type const& ep,
7466    error_code& ec);
7467  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.connect.overload2 `more...`]]``
7468```
7469
7470
7471Establishes a connection by trying each endpoint in a sequence.
7472```
7473template<
7474    class __EndpointSequence__>
7475Protocol::endpoint
7476``[link beast.ref.boost__beast__basic_stream.connect.overload3 connect]``(
7477    EndpointSequence const& endpoints);
7478  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.connect.overload3 `more...`]]``
7479
7480template<
7481    class __EndpointSequence__>
7482Protocol::endpoint
7483``[link beast.ref.boost__beast__basic_stream.connect.overload4 connect]``(
7484    EndpointSequence const& endpoints,
7485    error_code& ec);
7486  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.connect.overload4 `more...`]]``
7487
7488template<
7489    class Iterator>
7490Iterator
7491``[link beast.ref.boost__beast__basic_stream.connect.overload5 connect]``(
7492    Iterator begin,
7493    Iterator end);
7494  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.connect.overload5 `more...`]]``
7495
7496template<
7497    class Iterator>
7498Iterator
7499``[link beast.ref.boost__beast__basic_stream.connect.overload6 connect]``(
7500    Iterator begin,
7501    Iterator end,
7502    error_code& ec);
7503  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.connect.overload6 `more...`]]``
7504
7505template<
7506    class __EndpointSequence__,
7507    class __ConnectCondition__>
7508Protocol::endpoint
7509``[link beast.ref.boost__beast__basic_stream.connect.overload7 connect]``(
7510    EndpointSequence const& endpoints,
7511    ConnectCondition connect_condition);
7512  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.connect.overload7 `more...`]]``
7513
7514template<
7515    class __EndpointSequence__,
7516    class __ConnectCondition__>
7517Protocol::endpoint
7518``[link beast.ref.boost__beast__basic_stream.connect.overload8 connect]``(
7519    EndpointSequence const& endpoints,
7520    ConnectCondition connect_condition,
7521    error_code& ec);
7522  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.connect.overload8 `more...`]]``
7523
7524template<
7525    class Iterator,
7526    class __ConnectCondition__>
7527Iterator
7528``[link beast.ref.boost__beast__basic_stream.connect.overload9 connect]``(
7529    Iterator begin,
7530    Iterator end,
7531    ConnectCondition connect_condition);
7532  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.connect.overload9 `more...`]]``
7533
7534template<
7535    class Iterator,
7536    class __ConnectCondition__>
7537Iterator
7538``[link beast.ref.boost__beast__basic_stream.connect.overload10 connect]``(
7539    Iterator begin,
7540    Iterator end,
7541    ConnectCondition connect_condition,
7542    error_code& ec);
7543  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.connect.overload10 `more...`]]``
7544```
7545
7546[section:overload1 basic_stream::connect (1 of 10 overloads)]
7547
7548Connect the stream to the specified endpoint.
7549[heading Synopsis]
7550```
7551void
7552connect(
7553    endpoint_type const& ep);
7554```
7555
7556[heading Description]
7557This function is used to connect the underlying socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
7558
7559[heading Parameters]
7560[table [[Name][Description]]
7561  [
7562    [`ep`
7563    ]
7564    [
7565The remote endpoint to connect to.
7566    ]
7567  ]
7568]
7569[heading Exceptions]
7570[table [[Type][Thrown On]]
7571  [
7572    [`system_error`
7573    ]
7574    [
7575Thrown on failure.
7576    ]
7577  ]
7578]
7579[heading See Also]
7580[link beast.ref.boost__beast__basic_stream.connect `connect`]
7581
7582[endsect]
7583
7584[section:overload2 basic_stream::connect (2 of 10 overloads)]
7585
7586Connect the stream to the specified endpoint.
7587[heading Synopsis]
7588```
7589void
7590connect(
7591    endpoint_type const& ep,
7592    error_code& ec);
7593```
7594
7595[heading Description]
7596This function is used to connect the underlying socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
7597
7598[heading Parameters]
7599[table [[Name][Description]]
7600  [
7601    [`ep`
7602    ]
7603    [
7604The remote endpoint to connect to.
7605    ]
7606  ]
7607  [
7608    [`ec`
7609    ]
7610    [
7611Set to indicate what error occurred, if any.
7612    ]
7613  ]
7614]
7615[heading See Also]
7616[link beast.ref.boost__beast__basic_stream.connect `connect`]
7617
7618[endsect]
7619
7620[section:overload3 basic_stream::connect (3 of 10 overloads)]
7621
7622Establishes a connection by trying each endpoint in a sequence.
7623[heading Synopsis]
7624```
7625template<
7626    class __EndpointSequence__>
7627Protocol::endpoint
7628connect(
7629    EndpointSequence const& endpoints);
7630```
7631
7632[heading Description]
7633This function attempts to connect the stream to one of a sequence of endpoints by trying each endpoint until a connection is successfully established. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
7634The algorithm, known as a ['composed operation], is implemented in terms of calls to the underlying socket's `connect` function.
7635
7636[heading Parameters]
7637[table [[Name][Description]]
7638  [
7639    [`endpoints`
7640    ]
7641    [
7642A sequence of endpoints.
7643    ]
7644  ]
7645]
7646[heading Return Value]
7647The successfully connected endpoint.
7648[heading Exceptions]
7649[table [[Type][Thrown On]]
7650  [
7651    [`system_error`
7652    ]
7653    [
7654Thrown on failure. If the sequence is empty, the associated error code is `net::error::not_found`. Otherwise, contains the error from the last connection attempt.
7655    ]
7656  ]
7657]
7658
7659[endsect]
7660
7661[section:overload4 basic_stream::connect (4 of 10 overloads)]
7662
7663Establishes a connection by trying each endpoint in a sequence.
7664[heading Synopsis]
7665```
7666template<
7667    class __EndpointSequence__>
7668Protocol::endpoint
7669connect(
7670    EndpointSequence const& endpoints,
7671    error_code& ec);
7672```
7673
7674[heading Description]
7675This function attempts to connect the stream to one of a sequence of endpoints by trying each endpoint until a connection is successfully established. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
7676The algorithm, known as a ['composed operation], is implemented in terms of calls to the underlying socket's `connect` function.
7677
7678[heading Parameters]
7679[table [[Name][Description]]
7680  [
7681    [`endpoints`
7682    ]
7683    [
7684A sequence of endpoints.
7685    ]
7686  ]
7687  [
7688    [`ec`
7689    ]
7690    [
7691Set to indicate what error occurred, if any. If the sequence is empty, set to `net::error::not_found`. Otherwise, contains the error from the last connection attempt.
7692    ]
7693  ]
7694]
7695[heading Return Value]
7696On success, the successfully connected endpoint. Otherwise, a default-constructed endpoint.
7697
7698[endsect]
7699
7700[section:overload5 basic_stream::connect (5 of 10 overloads)]
7701
7702Establishes a connection by trying each endpoint in a sequence.
7703[heading Synopsis]
7704```
7705template<
7706    class Iterator>
7707Iterator
7708connect(
7709    Iterator begin,
7710    Iterator end);
7711```
7712
7713[heading Description]
7714This function attempts to connect the stream to one of a sequence of endpoints by trying each endpoint until a connection is successfully established. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
7715The algorithm, known as a ['composed operation], is implemented in terms of calls to the underlying socket's `connect` function.
7716
7717[heading Parameters]
7718[table [[Name][Description]]
7719  [
7720    [`begin`
7721    ]
7722    [
7723An iterator pointing to the start of a sequence of endpoints.
7724    ]
7725  ]
7726  [
7727    [`end`
7728    ]
7729    [
7730An iterator pointing to the end of a sequence of endpoints.
7731    ]
7732  ]
7733]
7734[heading Return Value]
7735An iterator denoting the successfully connected endpoint.
7736[heading Exceptions]
7737[table [[Type][Thrown On]]
7738  [
7739    [`system_error`
7740    ]
7741    [
7742Thrown on failure. If the sequence is empty, the associated error code is `net::error::not_found`. Otherwise, contains the error from the last connection attempt.
7743    ]
7744  ]
7745]
7746
7747[endsect]
7748
7749[section:overload6 basic_stream::connect (6 of 10 overloads)]
7750
7751Establishes a connection by trying each endpoint in a sequence.
7752[heading Synopsis]
7753```
7754template<
7755    class Iterator>
7756Iterator
7757connect(
7758    Iterator begin,
7759    Iterator end,
7760    error_code& ec);
7761```
7762
7763[heading Description]
7764This function attempts to connect the stream to one of a sequence of endpoints by trying each endpoint until a connection is successfully established. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
7765The algorithm, known as a ['composed operation], is implemented in terms of calls to the underlying socket's `connect` function.
7766
7767[heading Parameters]
7768[table [[Name][Description]]
7769  [
7770    [`begin`
7771    ]
7772    [
7773An iterator pointing to the start of a sequence of endpoints.
7774    ]
7775  ]
7776  [
7777    [`end`
7778    ]
7779    [
7780An iterator pointing to the end of a sequence of endpoints.
7781    ]
7782  ]
7783  [
7784    [`ec`
7785    ]
7786    [
7787Set to indicate what error occurred, if any. If the sequence is empty, set to boost::asio::error::not_found. Otherwise, contains the error from the last connection attempt.
7788    ]
7789  ]
7790]
7791[heading Return Value]
7792On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator.
7793
7794[endsect]
7795
7796[section:overload7 basic_stream::connect (7 of 10 overloads)]
7797
7798Establishes a connection by trying each endpoint in a sequence.
7799[heading Synopsis]
7800```
7801template<
7802    class __EndpointSequence__,
7803    class __ConnectCondition__>
7804Protocol::endpoint
7805connect(
7806    EndpointSequence const& endpoints,
7807    ConnectCondition connect_condition);
7808```
7809
7810[heading Description]
7811This function attempts to connect the stream to one of a sequence of endpoints by trying each endpoint until a connection is successfully established. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
7812The algorithm, known as a ['composed operation], is implemented in terms of calls to the underlying socket's `connect` function.
7813
7814[heading Parameters]
7815[table [[Name][Description]]
7816  [
7817    [`endpoints`
7818    ]
7819    [
7820A sequence of endpoints.
7821    ]
7822  ]
7823  [
7824    [`connect_condition`
7825    ]
7826    [
7827
7828A function object that is called prior to each connection attempt. The signature of the function object must be:
7829```
7830bool connect_condition(
7831    error_code const& ec,
7832    typename Protocol::endpoint const& next);
7833```
7834
7835The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.
7836    ]
7837  ]
7838]
7839[heading Return Value]
7840The successfully connected endpoint.
7841[heading Exceptions]
7842[table [[Type][Thrown On]]
7843  [
7844    [`boost::system::system_error`
7845    ]
7846    [
7847Thrown on failure. If the sequence is empty, the associated error code is `net::error::not_found`. Otherwise, contains the error from the last connection attempt.
7848    ]
7849  ]
7850]
7851
7852[endsect]
7853
7854[section:overload8 basic_stream::connect (8 of 10 overloads)]
7855
7856Establishes a connection by trying each endpoint in a sequence.
7857[heading Synopsis]
7858```
7859template<
7860    class __EndpointSequence__,
7861    class __ConnectCondition__>
7862Protocol::endpoint
7863connect(
7864    EndpointSequence const& endpoints,
7865    ConnectCondition connect_condition,
7866    error_code& ec);
7867```
7868
7869[heading Description]
7870This function attempts to connect the stream to one of a sequence of endpoints by trying each endpoint until a connection is successfully established. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
7871The algorithm, known as a ['composed operation], is implemented in terms of calls to the underlying socket's `connect` function.
7872
7873[heading Parameters]
7874[table [[Name][Description]]
7875  [
7876    [`endpoints`
7877    ]
7878    [
7879A sequence of endpoints.
7880    ]
7881  ]
7882  [
7883    [`connect_condition`
7884    ]
7885    [
7886
7887A function object that is called prior to each connection attempt. The signature of the function object must be:
7888```
7889bool connect_condition(
7890    error_code const& ec,
7891    typename Protocol::endpoint const& next);
7892```
7893
7894The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.
7895    ]
7896  ]
7897  [
7898    [`ec`
7899    ]
7900    [
7901Set to indicate what error occurred, if any. If the sequence is empty, set to `net::error::not_found`. Otherwise, contains the error from the last connection attempt.
7902    ]
7903  ]
7904]
7905[heading Return Value]
7906On success, the successfully connected endpoint. Otherwise, a default-constructed endpoint.
7907
7908[endsect]
7909
7910[section:overload9 basic_stream::connect (9 of 10 overloads)]
7911
7912Establishes a connection by trying each endpoint in a sequence.
7913[heading Synopsis]
7914```
7915template<
7916    class Iterator,
7917    class __ConnectCondition__>
7918Iterator
7919connect(
7920    Iterator begin,
7921    Iterator end,
7922    ConnectCondition connect_condition);
7923```
7924
7925[heading Description]
7926This function attempts to connect the stream to one of a sequence of endpoints by trying each endpoint until a connection is successfully established. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
7927The algorithm, known as a ['composed operation], is implemented in terms of calls to the underlying socket's `connect` function.
7928
7929[heading Parameters]
7930[table [[Name][Description]]
7931  [
7932    [`begin`
7933    ]
7934    [
7935An iterator pointing to the start of a sequence of endpoints.
7936    ]
7937  ]
7938  [
7939    [`end`
7940    ]
7941    [
7942An iterator pointing to the end of a sequence of endpoints.
7943    ]
7944  ]
7945  [
7946    [`connect_condition`
7947    ]
7948    [
7949
7950A function object that is called prior to each connection attempt. The signature of the function object must be:
7951```
7952bool connect_condition(
7953    error_code const& ec,
7954    typename Protocol::endpoint const& next);
7955```
7956
7957The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.
7958    ]
7959  ]
7960]
7961[heading Return Value]
7962An iterator denoting the successfully connected endpoint.
7963[heading Exceptions]
7964[table [[Type][Thrown On]]
7965  [
7966    [`boost::system::system_error`
7967    ]
7968    [
7969Thrown on failure. If the sequence is empty, the associated `error_code` is `net::error::not_found`. Otherwise, contains the error from the last connection attempt.
7970    ]
7971  ]
7972]
7973
7974[endsect]
7975
7976[section:overload10 basic_stream::connect (10 of 10 overloads)]
7977
7978Establishes a connection by trying each endpoint in a sequence.
7979[heading Synopsis]
7980```
7981template<
7982    class Iterator,
7983    class __ConnectCondition__>
7984Iterator
7985connect(
7986    Iterator begin,
7987    Iterator end,
7988    ConnectCondition connect_condition,
7989    error_code& ec);
7990```
7991
7992[heading Description]
7993This function attempts to connect the stream to one of a sequence of endpoints by trying each endpoint until a connection is successfully established. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
7994The algorithm, known as a ['composed operation], is implemented in terms of calls to the underlying socket's `connect` function.
7995
7996[heading Parameters]
7997[table [[Name][Description]]
7998  [
7999    [`begin`
8000    ]
8001    [
8002An iterator pointing to the start of a sequence of endpoints.
8003    ]
8004  ]
8005  [
8006    [`end`
8007    ]
8008    [
8009An iterator pointing to the end of a sequence of endpoints.
8010    ]
8011  ]
8012  [
8013    [`connect_condition`
8014    ]
8015    [
8016
8017A function object that is called prior to each connection attempt. The signature of the function object must be:
8018```
8019bool connect_condition(
8020    error_code const& ec,
8021    typename Protocol::endpoint const& next);
8022```
8023
8024The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.
8025    ]
8026  ]
8027  [
8028    [`ec`
8029    ]
8030    [
8031Set to indicate what error occurred, if any. If the sequence is empty, set to `net::error::not_found`. Otherwise, contains the error from the last connection attempt.
8032    ]
8033  ]
8034]
8035[heading Return Value]
8036On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator.
8037
8038[endsect]
8039
8040
8041[endsect]
8042
8043[section:async_connect basic_stream::async_connect]
8044[indexterm2 async_connect..basic_stream]
8045
8046
8047Connect the stream to the specified endpoint asynchronously.
8048```
8049template<
8050    class __ConnectHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]``>>
8051``__deduced__``
8052``[link beast.ref.boost__beast__basic_stream.async_connect.overload1 async_connect]``(
8053    endpoint_type const& ep,
8054    ConnectHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]`` >{});
8055  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.async_connect.overload1 `more...`]]``
8056```
8057
8058
8059Establishes a connection by trying each endpoint in a sequence asynchronously.
8060```
8061template<
8062    class __EndpointSequence__,
8063    class __RangeConnectHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]``>>
8064``__deduced__``
8065``[link beast.ref.boost__beast__basic_stream.async_connect.overload2 async_connect]``(
8066    EndpointSequence const& endpoints,
8067    RangeConnectHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]`` >{});
8068  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.async_connect.overload2 `more...`]]``
8069
8070template<
8071    class __EndpointSequence__,
8072    class __ConnectCondition__,
8073    class __RangeConnectHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]``>>
8074``__deduced__``
8075``[link beast.ref.boost__beast__basic_stream.async_connect.overload3 async_connect]``(
8076    EndpointSequence const& endpoints,
8077    ConnectCondition connect_condition,
8078    RangeConnectHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]`` >{});
8079  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.async_connect.overload3 `more...`]]``
8080
8081template<
8082    class Iterator,
8083    class __IteratorConnectHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]``>>
8084``__deduced__``
8085``[link beast.ref.boost__beast__basic_stream.async_connect.overload4 async_connect]``(
8086    Iterator begin,
8087    Iterator end,
8088    IteratorConnectHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]`` >{});
8089  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.async_connect.overload4 `more...`]]``
8090
8091template<
8092    class Iterator,
8093    class __ConnectCondition__,
8094    class __IteratorConnectHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]``>>
8095``__deduced__``
8096``[link beast.ref.boost__beast__basic_stream.async_connect.overload5 async_connect]``(
8097    Iterator begin,
8098    Iterator end,
8099    ConnectCondition connect_condition,
8100    IteratorConnectHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]`` >{});
8101  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.async_connect.overload5 `more...`]]``
8102```
8103
8104[section:overload1 basic_stream::async_connect (1 of 5 overloads)]
8105
8106Connect the stream to the specified endpoint asynchronously.
8107[heading Synopsis]
8108```
8109template<
8110    class __ConnectHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]``>>
8111``__deduced__``
8112async_connect(
8113    endpoint_type const& ep,
8114    ConnectHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]`` >{});
8115```
8116
8117[heading Description]
8118This function is used to asynchronously connect the underlying socket to the specified remote endpoint. The function call always returns immediately. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
8119If the timeout timer expires while the operation is outstanding, the operation will be canceled and the completion handler will be invoked with the error [link beast.ref.boost__beast__error `error::timeout`].
8120
8121[heading Parameters]
8122[table [[Name][Description]]
8123  [
8124    [`ep`
8125    ]
8126    [
8127The remote endpoint to which the underlying socket will be connected. Copies will be made of the endpoint object as required.
8128    ]
8129  ]
8130  [
8131    [`handler`
8132    ]
8133    [
8134
8135The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
8136```
8137void handler(
8138    error_code ec         // Result of operation
8139);
8140```
8141
8142Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
8143    ]
8144  ]
8145]
8146[heading See Also]
8147[link beast.ref.boost__beast__basic_stream.async_connect `async_connect`]
8148
8149[endsect]
8150
8151[section:overload2 basic_stream::async_connect (2 of 5 overloads)]
8152
8153Establishes a connection by trying each endpoint in a sequence asynchronously.
8154[heading Synopsis]
8155```
8156template<
8157    class __EndpointSequence__,
8158    class __RangeConnectHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]``>>
8159``__deduced__``
8160async_connect(
8161    EndpointSequence const& endpoints,
8162    RangeConnectHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]`` >{});
8163```
8164
8165[heading Description]
8166This function attempts to connect the stream to one of a sequence of endpoints by trying each endpoint until a connection is successfully established. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
8167The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the underlying socket's `async_connect` function.
8168If the timeout timer expires while the operation is outstanding, the current connection attempt will be canceled and the completion handler will be invoked with the error [link beast.ref.boost__beast__error `error::timeout`].
8169
8170[heading Parameters]
8171[table [[Name][Description]]
8172  [
8173    [`endpoints`
8174    ]
8175    [
8176A sequence of endpoints. This this object must meet the requirements of ['EndpointSequence].
8177    ]
8178  ]
8179  [
8180    [`handler`
8181    ]
8182    [
8183
8184The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
8185```
8186void handler(
8187    // Result of operation. if the sequence is empty, set to
8188    // net::error::not_found. Otherwise, contains the
8189    // error from the last connection attempt.
8190    error_code const& error,
8191
8192    // On success, the successfully connected endpoint.
8193    // Otherwise, a default-constructed endpoint.
8194    typename Protocol::endpoint const& endpoint
8195);
8196```
8197
8198Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
8199    ]
8200  ]
8201]
8202
8203[endsect]
8204
8205[section:overload3 basic_stream::async_connect (3 of 5 overloads)]
8206
8207Establishes a connection by trying each endpoint in a sequence asynchronously.
8208[heading Synopsis]
8209```
8210template<
8211    class __EndpointSequence__,
8212    class __ConnectCondition__,
8213    class __RangeConnectHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]``>>
8214``__deduced__``
8215async_connect(
8216    EndpointSequence const& endpoints,
8217    ConnectCondition connect_condition,
8218    RangeConnectHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]`` >{});
8219```
8220
8221[heading Description]
8222This function attempts to connect the stream to one of a sequence of endpoints by trying each endpoint until a connection is successfully established. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
8223The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the underlying socket's `async_connect` function.
8224If the timeout timer expires while the operation is outstanding, the current connection attempt will be canceled and the completion handler will be invoked with the error [link beast.ref.boost__beast__error `error::timeout`].
8225
8226[heading Parameters]
8227[table [[Name][Description]]
8228  [
8229    [`endpoints`
8230    ]
8231    [
8232A sequence of endpoints. This this object must meet the requirements of ['EndpointSequence].
8233    ]
8234  ]
8235  [
8236    [`connect_condition`
8237    ]
8238    [
8239
8240A function object that is called prior to each connection attempt. The signature of the function object must be:
8241```
8242bool connect_condition(
8243    error_code const& ec,
8244    typename Protocol::endpoint const& next);
8245```
8246
8247The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.
8248    ]
8249  ]
8250  [
8251    [`handler`
8252    ]
8253    [
8254
8255The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
8256```
8257void handler(
8258    // Result of operation. if the sequence is empty, set to
8259    // net::error::not_found. Otherwise, contains the
8260    // error from the last connection attempt.
8261    error_code const& error,
8262
8263    // On success, the successfully connected endpoint.
8264    // Otherwise, a default-constructed endpoint.
8265    typename Protocol::endpoint const& endpoint
8266);
8267```
8268
8269Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
8270    ]
8271  ]
8272]
8273[heading Example]
8274
8275The following connect condition function object can be used to output information about the individual connection attempts:
8276```
8277struct my_connect_condition
8278{
8279    bool operator()(
8280        error_code const& ec,
8281        net::ip::tcp::endpoint const& next)
8282    {
8283        if (ec)
8284            std::cout << "Error: " << ec.message() << std::endl;
8285        std::cout << "Trying: " << next << std::endl;
8286        return true;
8287    }
8288};
8289```
8290
8291
8292[endsect]
8293
8294[section:overload4 basic_stream::async_connect (4 of 5 overloads)]
8295
8296Establishes a connection by trying each endpoint in a sequence asynchronously.
8297[heading Synopsis]
8298```
8299template<
8300    class Iterator,
8301    class __IteratorConnectHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]``>>
8302``__deduced__``
8303async_connect(
8304    Iterator begin,
8305    Iterator end,
8306    IteratorConnectHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]`` >{});
8307```
8308
8309[heading Description]
8310This function attempts to connect the stream to one of a sequence of endpoints by trying each endpoint until a connection is successfully established. The underlying socket is automatically opened if needed. An automatically opened socket is not returned to the closed state upon failure.
8311The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the underlying socket's `async_connect` function.
8312If the timeout timer expires while the operation is outstanding, the current connection attempt will be canceled and the completion handler will be invoked with the error [link beast.ref.boost__beast__error `error::timeout`].
8313
8314[heading Parameters]
8315[table [[Name][Description]]
8316  [
8317    [`begin`
8318    ]
8319    [
8320An iterator pointing to the start of a sequence of endpoints.
8321    ]
8322  ]
8323  [
8324    [`end`
8325    ]
8326    [
8327An iterator pointing to the end of a sequence of endpoints.
8328    ]
8329  ]
8330  [
8331    [`handler`
8332    ]
8333    [
8334
8335The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
8336```
8337void handler(
8338    // Result of operation. if the sequence is empty, set to
8339    // net::error::not_found. Otherwise, contains the
8340    // error from the last connection attempt.
8341    error_code const& error,
8342
8343    // On success, an iterator denoting the successfully
8344    // connected endpoint. Otherwise, the end iterator.
8345    Iterator iterator
8346);
8347```
8348
8349Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
8350    ]
8351  ]
8352]
8353
8354[endsect]
8355
8356[section:overload5 basic_stream::async_connect (5 of 5 overloads)]
8357
8358Establishes a connection by trying each endpoint in a sequence asynchronously.
8359[heading Synopsis]
8360```
8361template<
8362    class Iterator,
8363    class __ConnectCondition__,
8364    class __IteratorConnectHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]``>>
8365``__deduced__``
8366async_connect(
8367    Iterator begin,
8368    Iterator end,
8369    ConnectCondition connect_condition,
8370    IteratorConnectHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]`` >{});
8371```
8372
8373[heading Description]
8374This function attempts to connect the stream to one of a sequence of endpoints by trying each endpoint until a connection is successfully established. The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the underlying socket's `async_connect` function.
8375If the timeout timer expires while the operation is outstanding, the current connection attempt will be canceled and the completion handler will be invoked with the error [link beast.ref.boost__beast__error `error::timeout`].
8376
8377[heading Parameters]
8378[table [[Name][Description]]
8379  [
8380    [`begin`
8381    ]
8382    [
8383An iterator pointing to the start of a sequence of endpoints.
8384    ]
8385  ]
8386  [
8387    [`end`
8388    ]
8389    [
8390An iterator pointing to the end of a sequence of endpoints.
8391    ]
8392  ]
8393  [
8394    [`connect_condition`
8395    ]
8396    [
8397
8398A function object that is called prior to each connection attempt. The signature of the function object must be:
8399```
8400bool connect_condition(
8401    error_code const& ec,
8402    typename Protocol::endpoint const& next);
8403```
8404
8405    ]
8406  ]
8407  [
8408    [`handler`
8409    ]
8410    [
8411
8412The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
8413```
8414void handler(
8415    // Result of operation. if the sequence is empty, set to
8416    // net::error::not_found. Otherwise, contains the
8417    // error from the last connection attempt.
8418    error_code const& error,
8419
8420    // On success, an iterator denoting the successfully
8421    // connected endpoint. Otherwise, the end iterator.
8422    Iterator iterator
8423);
8424```
8425
8426Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
8427    ]
8428  ]
8429]
8430
8431[endsect]
8432
8433
8434[endsect]
8435
8436[section:read_some basic_stream::read_some]
8437[indexterm2 read_some..basic_stream]
8438
8439
8440Read some data.
8441```
8442template<
8443    class __MutableBufferSequence__>
8444std::size_t
8445``[link beast.ref.boost__beast__basic_stream.read_some.overload1 read_some]``(
8446    MutableBufferSequence const& buffers);
8447  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.read_some.overload1 `more...`]]``
8448
8449template<
8450    class __MutableBufferSequence__>
8451std::size_t
8452``[link beast.ref.boost__beast__basic_stream.read_some.overload2 read_some]``(
8453    MutableBufferSequence const& buffers,
8454    error_code& ec);
8455  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.read_some.overload2 `more...`]]``
8456```
8457
8458[section:overload1 basic_stream::read_some (1 of 2 overloads)]
8459
8460Read some data.
8461[heading Synopsis]
8462```
8463template<
8464    class __MutableBufferSequence__>
8465std::size_t
8466read_some(
8467    MutableBufferSequence const& buffers);
8468```
8469
8470[heading Description]
8471This function is used to read some data from the stream.
8472The call blocks until one of the following is true:
8473
8474* One or more bytes are read from the stream.
8475
8476* An error occurs.
8477
8478[heading Parameters]
8479[table [[Name][Description]]
8480  [
8481    [`buffers`
8482    ]
8483    [
8484The buffers into which the data will be read. If the size of the buffers is zero bytes, the call always returns immediately with no error.
8485    ]
8486  ]
8487]
8488[heading Return Value]
8489The number of bytes read.
8490[heading Exceptions]
8491[table [[Type][Thrown On]]
8492  [
8493    [`system_error`
8494    ]
8495    [
8496Thrown on failure.
8497    ]
8498  ]
8499]
8500[heading Remarks]
8501The `read_some` operation may not receive all of the requested number of bytes. Consider using the function [link beast.ref.boost__beast__file_mode `net::read`] if you need to ensure that the requested amount of data is read before the blocking operation completes.
8502
8503[endsect]
8504
8505[section:overload2 basic_stream::read_some (2 of 2 overloads)]
8506
8507Read some data.
8508[heading Synopsis]
8509```
8510template<
8511    class __MutableBufferSequence__>
8512std::size_t
8513read_some(
8514    MutableBufferSequence const& buffers,
8515    error_code& ec);
8516```
8517
8518[heading Description]
8519This function is used to read some data from the underlying socket.
8520The call blocks until one of the following is true:
8521
8522* One or more bytes are read from the stream.
8523
8524* An error occurs.
8525
8526[heading Parameters]
8527[table [[Name][Description]]
8528  [
8529    [`buffers`
8530    ]
8531    [
8532The buffers into which the data will be read. If the size of the buffers is zero bytes, the call always returns immediately with no error.
8533    ]
8534  ]
8535  [
8536    [`ec`
8537    ]
8538    [
8539Set to indicate what error occurred, if any.
8540    ]
8541  ]
8542]
8543[heading Return Value]
8544The number of bytes read.
8545[heading Remarks]
8546The `read_some` operation may not receive all of the requested number of bytes. Consider using the function [link beast.ref.boost__beast__file_mode `net::read`] if you need to ensure that the requested amount of data is read before the blocking operation completes.
8547
8548[endsect]
8549
8550
8551[endsect]
8552
8553[section:async_read_some basic_stream::async_read_some]
8554[indexterm2 async_read_some..basic_stream]
8555
8556
8557Read some data asynchronously.
8558[heading Synopsis]
8559```
8560template<
8561    class __MutableBufferSequence__,
8562    class __ReadHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]``>>
8563``__deduced__``
8564async_read_some(
8565    MutableBufferSequence const& buffers,
8566    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__basic_stream.executor_type executor_type]`` >{});
8567```
8568
8569[heading Description]
8570This function is used to asynchronously read data from the stream.
8571This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
8572
8573* One or more bytes are read from the stream.
8574
8575* An error occurs.
8576
8577The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_read_some` function. The program must ensure that no other calls to [link beast.ref.boost__beast__basic_stream.read_some `read_some`] or [link beast.ref.boost__beast__basic_stream.async_read_some `async_read_some`] are performed until this operation completes.
8578If the timeout timer expires while the operation is outstanding, the operation will be canceled and the completion handler will be invoked with the error [link beast.ref.boost__beast__error `error::timeout`].
8579
8580[heading Parameters]
8581[table [[Name][Description]]
8582  [
8583    [`buffers`
8584    ]
8585    [
8586The buffers into which the data will be read. If the size of the buffers is zero bytes, the operation always completes immediately with no error. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.
8587    ]
8588  ]
8589  [
8590    [`handler`
8591    ]
8592    [
8593
8594The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
8595```
8596void handler(
8597    error_code error,               // Result of operation.
8598    std::size_t bytes_transferred   // Number of bytes read.
8599);
8600```
8601
8602Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
8603    ]
8604  ]
8605]
8606[heading Remarks]
8607The `async_read_some` operation may not receive all of the requested number of bytes. Consider using the function `net::async_read` if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
8608
8609[endsect]
8610
8611[section:write_some basic_stream::write_some]
8612[indexterm2 write_some..basic_stream]
8613
8614
8615Write some data.
8616```
8617template<
8618    class __ConstBufferSequence__>
8619std::size_t
8620``[link beast.ref.boost__beast__basic_stream.write_some.overload1 write_some]``(
8621    ConstBufferSequence const& buffers);
8622  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.write_some.overload1 `more...`]]``
8623
8624template<
8625    class __ConstBufferSequence__>
8626std::size_t
8627``[link beast.ref.boost__beast__basic_stream.write_some.overload2 write_some]``(
8628    ConstBufferSequence const& buffers,
8629    error_code& ec);
8630  ``[''''&raquo;''' [link beast.ref.boost__beast__basic_stream.write_some.overload2 `more...`]]``
8631```
8632
8633[section:overload1 basic_stream::write_some (1 of 2 overloads)]
8634
8635Write some data.
8636[heading Synopsis]
8637```
8638template<
8639    class __ConstBufferSequence__>
8640std::size_t
8641write_some(
8642    ConstBufferSequence const& buffers);
8643```
8644
8645[heading Description]
8646This function is used to write some data to the stream.
8647The call blocks until one of the following is true:
8648
8649* One or more bytes are written to the stream.
8650
8651* An error occurs.
8652
8653[heading Parameters]
8654[table [[Name][Description]]
8655  [
8656    [`buffers`
8657    ]
8658    [
8659The buffers from which the data will be written. If the size of the buffers is zero bytes, the call always returns immediately with no error.
8660    ]
8661  ]
8662]
8663[heading Return Value]
8664The number of bytes written.
8665[heading Exceptions]
8666[table [[Type][Thrown On]]
8667  [
8668    [`system_error`
8669    ]
8670    [
8671Thrown on failure.
8672    ]
8673  ]
8674]
8675[heading Remarks]
8676The `write_some` operation may not transmit all of the requested number of bytes. Consider using the function [link beast.ref.boost__beast__file_mode `net::write`] if you need to ensure that the requested amount of data is written before the blocking operation completes.
8677
8678[endsect]
8679
8680[section:overload2 basic_stream::write_some (2 of 2 overloads)]
8681
8682Write some data.
8683[heading Synopsis]
8684```
8685template<
8686    class __ConstBufferSequence__>
8687std::size_t
8688write_some(
8689    ConstBufferSequence const& buffers,
8690    error_code& ec);
8691```
8692
8693[heading Description]
8694This function is used to write some data to the stream.
8695The call blocks until one of the following is true:
8696
8697* One or more bytes are written to the stream.
8698
8699* An error occurs.
8700
8701[heading Parameters]
8702[table [[Name][Description]]
8703  [
8704    [`buffers`
8705    ]
8706    [
8707The buffers from which the data will be written. If the size of the buffers is zero bytes, the call always returns immediately with no error.
8708    ]
8709  ]
8710  [
8711    [`ec`
8712    ]
8713    [
8714Set to indicate what error occurred, if any.
8715    ]
8716  ]
8717]
8718[heading Return Value]
8719The number of bytes written.
8720[heading Exceptions]
8721[table [[Type][Thrown On]]
8722  [
8723    [`system_error`
8724    ]
8725    [
8726Thrown on failure.
8727    ]
8728  ]
8729]
8730[heading Remarks]
8731The `write_some` operation may not transmit all of the requested number of bytes. Consider using the function [link beast.ref.boost__beast__file_mode `net::write`] if you need to ensure that the requested amount of data is written before the blocking operation completes.
8732
8733[endsect]
8734
8735
8736[endsect]
8737
8738[section:async_write_some basic_stream::async_write_some]
8739[indexterm2 async_write_some..basic_stream]
8740
8741
8742Write some data asynchronously.
8743[heading Synopsis]
8744```
8745template<
8746    class __ConstBufferSequence__,
8747    class __WriteHandler__ = net::default_completion_token_t<Executor>>
8748``__deduced__``
8749async_write_some(
8750    ConstBufferSequence const& buffers,
8751    WriteHandler&& handler = net::default_completion_token_t< Executor >{});
8752```
8753
8754[heading Description]
8755This function is used to asynchronously write data to the underlying socket.
8756This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
8757
8758* One or more bytes are written to the stream.
8759
8760* An error occurs.
8761
8762The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_write_some` function. The program must ensure that no other calls to [link beast.ref.boost__beast__basic_stream.async_write_some `async_write_some`] are performed until this operation completes.
8763If the timeout timer expires while the operation is outstanding, the operation will be canceled and the completion handler will be invoked with the error [link beast.ref.boost__beast__error `error::timeout`].
8764
8765[heading Parameters]
8766[table [[Name][Description]]
8767  [
8768    [`buffers`
8769    ]
8770    [
8771The buffers from which the data will be written. If the size of the buffers is zero bytes, the operation always completes immediately with no error. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.
8772    ]
8773  ]
8774  [
8775    [`handler`
8776    ]
8777    [
8778
8779The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
8780```
8781void handler(
8782    error_code error,               // Result of operation.
8783    std::size_t bytes_transferred   // Number of bytes written.
8784);
8785```
8786
8787Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
8788    ]
8789  ]
8790]
8791[heading Remarks]
8792The `async_write_some` operation may not transmit all of the requested number of bytes. Consider using the function `net::async_write` if you need to ensure that the requested amount of data is sent before the asynchronous operation completes.
8793
8794[endsect]
8795
8796
8797[endsect]
8798
8799[section:boost__beast__http__basic_string_body http::basic_string_body]
8800
8801A ['Body] using `std::basic_string`
8802[heading Synopsis]
8803Defined in header [include_file boost/beast/http/string_body.hpp]
8804
8805```
8806template<
8807    class CharT,
8808    class Traits = std::char_traits<CharT>,
8809    class __Allocator__ = std::allocator<CharT>>
8810struct basic_string_body
8811```
8812
8813[heading Types]
8814[table [[Name][Description]]
8815  [
8816    [[*[link beast.ref.boost__beast__http__basic_string_body.reader reader]]
8817    ]
8818    [
8819
8820The algorithm for parsing the body.
8821    ]
8822  ]
8823  [
8824    [[*[link beast.ref.boost__beast__http__basic_string_body.value_type value_type]]
8825    ]
8826    [
8827
8828The type of container used for the body.
8829    ]
8830  ]
8831  [
8832    [[*[link beast.ref.boost__beast__http__basic_string_body.writer writer]]
8833    ]
8834    [
8835
8836The algorithm for serializing the body.
8837    ]
8838  ]
8839]
8840[heading Static Members]
8841[table [[Name][Description]]
8842  [
8843    [[*[link beast.ref.boost__beast__http__basic_string_body.size size]]
8844    ]
8845    [
8846
8847Returns the payload size of the body.
8848    ]
8849  ]
8850]
8851[heading Description]
8852This body uses `std::basic_string` as a memory-based container for holding message payloads. Messages using this body type may be serialized and parsed.
8853
8854[section:value_type http::basic_string_body::value_type]
8855[indexterm2 value_type..http::basic_string_body]
8856
8857
8858The type of container used for the body.
8859[heading Synopsis]
8860```
8861using value_type = std::basic_string< CharT, Traits, Allocator >;
8862```
8863
8864[heading Description]
8865This determines the type of [link beast.ref.boost__beast__http__message.body `message::body`] when this body type is used with a message container.
8866
8867[endsect]
8868
8869[section:reader http::basic_string_body::reader]
8870[indexterm2 reader..http::basic_string_body]
8871
8872
8873The algorithm for parsing the body.
8874[heading Synopsis]
8875```
8876using reader = ``['implementation-defined]``;
8877```
8878
8879[heading Description]
8880Meets the requirements of ['BodyReader].
8881
8882[endsect]
8883
8884[section:writer http::basic_string_body::writer]
8885[indexterm2 writer..http::basic_string_body]
8886
8887
8888The algorithm for serializing the body.
8889[heading Synopsis]
8890```
8891using writer = ``['implementation-defined]``;
8892```
8893
8894[heading Description]
8895Meets the requirements of ['BodyWriter].
8896
8897[endsect]
8898
8899[section:size http::basic_string_body::size]
8900[indexterm2 size..http::basic_string_body]
8901
8902
8903Returns the payload size of the body.
8904[heading Synopsis]
8905```
8906static
8907std::uint64_t
8908size(
8909    value_type const& body);
8910```
8911
8912[heading Description]
8913When this body is used with [link beast.ref.boost__beast__http__message.prepare_payload `message::prepare_payload`], the Content-Length will be set to the payload size, and any chunked Transfer-Encoding will be removed.
8914
8915[endsect]
8916
8917
8918[endsect]
8919
8920[section:boost__beast__http__buffer_body http::buffer_body]
8921
8922A ['Body] using a caller provided buffer.
8923[heading Synopsis]
8924Defined in header [include_file boost/beast/http/buffer_body.hpp]
8925
8926```
8927struct buffer_body
8928```
8929
8930[heading Types]
8931[table [[Name][Description]]
8932  [
8933    [[*[link beast.ref.boost__beast__http__buffer_body.reader reader]]
8934    ]
8935    [
8936
8937The algorithm for parsing the body.
8938    ]
8939  ]
8940  [
8941    [[*[link beast.ref.boost__beast__http__buffer_body__value_type value_type]]
8942    ]
8943    [
8944
8945The type of the body member when used in a message.
8946    ]
8947  ]
8948  [
8949    [[*[link beast.ref.boost__beast__http__buffer_body.writer writer]]
8950    ]
8951    [
8952
8953The algorithm for serializing the body.
8954    ]
8955  ]
8956]
8957[heading Description]
8958Messages using this body type may be serialized and parsed. To use this class, the caller must initialize the members of [link beast.ref.boost__beast__http__buffer_body__value_type `buffer_body::value_type`] to appropriate values before each call to read or write during a stream operation.
8959
8960[section:reader http::buffer_body::reader]
8961[indexterm2 reader..http::buffer_body]
8962
8963
8964The algorithm for parsing the body.
8965[heading Synopsis]
8966```
8967using reader = ``['implementation-defined]``;
8968```
8969
8970[heading Description]
8971Meets the requirements of ['BodyReader].
8972
8973[endsect]
8974
8975[section:writer http::buffer_body::writer]
8976[indexterm2 writer..http::buffer_body]
8977
8978
8979The algorithm for serializing the body.
8980[heading Synopsis]
8981```
8982using writer = ``['implementation-defined]``;
8983```
8984
8985[heading Description]
8986Meets the requirements of ['BodyWriter].
8987
8988[endsect]
8989
8990
8991[endsect]
8992
8993[section:boost__beast__buffered_read_stream buffered_read_stream]
8994
8995A ['Stream] with attached ['DynamicBuffer] to buffer reads.
8996[heading Synopsis]
8997Defined in header [include_file boost/beast/core/buffered_read_stream.hpp]
8998
8999```
9000template<
9001    class __Stream__,
9002    class __DynamicBuffer__>
9003class buffered_read_stream
9004```
9005
9006[heading Types]
9007[table [[Name][Description]]
9008  [
9009    [[*[link beast.ref.boost__beast__buffered_read_stream.buffer_type buffer_type]]
9010    ]
9011    [
9012
9013The type of the internal buffer.
9014    ]
9015  ]
9016  [
9017    [[*[link beast.ref.boost__beast__buffered_read_stream.executor_type executor_type]]
9018    ]
9019    [
9020
9021    ]
9022  ]
9023  [
9024    [[*[link beast.ref.boost__beast__buffered_read_stream.next_layer_type next_layer_type]]
9025    ]
9026    [
9027
9028The type of the next layer.
9029    ]
9030  ]
9031]
9032[heading Member Functions]
9033[table [[Name][Description]]
9034  [
9035    [[*[link beast.ref.boost__beast__buffered_read_stream.async_read_some async_read_some]]
9036    ]
9037    [
9038
9039Start an asynchronous read.
9040    ]
9041  ]
9042  [
9043    [[*[link beast.ref.boost__beast__buffered_read_stream.async_write_some async_write_some]]
9044    ]
9045    [
9046
9047Start an asynchronous write.
9048    ]
9049  ]
9050  [
9051    [[*[link beast.ref.boost__beast__buffered_read_stream.buffer buffer]]
9052    ]
9053    [
9054
9055Access the internal buffer.
9056    ]
9057  ]
9058  [
9059    [[*[link beast.ref.boost__beast__buffered_read_stream.buffered_read_stream buffered_read_stream]]
9060    ]
9061    [
9062
9063Move constructor.
9064
9065Construct the wrapping stream.
9066    ]
9067  ]
9068  [
9069    [[*[link beast.ref.boost__beast__buffered_read_stream.capacity capacity]]
9070    ]
9071    [
9072
9073Set the maximum buffer size.
9074    ]
9075  ]
9076  [
9077    [[*[link beast.ref.boost__beast__buffered_read_stream.get_executor get_executor]]
9078    ]
9079    [
9080
9081Get the executor associated with the object.
9082    ]
9083  ]
9084  [
9085    [[*[link beast.ref.boost__beast__buffered_read_stream.next_layer next_layer]]
9086    ]
9087    [
9088
9089Get a reference to the next layer.
9090
9091Get a const reference to the next layer.
9092    ]
9093  ]
9094  [
9095    [[*[link beast.ref.boost__beast__buffered_read_stream.operator_eq_ operator=]]
9096    ]
9097    [
9098
9099Move assignment.
9100    ]
9101  ]
9102  [
9103    [[*[link beast.ref.boost__beast__buffered_read_stream.read_some read_some]]
9104    ]
9105    [
9106
9107Read some data from the stream.
9108    ]
9109  ]
9110  [
9111    [[*[link beast.ref.boost__beast__buffered_read_stream.write_some write_some]]
9112    ]
9113    [
9114
9115Write some data to the stream.
9116    ]
9117  ]
9118]
9119[heading Description]
9120This wraps a ['Stream] implementation so that calls to write are passed through to the underlying stream, while calls to read will first consume the input sequence stored in a ['DynamicBuffer] which is part of the object.
9121The use-case for this class is different than that of the `net::buffered_read_stream`. It is designed to facilitate the use of `net::read_until`, and to allow buffers acquired during detection of handshakes to be made transparently available to callers. A hypothetical implementation of the buffered version of `net::ssl::stream::async_handshake` could make use of this wrapper.
9122Uses:
9123
9124* Transparently leave untouched input acquired in calls to `net::read_until` behind for subsequent callers.
9125
9126* "Preload" a stream with handshake input data acquired from other sources.
9127
9128Example:
9129```
9130// Process the next HTTP header on the stream,
9131// leaving excess bytes behind for the next call.
9132//
9133template<class Stream, class DynamicBuffer>
9134void process_http_message(
9135    buffered_read_stream<Stream, DynamicBuffer>& stream)
9136{
9137    // Read up to and including the end of the HTTP
9138    // header, leaving the sequence in the stream's
9139    // buffer. read_until may read past the end of the
9140    // headers; the return value will include only the
9141    // part up to the end of the delimiter.
9142    //
9143    std::size_t bytes_transferred =
9144        net::read_until(
9145            stream.next_layer(), stream.buffer(), "\r\n\r\n");
9146
9147    // Use buffers_prefix() to limit the input
9148    // sequence to only the data up to and including
9149    // the trailing "\r\n\r\n".
9150    //
9151    auto header_buffers = buffers_prefix(
9152        bytes_transferred, stream.buffer().data());
9153
9154    ...
9155
9156    // Discard the portion of the input corresponding
9157    // to the HTTP headers.
9158    //
9159    stream.buffer().consume(bytes_transferred);
9160
9161    // Everything we read from the stream
9162    // is part of the content-body.
9163}
9164```
9165
9166
9167[heading Template Parameters]
9168[table [[Type][Description]]
9169  [
9170    [`Stream`
9171    ]
9172    [
9173The type of stream to wrap.
9174    ]
9175  ]
9176  [
9177    [`DynamicBuffer`
9178    ]
9179    [
9180The type of stream buffer to use.
9181    ]
9182  ]
9183]
9184
9185[section:buffer_type buffered_read_stream::buffer_type]
9186[indexterm2 buffer_type..buffered_read_stream]
9187
9188
9189The type of the internal buffer.
9190[heading Synopsis]
9191```
9192using buffer_type = DynamicBuffer;
9193```
9194
9195[heading Description]
9196
9197[endsect]
9198
9199[section:next_layer_type buffered_read_stream::next_layer_type]
9200[indexterm2 next_layer_type..buffered_read_stream]
9201
9202
9203The type of the next layer.
9204[heading Synopsis]
9205```
9206using next_layer_type = typename std::remove_reference< Stream >::type;
9207```
9208
9209[heading Description]
9210
9211[endsect]
9212
9213[section:executor_type buffered_read_stream::executor_type]
9214[indexterm2 executor_type..buffered_read_stream]
9215
9216
9217[heading Synopsis]
9218```
9219using executor_type = beast::executor_type< next_layer_type >;
9220```
9221
9222[heading Description]
9223
9224[endsect]
9225
9226[section:buffered_read_stream buffered_read_stream::buffered_read_stream]
9227[indexterm2 buffered_read_stream..buffered_read_stream]
9228
9229
9230Move constructor.
9231```
9232``[link beast.ref.boost__beast__buffered_read_stream.buffered_read_stream.overload1 buffered_read_stream]``(
9233    buffered_read_stream&&);
9234  ``[''''&raquo;''' [link beast.ref.boost__beast__buffered_read_stream.buffered_read_stream.overload1 `more...`]]``
9235```
9236
9237
9238Construct the wrapping stream.
9239```
9240template<
9241    class... Args>
9242explicit
9243``[link beast.ref.boost__beast__buffered_read_stream.buffered_read_stream.overload2 buffered_read_stream]``(
9244    Args&&... args);
9245  ``[''''&raquo;''' [link beast.ref.boost__beast__buffered_read_stream.buffered_read_stream.overload2 `more...`]]``
9246```
9247
9248[section:overload1 buffered_read_stream::buffered_read_stream (1 of 2 overloads)]
9249
9250Move constructor.
9251[heading Synopsis]
9252```
9253buffered_read_stream(
9254    buffered_read_stream&&);
9255```
9256
9257[heading Description]
9258
9259[heading Remarks]
9260The behavior of move assignment on or from streams with active or pending operations is undefined.
9261
9262[endsect]
9263
9264[section:overload2 buffered_read_stream::buffered_read_stream (2 of 2 overloads)]
9265
9266Construct the wrapping stream.
9267[heading Synopsis]
9268```
9269template<
9270    class... Args>
9271buffered_read_stream(
9272    Args&&... args);
9273```
9274
9275[heading Description]
9276
9277[heading Parameters]
9278[table [[Name][Description]]
9279  [
9280    [`args`
9281    ]
9282    [
9283Parameters forwarded to the `Stream` constructor.
9284    ]
9285  ]
9286]
9287
9288[endsect]
9289
9290
9291[endsect]
9292
9293[section:operator_eq_ buffered_read_stream::operator=]
9294[indexterm2 operator=..buffered_read_stream]
9295
9296
9297Move assignment.
9298[heading Synopsis]
9299```
9300buffered_read_stream&
9301operator=(
9302    buffered_read_stream&&);
9303```
9304
9305[heading Description]
9306
9307[heading Remarks]
9308The behavior of move assignment on or from streams with active or pending operations is undefined.
9309
9310[endsect]
9311
9312[section:next_layer buffered_read_stream::next_layer]
9313[indexterm2 next_layer..buffered_read_stream]
9314
9315
9316Get a reference to the next layer.
9317```
9318next_layer_type&
9319``[link beast.ref.boost__beast__buffered_read_stream.next_layer.overload1 next_layer]``();
9320  ``[''''&raquo;''' [link beast.ref.boost__beast__buffered_read_stream.next_layer.overload1 `more...`]]``
9321```
9322
9323
9324Get a const reference to the next layer.
9325```
9326next_layer_type const&
9327``[link beast.ref.boost__beast__buffered_read_stream.next_layer.overload2 next_layer]``() const;
9328  ``[''''&raquo;''' [link beast.ref.boost__beast__buffered_read_stream.next_layer.overload2 `more...`]]``
9329```
9330
9331[section:overload1 buffered_read_stream::next_layer (1 of 2 overloads)]
9332
9333Get a reference to the next layer.
9334[heading Synopsis]
9335```
9336next_layer_type&
9337next_layer();
9338```
9339
9340[heading Description]
9341
9342[endsect]
9343
9344[section:overload2 buffered_read_stream::next_layer (2 of 2 overloads)]
9345
9346Get a const reference to the next layer.
9347[heading Synopsis]
9348```
9349next_layer_type const&
9350next_layer() const;
9351```
9352
9353[heading Description]
9354
9355[endsect]
9356
9357
9358[endsect]
9359
9360[section:get_executor buffered_read_stream::get_executor]
9361[indexterm2 get_executor..buffered_read_stream]
9362
9363
9364Get the executor associated with the object.
9365[heading Synopsis]
9366```
9367executor_type
9368get_executor();
9369```
9370
9371[heading Description]
9372This function may be used to obtain the executor object that the stream uses to dispatch handlers for asynchronous operations.
9373
9374[heading Return Value]
9375A copy of the executor that stream will use to dispatch handlers.
9376
9377[endsect]
9378
9379[section:buffer buffered_read_stream::buffer]
9380[indexterm2 buffer..buffered_read_stream]
9381
9382
9383Access the internal buffer.
9384```
9385DynamicBuffer&
9386``[link beast.ref.boost__beast__buffered_read_stream.buffer.overload1 buffer]``();
9387  ``[''''&raquo;''' [link beast.ref.boost__beast__buffered_read_stream.buffer.overload1 `more...`]]``
9388
9389DynamicBuffer const&
9390``[link beast.ref.boost__beast__buffered_read_stream.buffer.overload2 buffer]``() const;
9391  ``[''''&raquo;''' [link beast.ref.boost__beast__buffered_read_stream.buffer.overload2 `more...`]]``
9392```
9393
9394[section:overload1 buffered_read_stream::buffer (1 of 2 overloads)]
9395
9396Access the internal buffer.
9397[heading Synopsis]
9398```
9399DynamicBuffer&
9400buffer();
9401```
9402
9403[heading Description]
9404The internal buffer is returned. It is possible for the caller to break invariants with this function. For example, by causing the internal buffer size to increase beyond the caller defined maximum.
9405
9406[endsect]
9407
9408[section:overload2 buffered_read_stream::buffer (2 of 2 overloads)]
9409
9410Access the internal buffer.
9411[heading Synopsis]
9412```
9413DynamicBuffer const&
9414buffer() const;
9415```
9416
9417[heading Description]
9418
9419[endsect]
9420
9421
9422[endsect]
9423
9424[section:capacity buffered_read_stream::capacity]
9425[indexterm2 capacity..buffered_read_stream]
9426
9427
9428Set the maximum buffer size.
9429[heading Synopsis]
9430```
9431void
9432capacity(
9433    std::size_t size);
9434```
9435
9436[heading Description]
9437This changes the maximum size of the internal buffer used to hold read data. No bytes are discarded by this call. If the buffer size is set to zero, no more data will be buffered.
9438Thread safety: The caller is responsible for making sure the call is made from the same implicit or explicit strand.
9439
9440[heading Parameters]
9441[table [[Name][Description]]
9442  [
9443    [`size`
9444    ]
9445    [
9446The number of bytes in the read buffer.
9447    ]
9448  ]
9449]
9450[heading Remarks]
9451This is a soft limit. If the new maximum size is smaller than the amount of data in the buffer, no bytes are discarded.
9452
9453[endsect]
9454
9455[section:read_some buffered_read_stream::read_some]
9456[indexterm2 read_some..buffered_read_stream]
9457
9458
9459Read some data from the stream.
9460```
9461template<
9462    class __MutableBufferSequence__>
9463std::size_t
9464``[link beast.ref.boost__beast__buffered_read_stream.read_some.overload1 read_some]``(
9465    MutableBufferSequence const& buffers);
9466  ``[''''&raquo;''' [link beast.ref.boost__beast__buffered_read_stream.read_some.overload1 `more...`]]``
9467
9468template<
9469    class __MutableBufferSequence__>
9470std::size_t
9471``[link beast.ref.boost__beast__buffered_read_stream.read_some.overload2 read_some]``(
9472    MutableBufferSequence const& buffers,
9473    error_code& ec);
9474  ``[''''&raquo;''' [link beast.ref.boost__beast__buffered_read_stream.read_some.overload2 `more...`]]``
9475```
9476
9477[section:overload1 buffered_read_stream::read_some (1 of 2 overloads)]
9478
9479Read some data from the stream.
9480[heading Synopsis]
9481```
9482template<
9483    class __MutableBufferSequence__>
9484std::size_t
9485read_some(
9486    MutableBufferSequence const& buffers);
9487```
9488
9489[heading Description]
9490This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
9491
9492[heading Parameters]
9493[table [[Name][Description]]
9494  [
9495    [`buffers`
9496    ]
9497    [
9498One or more buffers into which the data will be read.
9499    ]
9500  ]
9501]
9502[heading Return Value]
9503The number of bytes read.
9504[heading Exceptions]
9505[table [[Type][Thrown On]]
9506  [
9507    [`system_error`
9508    ]
9509    [
9510Thrown on failure.
9511    ]
9512  ]
9513]
9514
9515[endsect]
9516
9517[section:overload2 buffered_read_stream::read_some (2 of 2 overloads)]
9518
9519Read some data from the stream.
9520[heading Synopsis]
9521```
9522template<
9523    class __MutableBufferSequence__>
9524std::size_t
9525read_some(
9526    MutableBufferSequence const& buffers,
9527    error_code& ec);
9528```
9529
9530[heading Description]
9531This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
9532
9533[heading Parameters]
9534[table [[Name][Description]]
9535  [
9536    [`buffers`
9537    ]
9538    [
9539One or more buffers into which the data will be read.
9540    ]
9541  ]
9542  [
9543    [`ec`
9544    ]
9545    [
9546Set to the error, if any occurred.
9547    ]
9548  ]
9549]
9550[heading Return Value]
9551The number of bytes read, or 0 on error.
9552
9553[endsect]
9554
9555
9556[endsect]
9557
9558[section:async_read_some buffered_read_stream::async_read_some]
9559[indexterm2 async_read_some..buffered_read_stream]
9560
9561
9562Start an asynchronous read.
9563[heading Synopsis]
9564```
9565template<
9566    class __MutableBufferSequence__,
9567    class __ReadHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__buffered_read_stream.executor_type executor_type]``>>
9568``__deduced__``
9569async_read_some(
9570    MutableBufferSequence const& buffers,
9571    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__buffered_read_stream.executor_type executor_type]`` >{});
9572```
9573
9574[heading Description]
9575This function is used to asynchronously read data from the stream. The function call always returns immediately.
9576
9577[heading Parameters]
9578[table [[Name][Description]]
9579  [
9580    [`buffers`
9581    ]
9582    [
9583One or more buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.
9584    ]
9585  ]
9586  [
9587    [`handler`
9588    ]
9589    [
9590
9591The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
9592```
9593void handler(
9594    error_code const& error,      // result of operation
9595    std::size_t bytes_transferred // number of bytes transferred
9596);
9597```
9598
9599    ]
9600  ]
9601]
9602Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
9603
9604[endsect]
9605
9606[section:write_some buffered_read_stream::write_some]
9607[indexterm2 write_some..buffered_read_stream]
9608
9609
9610Write some data to the stream.
9611```
9612template<
9613    class __ConstBufferSequence__>
9614std::size_t
9615``[link beast.ref.boost__beast__buffered_read_stream.write_some.overload1 write_some]``(
9616    ConstBufferSequence const& buffers);
9617  ``[''''&raquo;''' [link beast.ref.boost__beast__buffered_read_stream.write_some.overload1 `more...`]]``
9618
9619template<
9620    class __ConstBufferSequence__>
9621std::size_t
9622``[link beast.ref.boost__beast__buffered_read_stream.write_some.overload2 write_some]``(
9623    ConstBufferSequence const& buffers,
9624    error_code& ec);
9625  ``[''''&raquo;''' [link beast.ref.boost__beast__buffered_read_stream.write_some.overload2 `more...`]]``
9626```
9627
9628[section:overload1 buffered_read_stream::write_some (1 of 2 overloads)]
9629
9630Write some data to the stream.
9631[heading Synopsis]
9632```
9633template<
9634    class __ConstBufferSequence__>
9635std::size_t
9636write_some(
9637    ConstBufferSequence const& buffers);
9638```
9639
9640[heading Description]
9641This function is used to write data to the stream. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
9642
9643[heading Parameters]
9644[table [[Name][Description]]
9645  [
9646    [`buffers`
9647    ]
9648    [
9649One or more data buffers to be written to the stream.
9650    ]
9651  ]
9652]
9653[heading Return Value]
9654The number of bytes written.
9655[heading Exceptions]
9656[table [[Type][Thrown On]]
9657  [
9658    [`system_error`
9659    ]
9660    [
9661Thrown on failure.
9662    ]
9663  ]
9664]
9665
9666[endsect]
9667
9668[section:overload2 buffered_read_stream::write_some (2 of 2 overloads)]
9669
9670Write some data to the stream.
9671[heading Synopsis]
9672```
9673template<
9674    class __ConstBufferSequence__>
9675std::size_t
9676write_some(
9677    ConstBufferSequence const& buffers,
9678    error_code& ec);
9679```
9680
9681[heading Description]
9682This function is used to write data to the stream. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
9683
9684[heading Parameters]
9685[table [[Name][Description]]
9686  [
9687    [`buffers`
9688    ]
9689    [
9690One or more data buffers to be written to the stream.
9691    ]
9692  ]
9693  [
9694    [`ec`
9695    ]
9696    [
9697Set to the error, if any occurred.
9698    ]
9699  ]
9700]
9701[heading Return Value]
9702The number of bytes written.
9703
9704[endsect]
9705
9706
9707[endsect]
9708
9709[section:async_write_some buffered_read_stream::async_write_some]
9710[indexterm2 async_write_some..buffered_read_stream]
9711
9712
9713Start an asynchronous write.
9714[heading Synopsis]
9715```
9716template<
9717    class __ConstBufferSequence__,
9718    class __WriteHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__buffered_read_stream.executor_type executor_type]``>>
9719``__deduced__``
9720async_write_some(
9721    ConstBufferSequence const& buffers,
9722    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__buffered_read_stream.executor_type executor_type]`` >{});
9723```
9724
9725[heading Description]
9726This function is used to asynchronously write data from the stream. The function call always returns immediately.
9727
9728[heading Parameters]
9729[table [[Name][Description]]
9730  [
9731    [`buffers`
9732    ]
9733    [
9734One or more data buffers to be written to the stream. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.
9735    ]
9736  ]
9737  [
9738    [`handler`
9739    ]
9740    [
9741
9742The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
9743```
9744void handler(
9745    error_code const& error,      // result of operation
9746    std::size_t bytes_transferred // number of bytes transferred
9747);
9748```
9749
9750Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
9751    ]
9752  ]
9753]
9754
9755[endsect]
9756
9757
9758[endsect]
9759
9760[section:boost__beast__buffers_adaptor buffers_adaptor]
9761
9762Adapts a ['MutableBufferSequence] into a ['DynamicBuffer].
9763[heading Synopsis]
9764Defined in header [include_file boost/beast/core/buffers_adaptor.hpp]
9765
9766```
9767template<
9768    class __MutableBufferSequence__>
9769class buffers_adaptor
9770```
9771
9772[heading Types]
9773[table [[Name][Description]]
9774  [
9775    [[*[link beast.ref.boost__beast__buffers_adaptor.const_buffers_type const_buffers_type]]
9776    ]
9777    [
9778
9779The ConstBufferSequence used to represent the readable bytes.
9780    ]
9781  ]
9782  [
9783    [[*[link beast.ref.boost__beast__buffers_adaptor.mutable_buffers_type mutable_buffers_type]]
9784    ]
9785    [
9786
9787The MutableBufferSequence used to represent the writable bytes.
9788    ]
9789  ]
9790  [
9791    [[*[link beast.ref.boost__beast__buffers_adaptor.value_type value_type]]
9792    ]
9793    [
9794
9795The type of the underlying mutable buffer sequence.
9796    ]
9797  ]
9798]
9799[heading Member Functions]
9800[table [[Name][Description]]
9801  [
9802    [[*[link beast.ref.boost__beast__buffers_adaptor.buffers_adaptor buffers_adaptor]]
9803    ]
9804    [
9805
9806Construct a buffers adaptor.
9807
9808Constructor.
9809
9810Copy Constructor.
9811    ]
9812  ]
9813  [
9814    [[*[link beast.ref.boost__beast__buffers_adaptor.capacity capacity]]
9815    ]
9816    [
9817
9818Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
9819    ]
9820  ]
9821  [
9822    [[*[link beast.ref.boost__beast__buffers_adaptor.cdata cdata]]
9823    ]
9824    [
9825
9826Returns a constant buffer sequence representing the readable bytes.
9827    ]
9828  ]
9829  [
9830    [[*[link beast.ref.boost__beast__buffers_adaptor.commit commit]]
9831    ]
9832    [
9833
9834Append writable bytes to the readable bytes.
9835    ]
9836  ]
9837  [
9838    [[*[link beast.ref.boost__beast__buffers_adaptor.consume consume]]
9839    ]
9840    [
9841
9842Remove bytes from beginning of the readable bytes.
9843    ]
9844  ]
9845  [
9846    [[*[link beast.ref.boost__beast__buffers_adaptor.data data]]
9847    ]
9848    [
9849
9850Returns a constant buffer sequence representing the readable bytes.
9851
9852Returns a mutable buffer sequence representing the readable bytes.
9853    ]
9854  ]
9855  [
9856    [[*[link beast.ref.boost__beast__buffers_adaptor.max_size max_size]]
9857    ]
9858    [
9859
9860Return the maximum number of bytes, both readable and writable, that can ever be held.
9861    ]
9862  ]
9863  [
9864    [[*[link beast.ref.boost__beast__buffers_adaptor.operator_eq_ operator=]]
9865    ]
9866    [
9867
9868Copy Assignment.
9869    ]
9870  ]
9871  [
9872    [[*[link beast.ref.boost__beast__buffers_adaptor.prepare prepare]]
9873    ]
9874    [
9875
9876Returns a mutable buffer sequence representing writable bytes.
9877    ]
9878  ]
9879  [
9880    [[*[link beast.ref.boost__beast__buffers_adaptor.size size]]
9881    ]
9882    [
9883
9884Returns the number of readable bytes.
9885    ]
9886  ]
9887  [
9888    [[*[link beast.ref.boost__beast__buffers_adaptor.value value]]
9889    ]
9890    [
9891
9892Returns the original mutable buffer sequence.
9893    ]
9894  ]
9895]
9896[heading Description]
9897This class wraps a ['MutableBufferSequence] to meet the requirements of ['DynamicBuffer]. Upon construction the input and output sequences are empty. A copy of the mutable buffer sequence object is stored; however, ownership of the underlying memory is not transferred. The caller is responsible for making sure that referenced memory remains valid for the duration of any operations.
9898The size of the mutable buffer sequence determines the maximum number of bytes which may be prepared and committed.
9899
9900[heading Template Parameters]
9901[table [[Type][Description]]
9902  [
9903    [`MutableBufferSequence`
9904    ]
9905    [
9906The type of mutable buffer sequence to adapt.
9907    ]
9908  ]
9909]
9910
9911[section:value_type buffers_adaptor::value_type]
9912[indexterm2 value_type..buffers_adaptor]
9913
9914
9915The type of the underlying mutable buffer sequence.
9916[heading Synopsis]
9917```
9918using value_type = MutableBufferSequence;
9919```
9920
9921[heading Description]
9922
9923[endsect]
9924
9925[section:const_buffers_type buffers_adaptor::const_buffers_type]
9926[indexterm2 const_buffers_type..buffers_adaptor]
9927
9928
9929The ConstBufferSequence used to represent the readable bytes.
9930[heading Synopsis]
9931```
9932using const_buffers_type = ``['implementation-defined]``;
9933```
9934
9935[heading Description]
9936
9937[endsect]
9938
9939[section:mutable_buffers_type buffers_adaptor::mutable_buffers_type]
9940[indexterm2 mutable_buffers_type..buffers_adaptor]
9941
9942
9943The MutableBufferSequence used to represent the writable bytes.
9944[heading Synopsis]
9945```
9946using mutable_buffers_type = ``['implementation-defined]``;
9947```
9948
9949[heading Description]
9950
9951[endsect]
9952
9953[section:buffers_adaptor buffers_adaptor::buffers_adaptor]
9954[indexterm2 buffers_adaptor..buffers_adaptor]
9955
9956
9957Construct a buffers adaptor.
9958```
9959explicit
9960``[link beast.ref.boost__beast__buffers_adaptor.buffers_adaptor.overload1 buffers_adaptor]``(
9961    MutableBufferSequence const& buffers);
9962  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_adaptor.buffers_adaptor.overload1 `more...`]]``
9963```
9964
9965
9966Constructor.
9967```
9968template<
9969    class... Args>
9970explicit
9971``[link beast.ref.boost__beast__buffers_adaptor.buffers_adaptor.overload2 buffers_adaptor]``(
9972    boost::in_place_init_t,
9973    Args&&... args);
9974  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_adaptor.buffers_adaptor.overload2 `more...`]]``
9975```
9976
9977
9978Copy Constructor.
9979```
9980``[link beast.ref.boost__beast__buffers_adaptor.buffers_adaptor.overload3 buffers_adaptor]``(
9981    buffers_adaptor const& other);
9982  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_adaptor.buffers_adaptor.overload3 `more...`]]``
9983```
9984
9985[section:overload1 buffers_adaptor::buffers_adaptor (1 of 3 overloads)]
9986
9987Construct a buffers adaptor.
9988[heading Synopsis]
9989```
9990buffers_adaptor(
9991    MutableBufferSequence const& buffers);
9992```
9993
9994[heading Description]
9995
9996[heading Parameters]
9997[table [[Name][Description]]
9998  [
9999    [`buffers`
10000    ]
10001    [
10002The mutable buffer sequence to wrap. A copy of the object will be made, but ownership of the memory is not transferred.
10003    ]
10004  ]
10005]
10006
10007[endsect]
10008
10009[section:overload2 buffers_adaptor::buffers_adaptor (2 of 3 overloads)]
10010
10011Constructor.
10012[heading Synopsis]
10013```
10014template<
10015    class... Args>
10016buffers_adaptor(
10017    boost::in_place_init_t,
10018    Args&&... args);
10019```
10020
10021[heading Description]
10022This constructs the buffer adaptor in-place from a list of arguments.
10023
10024[heading Parameters]
10025[table [[Name][Description]]
10026  [
10027    [`args`
10028    ]
10029    [
10030Arguments forwarded to the buffers constructor.
10031    ]
10032  ]
10033]
10034
10035[endsect]
10036
10037[section:overload3 buffers_adaptor::buffers_adaptor (3 of 3 overloads)]
10038
10039Copy Constructor.
10040[heading Synopsis]
10041```
10042buffers_adaptor(
10043    buffers_adaptor const& other);
10044```
10045
10046[heading Description]
10047
10048[endsect]
10049
10050
10051[endsect]
10052
10053[section:operator_eq_ buffers_adaptor::operator=]
10054[indexterm2 operator=..buffers_adaptor]
10055
10056
10057Copy Assignment.
10058[heading Synopsis]
10059```
10060buffers_adaptor&
10061operator=(
10062    buffers_adaptor const&);
10063```
10064
10065[heading Description]
10066
10067[endsect]
10068
10069[section:value buffers_adaptor::value]
10070[indexterm2 value..buffers_adaptor]
10071
10072
10073Returns the original mutable buffer sequence.
10074[heading Synopsis]
10075```
10076value_type const&
10077value() const;
10078```
10079
10080[heading Description]
10081
10082[endsect]
10083
10084[section:size buffers_adaptor::size]
10085[indexterm2 size..buffers_adaptor]
10086
10087
10088Returns the number of readable bytes.
10089[heading Synopsis]
10090```
10091std::size_t
10092size() const;
10093```
10094
10095[heading Description]
10096
10097[endsect]
10098
10099[section:max_size buffers_adaptor::max_size]
10100[indexterm2 max_size..buffers_adaptor]
10101
10102
10103Return the maximum number of bytes, both readable and writable, that can ever be held.
10104[heading Synopsis]
10105```
10106std::size_t
10107max_size() const;
10108```
10109
10110[heading Description]
10111
10112[endsect]
10113
10114[section:capacity buffers_adaptor::capacity]
10115[indexterm2 capacity..buffers_adaptor]
10116
10117
10118Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
10119[heading Synopsis]
10120```
10121std::size_t
10122capacity() const;
10123```
10124
10125[heading Description]
10126
10127[endsect]
10128
10129[section:data buffers_adaptor::data]
10130[indexterm2 data..buffers_adaptor]
10131
10132
10133Returns a constant buffer sequence representing the readable bytes.
10134```
10135const_buffers_type
10136``[link beast.ref.boost__beast__buffers_adaptor.data.overload1 data]``() const;
10137  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_adaptor.data.overload1 `more...`]]``
10138```
10139
10140
10141Returns a mutable buffer sequence representing the readable bytes.
10142```
10143mutable_buffers_type
10144``[link beast.ref.boost__beast__buffers_adaptor.data.overload2 data]``();
10145  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_adaptor.data.overload2 `more...`]]``
10146```
10147
10148[section:overload1 buffers_adaptor::data (1 of 2 overloads)]
10149
10150Returns a constant buffer sequence representing the readable bytes.
10151[heading Synopsis]
10152```
10153const_buffers_type
10154data() const;
10155```
10156
10157[heading Description]
10158
10159[endsect]
10160
10161[section:overload2 buffers_adaptor::data (2 of 2 overloads)]
10162
10163Returns a mutable buffer sequence representing the readable bytes.
10164[heading Synopsis]
10165```
10166mutable_buffers_type
10167data();
10168```
10169
10170[heading Description]
10171
10172[endsect]
10173
10174
10175[endsect]
10176
10177[section:cdata buffers_adaptor::cdata]
10178[indexterm2 cdata..buffers_adaptor]
10179
10180
10181Returns a constant buffer sequence representing the readable bytes.
10182[heading Synopsis]
10183```
10184const_buffers_type
10185cdata() const;
10186```
10187
10188[heading Description]
10189
10190[endsect]
10191
10192[section:prepare buffers_adaptor::prepare]
10193[indexterm2 prepare..buffers_adaptor]
10194
10195
10196Returns a mutable buffer sequence representing writable bytes.
10197[heading Synopsis]
10198```
10199mutable_buffers_type
10200prepare(
10201    std::size_t n);
10202```
10203
10204[heading Description]
10205Returns a mutable buffer sequence representing the writable bytes containing exactly `n` bytes of storage. This function does not allocate memory. Instead, the storage comes from the underlying mutable buffer sequence.
10206All buffer sequences previously obtained using [link beast.ref.boost__beast__buffers_adaptor.prepare `prepare`] are invalidated. Buffer sequences previously obtained using [link beast.ref.boost__beast__buffers_adaptor.data `data`] remain valid.
10207
10208[heading Parameters]
10209[table [[Name][Description]]
10210  [
10211    [`n`
10212    ]
10213    [
10214The desired number of bytes in the returned buffer sequence.
10215    ]
10216  ]
10217]
10218[heading Exceptions]
10219[table [[Type][Thrown On]]
10220  [
10221    [`std::length_error`
10222    ]
10223    [
10224if [link beast.ref.boost__beast__buffers_adaptor.size `size()`] + n exceeds [link beast.ref.boost__beast__buffers_adaptor.max_size `max_size()`].
10225    ]
10226  ]
10227]
10228[heading Exception Safety]
10229
10230Strong guarantee.
10231
10232[endsect]
10233
10234[section:commit buffers_adaptor::commit]
10235[indexterm2 commit..buffers_adaptor]
10236
10237
10238Append writable bytes to the readable bytes.
10239[heading Synopsis]
10240```
10241void
10242commit(
10243    std::size_t n);
10244```
10245
10246[heading Description]
10247Appends n bytes from the start of the writable bytes to the end of the readable bytes. The remainder of the writable bytes are discarded. If n is greater than the number of writable bytes, all writable bytes are appended to the readable bytes.
10248All buffer sequences previously obtained using [link beast.ref.boost__beast__buffers_adaptor.prepare `prepare`] are invalidated. Buffer sequences previously obtained using [link beast.ref.boost__beast__buffers_adaptor.data `data`] remain valid.
10249
10250[heading Parameters]
10251[table [[Name][Description]]
10252  [
10253    [`n`
10254    ]
10255    [
10256The number of bytes to append. If this number is greater than the number of writable bytes, all writable bytes are appended.
10257    ]
10258  ]
10259]
10260[heading Exception Safety]
10261
10262No-throw guarantee.
10263
10264[endsect]
10265
10266[section:consume buffers_adaptor::consume]
10267[indexterm2 consume..buffers_adaptor]
10268
10269
10270Remove bytes from beginning of the readable bytes.
10271[heading Synopsis]
10272```
10273void
10274consume(
10275    std::size_t n);
10276```
10277
10278[heading Description]
10279Removes n bytes from the beginning of the readable bytes.
10280All buffers sequences previously obtained using [link beast.ref.boost__beast__buffers_adaptor.data `data`] or [link beast.ref.boost__beast__buffers_adaptor.prepare `prepare`] are invalidated.
10281
10282[heading Parameters]
10283[table [[Name][Description]]
10284  [
10285    [`n`
10286    ]
10287    [
10288The number of bytes to remove. If this number is greater than the number of readable bytes, all readable bytes are removed.
10289    ]
10290  ]
10291]
10292[heading Exception Safety]
10293
10294No-throw guarantee.
10295
10296[endsect]
10297
10298
10299[endsect]
10300
10301[section:boost__beast__buffers_cat_view buffers_cat_view]
10302
10303A buffer sequence representing a concatenation of buffer sequences.
10304[heading Synopsis]
10305Defined in header [include_file boost/beast/core/buffers_cat.hpp]
10306
10307```
10308template<
10309    class... Buffers>
10310class buffers_cat_view
10311```
10312
10313[heading Types]
10314[table [[Name][Description]]
10315  [
10316    [[*[link beast.ref.boost__beast__buffers_cat_view.value_type value_type]]
10317    ]
10318    [
10319
10320The type of buffer returned when dereferencing an iterator.
10321    ]
10322  ]
10323]
10324[heading Member Functions]
10325[table [[Name][Description]]
10326  [
10327    [[*[link beast.ref.boost__beast__buffers_cat_view.begin begin]]
10328    ]
10329    [
10330
10331Returns an iterator to the first buffer in the sequence.
10332    ]
10333  ]
10334  [
10335    [[*[link beast.ref.boost__beast__buffers_cat_view.buffers_cat_view buffers_cat_view]]
10336    ]
10337    [
10338
10339Copy Constructor.
10340
10341Constructor.
10342    ]
10343  ]
10344  [
10345    [[*[link beast.ref.boost__beast__buffers_cat_view.end end]]
10346    ]
10347    [
10348
10349Returns an iterator to one past the last buffer in the sequence.
10350    ]
10351  ]
10352  [
10353    [[*[link beast.ref.boost__beast__buffers_cat_view.operator_eq_ operator=]]
10354    ]
10355    [
10356
10357Copy Assignment.
10358    ]
10359  ]
10360]
10361[heading Description]
10362
10363[heading See Also]
10364[link beast.ref.boost__beast__buffers_cat `buffers_cat`]
10365
10366[section:value_type buffers_cat_view::value_type]
10367[indexterm2 value_type..buffers_cat_view]
10368
10369
10370The type of buffer returned when dereferencing an iterator.
10371[heading Synopsis]
10372```
10373using value_type = ``['see-below]``;
10374```
10375
10376[heading Description]
10377If every buffer sequence in the view is a ['MutableBufferSequence], then `value_type` will be `net::mutable_buffer`. Otherwise, `value_type` will be `net::const_buffer`.
10378
10379[endsect]
10380
10381[section:buffers_cat_view buffers_cat_view::buffers_cat_view]
10382[indexterm2 buffers_cat_view..buffers_cat_view]
10383
10384
10385Copy Constructor.
10386```
10387``[link beast.ref.boost__beast__buffers_cat_view.buffers_cat_view.overload1 buffers_cat_view]``(
10388    buffers_cat_view const&);
10389  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_cat_view.buffers_cat_view.overload1 `more...`]]``
10390```
10391
10392
10393Constructor.
10394```
10395explicit
10396``[link beast.ref.boost__beast__buffers_cat_view.buffers_cat_view.overload2 buffers_cat_view]``(
10397    Buffers const&... buffers);
10398  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_cat_view.buffers_cat_view.overload2 `more...`]]``
10399```
10400
10401[section:overload1 buffers_cat_view::buffers_cat_view (1 of 2 overloads)]
10402
10403Copy Constructor.
10404[heading Synopsis]
10405```
10406buffers_cat_view(
10407    buffers_cat_view const&);
10408```
10409
10410[heading Description]
10411
10412[endsect]
10413
10414[section:overload2 buffers_cat_view::buffers_cat_view (2 of 2 overloads)]
10415
10416Constructor.
10417[heading Synopsis]
10418```
10419buffers_cat_view(
10420    Buffers const&... buffers);
10421```
10422
10423[heading Description]
10424
10425[heading Parameters]
10426[table [[Name][Description]]
10427  [
10428    [`buffers`
10429    ]
10430    [
10431The list of buffer sequences to concatenate. Copies of the arguments will be maintained for the lifetime of the concatenated sequence; however, the ownership of the memory buffers themselves is not transferred.
10432    ]
10433  ]
10434]
10435
10436[endsect]
10437
10438
10439[endsect]
10440
10441[section:operator_eq_ buffers_cat_view::operator=]
10442[indexterm2 operator=..buffers_cat_view]
10443
10444
10445Copy Assignment.
10446[heading Synopsis]
10447```
10448buffers_cat_view&
10449operator=(
10450    buffers_cat_view const&);
10451```
10452
10453[heading Description]
10454
10455[endsect]
10456
10457[section:begin buffers_cat_view::begin]
10458[indexterm2 begin..buffers_cat_view]
10459
10460
10461Returns an iterator to the first buffer in the sequence.
10462[heading Synopsis]
10463```
10464const_iterator
10465begin() const;
10466```
10467
10468[heading Description]
10469
10470[endsect]
10471
10472[section:end buffers_cat_view::end]
10473[indexterm2 end..buffers_cat_view]
10474
10475
10476Returns an iterator to one past the last buffer in the sequence.
10477[heading Synopsis]
10478```
10479const_iterator
10480end() const;
10481```
10482
10483[heading Description]
10484
10485[endsect]
10486
10487
10488[endsect]
10489
10490[section:boost__beast__buffers_prefix_view buffers_prefix_view]
10491
10492A buffer sequence adaptor that shortens the sequence size.
10493[heading Synopsis]
10494Defined in header [include_file boost/beast/core/buffers_prefix.hpp]
10495
10496```
10497template<
10498    class __BufferSequence__>
10499class buffers_prefix_view
10500```
10501
10502[heading Types]
10503[table [[Name][Description]]
10504  [
10505    [[*[link beast.ref.boost__beast__buffers_prefix_view.const_iterator const_iterator]]
10506    ]
10507    [
10508
10509A bidirectional iterator type that may be used to read elements.
10510    ]
10511  ]
10512  [
10513    [[*[link beast.ref.boost__beast__buffers_prefix_view.value_type value_type]]
10514    ]
10515    [
10516
10517The type for each element in the list of buffers.
10518    ]
10519  ]
10520]
10521[heading Member Functions]
10522[table [[Name][Description]]
10523  [
10524    [[*[link beast.ref.boost__beast__buffers_prefix_view.begin begin]]
10525    ]
10526    [
10527
10528Returns an iterator to the first buffer in the sequence.
10529    ]
10530  ]
10531  [
10532    [[*[link beast.ref.boost__beast__buffers_prefix_view.buffers_prefix_view buffers_prefix_view]]
10533    ]
10534    [
10535
10536Copy Constructor.
10537
10538Construct a buffer sequence prefix.
10539
10540Construct a buffer sequence prefix in-place.
10541    ]
10542  ]
10543  [
10544    [[*[link beast.ref.boost__beast__buffers_prefix_view.end end]]
10545    ]
10546    [
10547
10548Returns an iterator to one past the last buffer in the sequence.
10549    ]
10550  ]
10551  [
10552    [[*[link beast.ref.boost__beast__buffers_prefix_view.operator_eq_ operator=]]
10553    ]
10554    [
10555
10556Copy Assignment.
10557    ]
10558  ]
10559]
10560[heading Description]
10561The class adapts a buffer sequence to efficiently represent a shorter subset of the original list of buffers starting with the first byte of the original sequence.
10562
10563[heading Template Parameters]
10564[table [[Type][Description]]
10565  [
10566    [`BufferSequence`
10567    ]
10568    [
10569The buffer sequence to adapt.
10570    ]
10571  ]
10572]
10573
10574[section:value_type buffers_prefix_view::value_type]
10575[indexterm2 value_type..buffers_prefix_view]
10576
10577
10578The type for each element in the list of buffers.
10579[heading Synopsis]
10580```
10581using value_type = ``['see-below]``;
10582```
10583
10584[heading Description]
10585If the type `BufferSequence` meets the requirements of ['MutableBufferSequence], then `value_type` is `net::mutable_buffer`. Otherwise, `value_type` is `net::const_buffer`.
10586
10587[heading See Also]
10588[link beast.ref.boost__beast__buffers_type `buffers_type`]
10589
10590[endsect]
10591
10592[section:const_iterator buffers_prefix_view::const_iterator]
10593[indexterm2 const_iterator..buffers_prefix_view]
10594
10595
10596A bidirectional iterator type that may be used to read elements.
10597[heading Synopsis]
10598```
10599using const_iterator = ``['implementation-defined]``;
10600```
10601
10602[heading Description]
10603
10604[endsect]
10605
10606[section:buffers_prefix_view buffers_prefix_view::buffers_prefix_view]
10607[indexterm2 buffers_prefix_view..buffers_prefix_view]
10608
10609
10610Copy Constructor.
10611```
10612``[link beast.ref.boost__beast__buffers_prefix_view.buffers_prefix_view.overload1 buffers_prefix_view]``(
10613    buffers_prefix_view const&);
10614  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_prefix_view.buffers_prefix_view.overload1 `more...`]]``
10615```
10616
10617
10618Construct a buffer sequence prefix.
10619```
10620``[link beast.ref.boost__beast__buffers_prefix_view.buffers_prefix_view.overload2 buffers_prefix_view]``(
10621    std::size_t size,
10622    BufferSequence const& buffers);
10623  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_prefix_view.buffers_prefix_view.overload2 `more...`]]``
10624```
10625
10626
10627Construct a buffer sequence prefix in-place.
10628```
10629template<
10630    class... Args>
10631``[link beast.ref.boost__beast__buffers_prefix_view.buffers_prefix_view.overload3 buffers_prefix_view]``(
10632    std::size_t size,
10633    boost::in_place_init_t,
10634    Args&&... args);
10635  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_prefix_view.buffers_prefix_view.overload3 `more...`]]``
10636```
10637
10638[section:overload1 buffers_prefix_view::buffers_prefix_view (1 of 3 overloads)]
10639
10640Copy Constructor.
10641[heading Synopsis]
10642```
10643buffers_prefix_view(
10644    buffers_prefix_view const&);
10645```
10646
10647[heading Description]
10648
10649[endsect]
10650
10651[section:overload2 buffers_prefix_view::buffers_prefix_view (2 of 3 overloads)]
10652
10653Construct a buffer sequence prefix.
10654[heading Synopsis]
10655```
10656buffers_prefix_view(
10657    std::size_t size,
10658    BufferSequence const& buffers);
10659```
10660
10661[heading Description]
10662
10663[heading Parameters]
10664[table [[Name][Description]]
10665  [
10666    [`size`
10667    ]
10668    [
10669The maximum number of bytes in the prefix. If this is larger than the size of passed buffers, the resulting sequence will represent the entire input sequence.
10670    ]
10671  ]
10672  [
10673    [`buffers`
10674    ]
10675    [
10676The buffer sequence to adapt. A copy of the sequence will be made, but ownership of the underlying memory is not transferred. The copy is maintained for the lifetime of the view.
10677    ]
10678  ]
10679]
10680
10681[endsect]
10682
10683[section:overload3 buffers_prefix_view::buffers_prefix_view (3 of 3 overloads)]
10684
10685Construct a buffer sequence prefix in-place.
10686[heading Synopsis]
10687```
10688template<
10689    class... Args>
10690buffers_prefix_view(
10691    std::size_t size,
10692    boost::in_place_init_t,
10693    Args&&... args);
10694```
10695
10696[heading Description]
10697
10698[heading Parameters]
10699[table [[Name][Description]]
10700  [
10701    [`size`
10702    ]
10703    [
10704The maximum number of bytes in the prefix. If this is larger than the size of passed buffers, the resulting sequence will represent the entire input sequence.
10705    ]
10706  ]
10707  [
10708    [`args`
10709    ]
10710    [
10711Arguments forwarded to the contained buffer's constructor.
10712    ]
10713  ]
10714]
10715
10716[endsect]
10717
10718
10719[endsect]
10720
10721[section:operator_eq_ buffers_prefix_view::operator=]
10722[indexterm2 operator=..buffers_prefix_view]
10723
10724
10725Copy Assignment.
10726[heading Synopsis]
10727```
10728buffers_prefix_view&
10729operator=(
10730    buffers_prefix_view const&);
10731```
10732
10733[heading Description]
10734
10735[endsect]
10736
10737[section:begin buffers_prefix_view::begin]
10738[indexterm2 begin..buffers_prefix_view]
10739
10740
10741Returns an iterator to the first buffer in the sequence.
10742[heading Synopsis]
10743```
10744const_iterator
10745begin() const;
10746```
10747
10748[heading Description]
10749
10750[endsect]
10751
10752[section:end buffers_prefix_view::end]
10753[indexterm2 end..buffers_prefix_view]
10754
10755
10756Returns an iterator to one past the last buffer in the sequence.
10757[heading Synopsis]
10758```
10759const_iterator
10760end() const;
10761```
10762
10763[heading Description]
10764
10765[endsect]
10766
10767
10768[endsect]
10769
10770[section:boost__beast__buffers_suffix buffers_suffix]
10771
10772Adaptor to progressively trim the front of a ['BufferSequence].
10773[heading Synopsis]
10774Defined in header [include_file boost/beast/core/buffers_suffix.hpp]
10775
10776```
10777template<
10778    class __BufferSequence__>
10779class buffers_suffix
10780```
10781
10782[heading Types]
10783[table [[Name][Description]]
10784  [
10785    [[*[link beast.ref.boost__beast__buffers_suffix.const_iterator const_iterator]]
10786    ]
10787    [
10788
10789A bidirectional iterator type that may be used to read elements.
10790    ]
10791  ]
10792  [
10793    [[*[link beast.ref.boost__beast__buffers_suffix.value_type value_type]]
10794    ]
10795    [
10796
10797The type for each element in the list of buffers.
10798    ]
10799  ]
10800]
10801[heading Member Functions]
10802[table [[Name][Description]]
10803  [
10804    [[*[link beast.ref.boost__beast__buffers_suffix.begin begin]]
10805    ]
10806    [
10807
10808Get a bidirectional iterator to the first element.
10809    ]
10810  ]
10811  [
10812    [[*[link beast.ref.boost__beast__buffers_suffix.buffers_suffix buffers_suffix]]
10813    ]
10814    [
10815
10816Constructor.
10817
10818Copy Constructor.
10819    ]
10820  ]
10821  [
10822    [[*[link beast.ref.boost__beast__buffers_suffix.consume consume]]
10823    ]
10824    [
10825
10826Remove bytes from the beginning of the sequence.
10827    ]
10828  ]
10829  [
10830    [[*[link beast.ref.boost__beast__buffers_suffix.end end]]
10831    ]
10832    [
10833
10834Get a bidirectional iterator to one past the last element.
10835    ]
10836  ]
10837  [
10838    [[*[link beast.ref.boost__beast__buffers_suffix.operator_eq_ operator=]]
10839    ]
10840    [
10841
10842Copy Assignment.
10843    ]
10844  ]
10845]
10846[heading Description]
10847This adaptor wraps a buffer sequence to create a new sequence which may be incrementally consumed. Bytes consumed are removed from the front of the buffer. The underlying memory is not changed, instead the adaptor efficiently iterates through a subset of the buffers wrapped.
10848The wrapped buffer is not modified, a copy is made instead. Ownership of the underlying memory is not transferred, the application is still responsible for managing its lifetime.
10849
10850[heading Template Parameters]
10851[table [[Type][Description]]
10852  [
10853    [`BufferSequence`
10854    ]
10855    [
10856The buffer sequence to wrap.
10857    ]
10858  ]
10859]
10860[heading Example]
10861
10862This function writes the entire contents of a buffer sequence to the specified stream.
10863
10864```
10865template<class SyncWriteStream, class ConstBufferSequence>
10866void send(SyncWriteStream& stream, ConstBufferSequence const& buffers)
10867{
10868    buffers_suffix<ConstBufferSequence> bs{buffers};
10869    while(buffer_bytes(bs) > 0)
10870        bs.consume(stream.write_some(bs));
10871}
10872```
10873
10874
10875[section:value_type buffers_suffix::value_type]
10876[indexterm2 value_type..buffers_suffix]
10877
10878
10879The type for each element in the list of buffers.
10880[heading Synopsis]
10881```
10882using value_type = ``['see-below]``;
10883```
10884
10885[heading Description]
10886If ['BufferSequence] meets the requirements of ['MutableBufferSequence], then this type will be `net::mutable_buffer`, otherwise this type will be `net::const_buffer`.
10887
10888[endsect]
10889
10890[section:const_iterator buffers_suffix::const_iterator]
10891[indexterm2 const_iterator..buffers_suffix]
10892
10893
10894A bidirectional iterator type that may be used to read elements.
10895[heading Synopsis]
10896```
10897using const_iterator = ``['implementation-defined]``;
10898```
10899
10900[heading Description]
10901
10902[endsect]
10903
10904[section:buffers_suffix buffers_suffix::buffers_suffix]
10905[indexterm2 buffers_suffix..buffers_suffix]
10906
10907
10908Constructor.
10909```
10910``[link beast.ref.boost__beast__buffers_suffix.buffers_suffix.overload1 buffers_suffix]``();
10911  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_suffix.buffers_suffix.overload1 `more...`]]``
10912
10913explicit
10914``[link beast.ref.boost__beast__buffers_suffix.buffers_suffix.overload3 buffers_suffix]``(
10915    BufferSequence const& buffers);
10916  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_suffix.buffers_suffix.overload3 `more...`]]``
10917
10918template<
10919    class... Args>
10920explicit
10921``[link beast.ref.boost__beast__buffers_suffix.buffers_suffix.overload4 buffers_suffix]``(
10922    boost::in_place_init_t,
10923    Args&&... args);
10924  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_suffix.buffers_suffix.overload4 `more...`]]``
10925```
10926
10927
10928Copy Constructor.
10929```
10930``[link beast.ref.boost__beast__buffers_suffix.buffers_suffix.overload2 buffers_suffix]``(
10931    buffers_suffix const&);
10932  ``[''''&raquo;''' [link beast.ref.boost__beast__buffers_suffix.buffers_suffix.overload2 `more...`]]``
10933```
10934
10935[section:overload1 buffers_suffix::buffers_suffix (1 of 4 overloads)]
10936
10937Constructor.
10938[heading Synopsis]
10939```
10940buffers_suffix();
10941```
10942
10943[heading Description]
10944
10945[endsect]
10946
10947[section:overload2 buffers_suffix::buffers_suffix (2 of 4 overloads)]
10948
10949Copy Constructor.
10950[heading Synopsis]
10951```
10952buffers_suffix(
10953    buffers_suffix const&);
10954```
10955
10956[heading Description]
10957
10958[endsect]
10959
10960[section:overload3 buffers_suffix::buffers_suffix (3 of 4 overloads)]
10961
10962Constructor.
10963[heading Synopsis]
10964```
10965buffers_suffix(
10966    BufferSequence const& buffers);
10967```
10968
10969[heading Description]
10970A copy of the buffer sequence is made. Ownership of the underlying memory is not transferred or copied.
10971
10972[endsect]
10973
10974[section:overload4 buffers_suffix::buffers_suffix (4 of 4 overloads)]
10975
10976Constructor.
10977[heading Synopsis]
10978```
10979template<
10980    class... Args>
10981buffers_suffix(
10982    boost::in_place_init_t,
10983    Args&&... args);
10984```
10985
10986[heading Description]
10987This constructs the buffer sequence in-place from a list of arguments.
10988
10989[heading Parameters]
10990[table [[Name][Description]]
10991  [
10992    [`args`
10993    ]
10994    [
10995Arguments forwarded to the buffers constructor.
10996    ]
10997  ]
10998]
10999
11000[endsect]
11001
11002
11003[endsect]
11004
11005[section:operator_eq_ buffers_suffix::operator=]
11006[indexterm2 operator=..buffers_suffix]
11007
11008
11009Copy Assignment.
11010[heading Synopsis]
11011```
11012buffers_suffix&
11013operator=(
11014    buffers_suffix const&);
11015```
11016
11017[heading Description]
11018
11019[endsect]
11020
11021[section:begin buffers_suffix::begin]
11022[indexterm2 begin..buffers_suffix]
11023
11024
11025Get a bidirectional iterator to the first element.
11026[heading Synopsis]
11027```
11028const_iterator
11029begin() const;
11030```
11031
11032[heading Description]
11033
11034[endsect]
11035
11036[section:end buffers_suffix::end]
11037[indexterm2 end..buffers_suffix]
11038
11039
11040Get a bidirectional iterator to one past the last element.
11041[heading Synopsis]
11042```
11043const_iterator
11044end() const;
11045```
11046
11047[heading Description]
11048
11049[endsect]
11050
11051[section:consume buffers_suffix::consume]
11052[indexterm2 consume..buffers_suffix]
11053
11054
11055Remove bytes from the beginning of the sequence.
11056[heading Synopsis]
11057```
11058void
11059consume(
11060    std::size_t amount);
11061```
11062
11063[heading Description]
11064
11065[heading Parameters]
11066[table [[Name][Description]]
11067  [
11068    [`amount`
11069    ]
11070    [
11071The number of bytes to remove. If this is larger than the number of bytes remaining, all the bytes remaining are removed.
11072    ]
11073  ]
11074]
11075
11076[endsect]
11077
11078
11079[endsect]
11080
11081[section:boost__beast__http__chunk_body http::chunk_body]
11082
11083A ['chunk].
11084[heading Synopsis]
11085Defined in header [include_file boost/beast/http/chunk_encode.hpp]
11086
11087```
11088template<
11089    class __ConstBufferSequence__>
11090class chunk_body
11091```
11092
11093[heading Types]
11094[table [[Name][Description]]
11095  [
11096    [[*[link beast.ref.boost__beast__http__chunk_body.const_iterator const_iterator]]
11097    ]
11098    [
11099
11100Required for ['ConstBufferSequence]
11101    ]
11102  ]
11103  [
11104    [[*[link beast.ref.boost__beast__http__chunk_body.value_type value_type]]
11105    ]
11106    [
11107
11108Required for ['ConstBufferSequence]
11109    ]
11110  ]
11111]
11112[heading Member Functions]
11113[table [[Name][Description]]
11114  [
11115    [[*[link beast.ref.boost__beast__http__chunk_body.begin begin]]
11116    ]
11117    [
11118
11119Required for ['ConstBufferSequence]
11120    ]
11121  ]
11122  [
11123    [[*[link beast.ref.boost__beast__http__chunk_body.chunk_body chunk_body]]
11124    ]
11125    [
11126
11127Constructor.
11128    ]
11129  ]
11130  [
11131    [[*[link beast.ref.boost__beast__http__chunk_body.end end]]
11132    ]
11133    [
11134
11135Required for ['ConstBufferSequence]
11136    ]
11137  ]
11138]
11139[heading Description]
11140
11141This implements a ['ConstBufferSequence] representing a ['chunk]. The serialized format is as follows:
11142```
11143chunk           = chunk-size [ chunk-ext ] CRLF chunk-data CRLF
11144chunk-size      = 1*HEXDIG
11145chunk-ext       = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
11146chunk-ext-name  = token
11147chunk-ext-val   = token / quoted-string
11148chunk-data      = 1*OCTET ; a sequence of chunk-size octets
11149```
11150
11151The chunk extension is optional.
11152To use this class, pass an instance of it to a stream algorithm as the buffer sequence.
11153
11154[heading See Also]
11155[@https://tools.ietf.org/html/rfc7230#section-4.1 https://tools.ietf.org/html/rfc7230#section-4.1]
11156
11157[section:value_type http::chunk_body::value_type]
11158[indexterm2 value_type..http::chunk_body]
11159
11160
11161Required for ['ConstBufferSequence]
11162[heading Synopsis]
11163```
11164using value_type = ``['implementation-defined]``;
11165```
11166
11167[heading Description]
11168
11169[endsect]
11170
11171[section:const_iterator http::chunk_body::const_iterator]
11172[indexterm2 const_iterator..http::chunk_body]
11173
11174
11175Required for ['ConstBufferSequence]
11176[heading Synopsis]
11177```
11178using const_iterator = ``['implementation-defined]``;
11179```
11180
11181[heading Description]
11182
11183[endsect]
11184
11185[section:chunk_body http::chunk_body::chunk_body]
11186[indexterm2 chunk_body..http::chunk_body]
11187
11188
11189Constructor.
11190```
11191explicit
11192``[link beast.ref.boost__beast__http__chunk_body.chunk_body.overload1 chunk_body]``(
11193    ConstBufferSequence const& buffers);
11194  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_body.chunk_body.overload1 `more...`]]``
11195
11196``[link beast.ref.boost__beast__http__chunk_body.chunk_body.overload2 chunk_body]``(
11197    ConstBufferSequence const& buffers,
11198    string_view extensions);
11199  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_body.chunk_body.overload2 `more...`]]``
11200
11201template<
11202    class ChunkExtensions>
11203``[link beast.ref.boost__beast__http__chunk_body.chunk_body.overload3 chunk_body]``(
11204    ConstBufferSequence const& buffers,
11205    ChunkExtensions&& extensions);
11206  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_body.chunk_body.overload3 `more...`]]``
11207
11208template<
11209    class ChunkExtensions,
11210    class __Allocator__>
11211``[link beast.ref.boost__beast__http__chunk_body.chunk_body.overload4 chunk_body]``(
11212    ConstBufferSequence const& buffers,
11213    ChunkExtensions&& extensions,
11214    Allocator const& allocator);
11215  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_body.chunk_body.overload4 `more...`]]``
11216```
11217
11218[section:overload1 http::chunk_body::chunk_body (1 of 4 overloads)]
11219
11220Constructor.
11221[heading Synopsis]
11222```
11223chunk_body(
11224    ConstBufferSequence const& buffers);
11225```
11226
11227[heading Description]
11228This constructs buffers representing a complete ['chunk] with no chunk extensions and having the size and contents of the specified buffer sequence.
11229
11230[heading Parameters]
11231[table [[Name][Description]]
11232  [
11233    [`buffers`
11234    ]
11235    [
11236A buffer sequence representing the chunk body. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid while this object is in use.
11237    ]
11238  ]
11239]
11240[heading See Also]
11241[@https://tools.ietf.org/html/rfc7230#section-4.1 https://tools.ietf.org/html/rfc7230#section-4.1]
11242
11243[endsect]
11244
11245[section:overload2 http::chunk_body::chunk_body (2 of 4 overloads)]
11246
11247Constructor.
11248[heading Synopsis]
11249```
11250chunk_body(
11251    ConstBufferSequence const& buffers,
11252    string_view extensions);
11253```
11254
11255[heading Description]
11256This constructs buffers representing a complete ['chunk] with the passed chunk extensions and having the size and contents of the specified buffer sequence.
11257
11258[heading Parameters]
11259[table [[Name][Description]]
11260  [
11261    [`buffers`
11262    ]
11263    [
11264A buffer sequence representing the chunk body. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid while this object is in use.
11265    ]
11266  ]
11267  [
11268    [`extensions`
11269    ]
11270    [
11271
11272The chunk extensions string. This string must be formatted correctly as per rfc7230, using this BNF syntax:
11273```
11274chunk-ext       = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
11275chunk-ext-name  = token
11276chunk-ext-val   = token / quoted-string
11277```
11278
11279The data pointed to by this string view must remain valid for the lifetime of any operations performed on the object.
11280    ]
11281  ]
11282]
11283[heading See Also]
11284[@https://tools.ietf.org/html/rfc7230#section-4.1.1 https://tools.ietf.org/html/rfc7230#section-4.1.1]
11285
11286[endsect]
11287
11288[section:overload3 http::chunk_body::chunk_body (3 of 4 overloads)]
11289
11290Constructor.
11291[heading Synopsis]
11292```
11293template<
11294    class ChunkExtensions>
11295chunk_body(
11296    ConstBufferSequence const& buffers,
11297    ChunkExtensions&& extensions);
11298```
11299
11300[heading Description]
11301This constructs buffers representing a complete ['chunk] with the passed chunk extensions and having the size and contents of the specified buffer sequence. The default allocator is used to provide storage for the extensions object.
11302
11303[heading Parameters]
11304[table [[Name][Description]]
11305  [
11306    [`buffers`
11307    ]
11308    [
11309A buffer sequence representing the chunk body. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid while this object is in use.
11310    ]
11311  ]
11312  [
11313    [`extensions`
11314    ]
11315    [
11316The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must be convertible to [link beast.ref.boost__beast__string_view `string_view`]. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object.
11317    ]
11318  ]
11319]
11320[heading Remarks]
11321This function participates in overload resolution only if [*ChunkExtensions] meets the requirements stated above.
11322[heading See Also]
11323[@https://tools.ietf.org/html/rfc7230#section-4.1 https://tools.ietf.org/html/rfc7230#section-4.1]
11324
11325[endsect]
11326
11327[section:overload4 http::chunk_body::chunk_body (4 of 4 overloads)]
11328
11329Constructor.
11330[heading Synopsis]
11331```
11332template<
11333    class ChunkExtensions,
11334    class __Allocator__>
11335chunk_body(
11336    ConstBufferSequence const& buffers,
11337    ChunkExtensions&& extensions,
11338    Allocator const& allocator);
11339```
11340
11341[heading Description]
11342This constructs buffers representing a complete ['chunk] with the passed chunk extensions and having the size and contents of the specified buffer sequence. The specified allocator is used to provide storage for the extensions object.
11343
11344[heading Parameters]
11345[table [[Name][Description]]
11346  [
11347    [`buffers`
11348    ]
11349    [
11350A buffer sequence representing the chunk body. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid while this object is in use.
11351    ]
11352  ]
11353  [
11354    [`extensions`
11355    ]
11356    [
11357The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must be convertible to [link beast.ref.boost__beast__string_view `string_view`]. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object.
11358    ]
11359  ]
11360  [
11361    [`allocator`
11362    ]
11363    [
11364The allocator to provide storage for the moved or copied extensions object.
11365    ]
11366  ]
11367]
11368[heading Remarks]
11369This function participates in overload resolution only if [*ChunkExtensions] meets the requirements stated above.
11370[heading See Also]
11371[@https://tools.ietf.org/html/rfc7230#section-4.1 https://tools.ietf.org/html/rfc7230#section-4.1]
11372
11373[endsect]
11374
11375
11376[endsect]
11377
11378[section:begin http::chunk_body::begin]
11379[indexterm2 begin..http::chunk_body]
11380
11381
11382Required for ['ConstBufferSequence]
11383[heading Synopsis]
11384```
11385const_iterator
11386begin() const;
11387```
11388
11389[heading Description]
11390
11391[endsect]
11392
11393[section:end http::chunk_body::end]
11394[indexterm2 end..http::chunk_body]
11395
11396
11397Required for ['ConstBufferSequence]
11398[heading Synopsis]
11399```
11400const_iterator
11401end() const;
11402```
11403
11404[heading Description]
11405
11406[endsect]
11407
11408
11409[endsect]
11410
11411[section:boost__beast__http__chunk_crlf http::chunk_crlf]
11412
11413A chunked encoding crlf.
11414[heading Synopsis]
11415Defined in header [include_file boost/beast/http/chunk_encode.hpp]
11416
11417```
11418struct chunk_crlf
11419```
11420
11421[heading Types]
11422[table [[Name][Description]]
11423  [
11424    [[*[link beast.ref.boost__beast__http__chunk_crlf.const_iterator const_iterator]]
11425    ]
11426    [
11427
11428Required for ['ConstBufferSequence]
11429    ]
11430  ]
11431  [
11432    [[*[link beast.ref.boost__beast__http__chunk_crlf.value_type value_type]]
11433    ]
11434    [
11435
11436Required for ['ConstBufferSequence]
11437    ]
11438  ]
11439]
11440[heading Member Functions]
11441[table [[Name][Description]]
11442  [
11443    [[*[link beast.ref.boost__beast__http__chunk_crlf.begin begin]]
11444    ]
11445    [
11446
11447Required for ['ConstBufferSequence]
11448    ]
11449  ]
11450  [
11451    [[*[link beast.ref.boost__beast__http__chunk_crlf.chunk_crlf chunk_crlf]]
11452    ]
11453    [
11454
11455Constructor.
11456
11457Required for ['ConstBufferSequence]
11458    ]
11459  ]
11460  [
11461    [[*[link beast.ref.boost__beast__http__chunk_crlf.end end]]
11462    ]
11463    [
11464
11465Required for ['ConstBufferSequence]
11466    ]
11467  ]
11468]
11469[heading Description]
11470This implements a ['ConstBufferSequence] holding the CRLF (`"\r\n"`) used as a delimiter in a ['chunk].
11471
11472To use this class, pass an instance of it to a stream algorithm as the buffer sequence:
11473```
11474// writes "\r\n"
11475net::write(stream, chunk_crlf{});
11476```
11477
11478
11479[heading See Also]
11480[@https://tools.ietf.org/html/rfc7230#section-4.1 https://tools.ietf.org/html/rfc7230#section-4.1]
11481
11482[section:value_type http::chunk_crlf::value_type]
11483[indexterm2 value_type..http::chunk_crlf]
11484
11485
11486Required for ['ConstBufferSequence]
11487[heading Synopsis]
11488```
11489using value_type = ``['implementation-defined]``;
11490```
11491
11492[heading Description]
11493
11494[endsect]
11495
11496[section:const_iterator http::chunk_crlf::const_iterator]
11497[indexterm2 const_iterator..http::chunk_crlf]
11498
11499
11500Required for ['ConstBufferSequence]
11501[heading Synopsis]
11502```
11503using const_iterator = value_type const*;
11504```
11505
11506[heading Description]
11507
11508[endsect]
11509
11510[section:chunk_crlf http::chunk_crlf::chunk_crlf]
11511[indexterm2 chunk_crlf..http::chunk_crlf]
11512
11513
11514Constructor.
11515```
11516``[link beast.ref.boost__beast__http__chunk_crlf.chunk_crlf.overload1 chunk_crlf]``();
11517  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_crlf.chunk_crlf.overload1 `more...`]]``
11518```
11519
11520
11521Required for ['ConstBufferSequence]
11522```
11523``[link beast.ref.boost__beast__http__chunk_crlf.chunk_crlf.overload2 chunk_crlf]``(
11524    chunk_crlf const&);
11525  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_crlf.chunk_crlf.overload2 `more...`]]``
11526```
11527
11528[section:overload1 http::chunk_crlf::chunk_crlf (1 of 2 overloads)]
11529
11530Constructor.
11531[heading Synopsis]
11532```
11533chunk_crlf();
11534```
11535
11536[heading Description]
11537
11538[endsect]
11539
11540[section:overload2 http::chunk_crlf::chunk_crlf (2 of 2 overloads)]
11541
11542Required for ['ConstBufferSequence]
11543[heading Synopsis]
11544```
11545chunk_crlf(
11546    chunk_crlf const&);
11547```
11548
11549[heading Description]
11550
11551[endsect]
11552
11553
11554[endsect]
11555
11556[section:begin http::chunk_crlf::begin]
11557[indexterm2 begin..http::chunk_crlf]
11558
11559
11560Required for ['ConstBufferSequence]
11561[heading Synopsis]
11562```
11563const_iterator
11564begin() const;
11565```
11566
11567[heading Description]
11568
11569[endsect]
11570
11571[section:end http::chunk_crlf::end]
11572[indexterm2 end..http::chunk_crlf]
11573
11574
11575Required for ['ConstBufferSequence]
11576[heading Synopsis]
11577```
11578const_iterator
11579end() const;
11580```
11581
11582[heading Description]
11583
11584[endsect]
11585
11586
11587[endsect]
11588
11589[section:boost__beast__http__chunk_header http::chunk_header]
11590
11591A ['chunk] header.
11592[heading Synopsis]
11593Defined in header [include_file boost/beast/http/chunk_encode.hpp]
11594
11595```
11596class chunk_header
11597```
11598
11599[heading Types]
11600[table [[Name][Description]]
11601  [
11602    [[*[link beast.ref.boost__beast__http__chunk_header.const_iterator const_iterator]]
11603    ]
11604    [
11605
11606Required for ['ConstBufferSequence]
11607    ]
11608  ]
11609  [
11610    [[*[link beast.ref.boost__beast__http__chunk_header.value_type value_type]]
11611    ]
11612    [
11613
11614Required for ['ConstBufferSequence]
11615    ]
11616  ]
11617]
11618[heading Member Functions]
11619[table [[Name][Description]]
11620  [
11621    [[*[link beast.ref.boost__beast__http__chunk_header.begin begin]]
11622    ]
11623    [
11624
11625Required for ['ConstBufferSequence]
11626    ]
11627  ]
11628  [
11629    [[*[link beast.ref.boost__beast__http__chunk_header.chunk_header chunk_header]]
11630    ]
11631    [
11632
11633Constructor.
11634
11635Required for ['ConstBufferSequence]
11636    ]
11637  ]
11638  [
11639    [[*[link beast.ref.boost__beast__http__chunk_header.end end]]
11640    ]
11641    [
11642
11643Required for ['ConstBufferSequence]
11644    ]
11645  ]
11646]
11647[heading Description]
11648
11649This implements a ['ConstBufferSequence] representing the header of a ['chunk]. The serialized format is as follows:
11650```
11651chunk-header    = 1*HEXDIG chunk-ext CRLF
11652chunk-ext       = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
11653chunk-ext-name  = token
11654chunk-ext-val   = token / quoted-string
11655```
11656
11657The chunk extension is optional. After the header and chunk body have been serialized, it is the callers responsibility to also serialize the final CRLF (`"\r\n"`).
11658This class allows the caller to emit piecewise chunk bodies, by first serializing the chunk header using this class and then serializing the chunk body in a series of one or more calls to a stream write operation.
11659
11660To use this class, pass an instance of it to a stream algorithm as the buffer sequence:
11661```
11662// writes "400;x\r\n"
11663net::write(stream, chunk_header{1024, "x"});
11664```
11665
11666
11667[heading See Also]
11668[@https://tools.ietf.org/html/rfc7230#section-4.1 https://tools.ietf.org/html/rfc7230#section-4.1]
11669
11670[section:value_type http::chunk_header::value_type]
11671[indexterm2 value_type..http::chunk_header]
11672
11673
11674Required for ['ConstBufferSequence]
11675[heading Synopsis]
11676```
11677using value_type = ``['implementation-defined]``;
11678```
11679
11680[heading Description]
11681
11682[endsect]
11683
11684[section:const_iterator http::chunk_header::const_iterator]
11685[indexterm2 const_iterator..http::chunk_header]
11686
11687
11688Required for ['ConstBufferSequence]
11689[heading Synopsis]
11690```
11691using const_iterator = ``['implementation-defined]``;
11692```
11693
11694[heading Description]
11695
11696[endsect]
11697
11698[section:chunk_header http::chunk_header::chunk_header]
11699[indexterm2 chunk_header..http::chunk_header]
11700
11701
11702Constructor.
11703```
11704explicit
11705``[link beast.ref.boost__beast__http__chunk_header.chunk_header.overload1 chunk_header]``(
11706    std::size_t size);
11707  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_header.chunk_header.overload1 `more...`]]``
11708
11709``[link beast.ref.boost__beast__http__chunk_header.chunk_header.overload2 chunk_header]``(
11710    std::size_t size,
11711    string_view extensions);
11712  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_header.chunk_header.overload2 `more...`]]``
11713
11714template<
11715    class ChunkExtensions>
11716``[link beast.ref.boost__beast__http__chunk_header.chunk_header.overload3 chunk_header]``(
11717    std::size_t size,
11718    ChunkExtensions&& extensions);
11719  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_header.chunk_header.overload3 `more...`]]``
11720
11721template<
11722    class ChunkExtensions,
11723    class __Allocator__>
11724``[link beast.ref.boost__beast__http__chunk_header.chunk_header.overload4 chunk_header]``(
11725    std::size_t size,
11726    ChunkExtensions&& extensions,
11727    Allocator const& allocator);
11728  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_header.chunk_header.overload4 `more...`]]``
11729```
11730
11731
11732Required for ['ConstBufferSequence]
11733```
11734``[link beast.ref.boost__beast__http__chunk_header.chunk_header.overload5 chunk_header]``(
11735    chunk_header const&);
11736  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_header.chunk_header.overload5 `more...`]]``
11737```
11738
11739[section:overload1 http::chunk_header::chunk_header (1 of 5 overloads)]
11740
11741Constructor.
11742[heading Synopsis]
11743```
11744chunk_header(
11745    std::size_t size);
11746```
11747
11748[heading Description]
11749This constructs a buffer sequence representing a ['chunked-body] size and terminating CRLF (`"\r\n"`) with no chunk extensions.
11750
11751[heading Parameters]
11752[table [[Name][Description]]
11753  [
11754    [`size`
11755    ]
11756    [
11757The size of the chunk body that follows. The value must be greater than zero.
11758    ]
11759  ]
11760]
11761[heading See Also]
11762[@https://tools.ietf.org/html/rfc7230#section-4.1 https://tools.ietf.org/html/rfc7230#section-4.1]
11763
11764[endsect]
11765
11766[section:overload2 http::chunk_header::chunk_header (2 of 5 overloads)]
11767
11768Constructor.
11769[heading Synopsis]
11770```
11771chunk_header(
11772    std::size_t size,
11773    string_view extensions);
11774```
11775
11776[heading Description]
11777This constructs a buffer sequence representing a ['chunked-body] size and terminating CRLF (`"\r\n"`) with provided chunk extensions.
11778
11779[heading Parameters]
11780[table [[Name][Description]]
11781  [
11782    [`size`
11783    ]
11784    [
11785The size of the chunk body that follows. The value must be greater than zero.
11786    ]
11787  ]
11788  [
11789    [`extensions`
11790    ]
11791    [
11792
11793The chunk extensions string. This string must be formatted correctly as per rfc7230, using this BNF syntax:
11794```
11795chunk-ext       = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
11796chunk-ext-name  = token
11797chunk-ext-val   = token / quoted-string
11798```
11799
11800The data pointed to by this string view must remain valid for the lifetime of any operations performed on the object.
11801    ]
11802  ]
11803]
11804[heading See Also]
11805[@https://tools.ietf.org/html/rfc7230#section-4.1.1 https://tools.ietf.org/html/rfc7230#section-4.1.1]
11806
11807[endsect]
11808
11809[section:overload3 http::chunk_header::chunk_header (3 of 5 overloads)]
11810
11811Constructor.
11812[heading Synopsis]
11813```
11814template<
11815    class ChunkExtensions>
11816chunk_header(
11817    std::size_t size,
11818    ChunkExtensions&& extensions);
11819```
11820
11821[heading Description]
11822This constructs a buffer sequence representing a ['chunked-body] size and terminating CRLF (`"\r\n"`) with provided chunk extensions. The default allocator is used to provide storage for the extensions object.
11823
11824[heading Parameters]
11825[table [[Name][Description]]
11826  [
11827    [`size`
11828    ]
11829    [
11830The size of the chunk body that follows. The value must be greater than zero.
11831    ]
11832  ]
11833  [
11834    [`extensions`
11835    ]
11836    [
11837The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must be convertible to [link beast.ref.boost__beast__string_view `string_view`]. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object.
11838    ]
11839  ]
11840]
11841[heading Remarks]
11842This function participates in overload resolution only if [*ChunkExtensions] meets the requirements stated above.
11843[heading See Also]
11844[@https://tools.ietf.org/html/rfc7230#section-4.1 https://tools.ietf.org/html/rfc7230#section-4.1]
11845
11846[endsect]
11847
11848[section:overload4 http::chunk_header::chunk_header (4 of 5 overloads)]
11849
11850Constructor.
11851[heading Synopsis]
11852```
11853template<
11854    class ChunkExtensions,
11855    class __Allocator__>
11856chunk_header(
11857    std::size_t size,
11858    ChunkExtensions&& extensions,
11859    Allocator const& allocator);
11860```
11861
11862[heading Description]
11863This constructs a buffer sequence representing a ['chunked-body] size and terminating CRLF (`"\r\n"`) with provided chunk extensions. The specified allocator is used to provide storage for the extensions object.
11864
11865[heading Parameters]
11866[table [[Name][Description]]
11867  [
11868    [`size`
11869    ]
11870    [
11871The size of the chunk body that follows. The value be greater than zero.
11872    ]
11873  ]
11874  [
11875    [`extensions`
11876    ]
11877    [
11878The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must be convertible to [link beast.ref.boost__beast__string_view `string_view`]. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object.
11879    ]
11880  ]
11881  [
11882    [`allocator`
11883    ]
11884    [
11885The allocator to provide storage for the moved or copied extensions object.
11886    ]
11887  ]
11888]
11889[heading Remarks]
11890This function participates in overload resolution only if [*ChunkExtensions] meets the requirements stated above.
11891[heading See Also]
11892[@https://tools.ietf.org/html/rfc7230#section-4.1 https://tools.ietf.org/html/rfc7230#section-4.1]
11893
11894[endsect]
11895
11896[section:overload5 http::chunk_header::chunk_header (5 of 5 overloads)]
11897
11898Required for ['ConstBufferSequence]
11899[heading Synopsis]
11900```
11901chunk_header(
11902    chunk_header const&);
11903```
11904
11905[heading Description]
11906
11907[endsect]
11908
11909
11910[endsect]
11911
11912[section:begin http::chunk_header::begin]
11913[indexterm2 begin..http::chunk_header]
11914
11915
11916Required for ['ConstBufferSequence]
11917[heading Synopsis]
11918```
11919const_iterator
11920begin() const;
11921```
11922
11923[heading Description]
11924
11925[endsect]
11926
11927[section:end http::chunk_header::end]
11928[indexterm2 end..http::chunk_header]
11929
11930
11931Required for ['ConstBufferSequence]
11932[heading Synopsis]
11933```
11934const_iterator
11935end() const;
11936```
11937
11938[heading Description]
11939
11940[endsect]
11941
11942
11943[endsect]
11944
11945[section:boost__beast__http__chunk_last http::chunk_last]
11946
11947A chunked-encoding last chunk.
11948[heading Synopsis]
11949Defined in header [include_file boost/beast/http/chunk_encode.hpp]
11950
11951```
11952template<
11953    class Trailer = ``[link beast.ref.boost__beast__http__chunk_crlf chunk_crlf]``>
11954class chunk_last
11955```
11956
11957[heading Types]
11958[table [[Name][Description]]
11959  [
11960    [[*[link beast.ref.boost__beast__http__chunk_last.const_iterator const_iterator]]
11961    ]
11962    [
11963
11964Required for ['ConstBufferSequence]
11965    ]
11966  ]
11967  [
11968    [[*[link beast.ref.boost__beast__http__chunk_last.value_type value_type]]
11969    ]
11970    [
11971
11972Required for ['ConstBufferSequence]
11973    ]
11974  ]
11975]
11976[heading Member Functions]
11977[table [[Name][Description]]
11978  [
11979    [[*[link beast.ref.boost__beast__http__chunk_last.begin begin]]
11980    ]
11981    [
11982
11983Required for ['ConstBufferSequence]
11984    ]
11985  ]
11986  [
11987    [[*[link beast.ref.boost__beast__http__chunk_last.chunk_last chunk_last]]
11988    ]
11989    [
11990
11991Constructor.
11992
11993Required for ['ConstBufferSequence]
11994    ]
11995  ]
11996  [
11997    [[*[link beast.ref.boost__beast__http__chunk_last.end end]]
11998    ]
11999    [
12000
12001Required for ['ConstBufferSequence]
12002    ]
12003  ]
12004]
12005[heading Description]
12006
12007[section:value_type http::chunk_last::value_type]
12008[indexterm2 value_type..http::chunk_last]
12009
12010
12011Required for ['ConstBufferSequence]
12012[heading Synopsis]
12013```
12014using value_type = ``['implementation-defined]``;
12015```
12016
12017[heading Description]
12018
12019[endsect]
12020
12021[section:const_iterator http::chunk_last::const_iterator]
12022[indexterm2 const_iterator..http::chunk_last]
12023
12024
12025Required for ['ConstBufferSequence]
12026[heading Synopsis]
12027```
12028using const_iterator = ``['implementation-defined]``;
12029```
12030
12031[heading Description]
12032
12033[endsect]
12034
12035[section:chunk_last http::chunk_last::chunk_last]
12036[indexterm2 chunk_last..http::chunk_last]
12037
12038
12039Constructor.
12040```
12041``[link beast.ref.boost__beast__http__chunk_last.chunk_last.overload1 chunk_last]``();
12042  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_last.chunk_last.overload1 `more...`]]``
12043
12044explicit
12045``[link beast.ref.boost__beast__http__chunk_last.chunk_last.overload2 chunk_last]``(
12046    Trailer const& trailer);
12047  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_last.chunk_last.overload2 `more...`]]``
12048
12049template<
12050    class __Allocator__>
12051``[link beast.ref.boost__beast__http__chunk_last.chunk_last.overload3 chunk_last]``(
12052    Trailer const& trailer,
12053    Allocator const& allocator);
12054  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_last.chunk_last.overload3 `more...`]]``
12055```
12056
12057
12058Required for ['ConstBufferSequence]
12059```
12060``[link beast.ref.boost__beast__http__chunk_last.chunk_last.overload4 chunk_last]``(
12061    chunk_last const&);
12062  ``[''''&raquo;''' [link beast.ref.boost__beast__http__chunk_last.chunk_last.overload4 `more...`]]``
12063```
12064
12065[section:overload1 http::chunk_last::chunk_last (1 of 4 overloads)]
12066
12067Constructor.
12068[heading Synopsis]
12069```
12070chunk_last();
12071```
12072
12073[heading Description]
12074The last chunk will have an empty trailer
12075
12076[endsect]
12077
12078[section:overload2 http::chunk_last::chunk_last (2 of 4 overloads)]
12079
12080Constructor.
12081[heading Synopsis]
12082```
12083chunk_last(
12084    Trailer const& trailer);
12085```
12086
12087[heading Description]
12088
12089[heading Parameters]
12090[table [[Name][Description]]
12091  [
12092    [`trailer`
12093    ]
12094    [
12095The trailer to use. This may be a type meeting the requirements of either Fields or ConstBufferSequence. If it is a ConstBufferSequence, the trailer must be formatted correctly as per rfc7230 including a CRLF on its own line to denote the end of the trailer.
12096    ]
12097  ]
12098]
12099
12100[endsect]
12101
12102[section:overload3 http::chunk_last::chunk_last (3 of 4 overloads)]
12103
12104Constructor.
12105[heading Synopsis]
12106```
12107template<
12108    class __Allocator__>
12109chunk_last(
12110    Trailer const& trailer,
12111    Allocator const& allocator);
12112```
12113
12114[heading Description]
12115
12116[heading Parameters]
12117[table [[Name][Description]]
12118  [
12119    [`trailer`
12120    ]
12121    [
12122The trailer to use. This type must meet the requirements of Fields.
12123    ]
12124  ]
12125  [
12126    [`allocator`
12127    ]
12128    [
12129The allocator to use for storing temporary data associated with the serialized trailer buffers.
12130    ]
12131  ]
12132]
12133
12134[endsect]
12135
12136[section:overload4 http::chunk_last::chunk_last (4 of 4 overloads)]
12137
12138Required for ['ConstBufferSequence]
12139[heading Synopsis]
12140```
12141chunk_last(
12142    chunk_last const&);
12143```
12144
12145[heading Description]
12146
12147[endsect]
12148
12149
12150[endsect]
12151
12152[section:begin http::chunk_last::begin]
12153[indexterm2 begin..http::chunk_last]
12154
12155
12156Required for ['ConstBufferSequence]
12157[heading Synopsis]
12158```
12159const_iterator
12160begin() const;
12161```
12162
12163[heading Description]
12164
12165[endsect]
12166
12167[section:end http::chunk_last::end]
12168[indexterm2 end..http::chunk_last]
12169
12170
12171Required for ['ConstBufferSequence]
12172[heading Synopsis]
12173```
12174const_iterator
12175end() const;
12176```
12177
12178[heading Description]
12179
12180[endsect]
12181
12182
12183[endsect]
12184
12185[section:boost__beast__websocket__close_reason websocket::close_reason]
12186
12187Description of the close reason.
12188[heading Synopsis]
12189Defined in header [include_file boost/beast/websocket/rfc6455.hpp]
12190
12191```
12192struct close_reason
12193```
12194
12195[heading Member Functions]
12196[table [[Name][Description]]
12197  [
12198    [[*[link beast.ref.boost__beast__websocket__close_reason.close_reason close_reason]]
12199    ]
12200    [
12201
12202Default constructor.
12203
12204Construct from a code.
12205
12206Construct from a reason string. code is close_code::normal.
12207
12208Construct from a reason string literal. code is close_code::normal.
12209
12210Construct from a close code and reason string.
12211    ]
12212  ]
12213  [
12214    [[*[link beast.ref.boost__beast__websocket__close_reason.operator_bool operator bool]]
12215    ]
12216    [
12217
12218Returns `true` if a code was specified.
12219    ]
12220  ]
12221]
12222[heading Data Members]
12223[table [[Name][Description]]
12224  [
12225    [[*[link beast.ref.boost__beast__websocket__close_reason.code code]]
12226    ]
12227    [
12228
12229The close code.
12230    ]
12231  ]
12232  [
12233    [[*[link beast.ref.boost__beast__websocket__close_reason.reason reason]]
12234    ]
12235    [
12236
12237The optional utf8-encoded reason string.
12238    ]
12239  ]
12240]
12241[heading Description]
12242This object stores the close code (if any) and the optional utf-8 encoded implementation defined reason string.
12243
12244[section:code websocket::close_reason::code]
12245[indexterm2 code..websocket::close_reason]
12246
12247
12248The close code.
12249[heading Synopsis]
12250```
12251std::uint16_t code = close_code::none;
12252```
12253
12254[heading Description]
12255
12256[endsect]
12257
12258[section:reason websocket::close_reason::reason]
12259[indexterm2 reason..websocket::close_reason]
12260
12261
12262The optional utf8-encoded reason string.
12263[heading Synopsis]
12264```
12265reason_string reason;
12266```
12267
12268[heading Description]
12269
12270[endsect]
12271
12272[section:close_reason websocket::close_reason::close_reason]
12273[indexterm2 close_reason..websocket::close_reason]
12274
12275
12276Default constructor.
12277```
12278``[link beast.ref.boost__beast__websocket__close_reason.close_reason.overload1 close_reason]``();
12279  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__close_reason.close_reason.overload1 `more...`]]``
12280```
12281
12282
12283Construct from a code.
12284```
12285``[link beast.ref.boost__beast__websocket__close_reason.close_reason.overload2 close_reason]``(
12286    std::uint16_t code_);
12287  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__close_reason.close_reason.overload2 `more...`]]``
12288```
12289
12290
12291Construct from a reason string. code is close_code::normal.
12292```
12293``[link beast.ref.boost__beast__websocket__close_reason.close_reason.overload3 close_reason]``(
12294    string_view s);
12295  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__close_reason.close_reason.overload3 `more...`]]``
12296```
12297
12298
12299Construct from a reason string literal. code is close_code::normal.
12300```
12301``[link beast.ref.boost__beast__websocket__close_reason.close_reason.overload4 close_reason]``(
12302    char const* s);
12303  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__close_reason.close_reason.overload4 `more...`]]``
12304```
12305
12306
12307Construct from a close code and reason string.
12308```
12309``[link beast.ref.boost__beast__websocket__close_reason.close_reason.overload5 close_reason]``(
12310    close_code code_,
12311    string_view s);
12312  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__close_reason.close_reason.overload5 `more...`]]``
12313```
12314
12315[section:overload1 websocket::close_reason::close_reason (1 of 5 overloads)]
12316
12317Default constructor.
12318[heading Synopsis]
12319```
12320close_reason();
12321```
12322
12323[heading Description]
12324The code will be none. Default constructed objects will explicitly convert to bool as `false`.
12325
12326[endsect]
12327
12328[section:overload2 websocket::close_reason::close_reason (2 of 5 overloads)]
12329
12330Construct from a code.
12331[heading Synopsis]
12332```
12333close_reason(
12334    std::uint16_t code_);
12335```
12336
12337[heading Description]
12338
12339[endsect]
12340
12341[section:overload3 websocket::close_reason::close_reason (3 of 5 overloads)]
12342
12343Construct from a reason string. code is close_code::normal.
12344[heading Synopsis]
12345```
12346close_reason(
12347    string_view s);
12348```
12349
12350[heading Description]
12351
12352[endsect]
12353
12354[section:overload4 websocket::close_reason::close_reason (4 of 5 overloads)]
12355
12356Construct from a reason string literal. code is close_code::normal.
12357[heading Synopsis]
12358```
12359close_reason(
12360    char const* s);
12361```
12362
12363[heading Description]
12364
12365[endsect]
12366
12367[section:overload5 websocket::close_reason::close_reason (5 of 5 overloads)]
12368
12369Construct from a close code and reason string.
12370[heading Synopsis]
12371```
12372close_reason(
12373    close_code code_,
12374    string_view s);
12375```
12376
12377[heading Description]
12378
12379[endsect]
12380
12381
12382[endsect]
12383
12384[section:operator_bool websocket::close_reason::operator bool]
12385[indexterm2 operator bool..websocket::close_reason]
12386
12387
12388Returns `true` if a code was specified.
12389[heading Synopsis]
12390```
12391operator bool() const;
12392```
12393
12394[heading Description]
12395
12396[endsect]
12397
12398
12399[endsect]
12400
12401[section:boost__beast__websocket__stream_base__decorator websocket::stream_base::decorator]
12402
12403Stream option used to adjust HTTP fields of WebSocket upgrade request and responses.
12404[heading Synopsis]
12405Defined in header [include_file boost/beast/websocket/stream_base.hpp]
12406
12407```
12408class decorator
12409```
12410
12411[heading Member Functions]
12412[table [[Name][Description]]
12413  [
12414    [[*[link beast.ref.boost__beast__websocket__stream_base__decorator.decorator decorator]]
12415    ]
12416    [
12417
12418
12419Construct a decorator option.
12420    ]
12421  ]
12422]
12423[heading Description]
12424
12425[section:decorator websocket::stream_base::decorator::decorator]
12426[indexterm2 decorator..websocket::stream_base::decorator]
12427
12428
12429```
12430``[link beast.ref.boost__beast__websocket__stream_base__decorator.decorator.overload1 decorator]``(
12431    decorator&&);
12432  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream_base__decorator.decorator.overload1 `more...`]]``
12433```
12434
12435
12436Construct a decorator option.
12437```
12438template<
12439    class Decorator>
12440explicit
12441``[link beast.ref.boost__beast__websocket__stream_base__decorator.decorator.overload2 decorator]``(
12442    Decorator&& f);
12443  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream_base__decorator.decorator.overload2 `more...`]]``
12444```
12445
12446[section:overload1 websocket::stream_base::decorator::decorator (1 of 2 overloads)]
12447
12448[heading Synopsis]
12449```
12450decorator(
12451    decorator&&);
12452```
12453
12454[heading Description]
12455
12456[endsect]
12457
12458[section:overload2 websocket::stream_base::decorator::decorator (2 of 2 overloads)]
12459
12460Construct a decorator option.
12461[heading Synopsis]
12462```
12463template<
12464    class Decorator>
12465decorator(
12466    Decorator&& f);
12467```
12468
12469[heading Description]
12470
12471[heading Parameters]
12472[table [[Name][Description]]
12473  [
12474    [`f`
12475    ]
12476    [
12477An invocable function object. Ownership of the function object is transferred by decay-copy.
12478    ]
12479  ]
12480]
12481
12482[endsect]
12483
12484
12485[endsect]
12486
12487
12488[endsect]
12489
12490[section:boost__beast__zlib__deflate_stream zlib::deflate_stream]
12491
12492Raw deflate compressor.
12493[heading Synopsis]
12494Defined in header [include_file boost/beast/zlib/deflate_stream.hpp]
12495
12496```
12497class deflate_stream :
12498    private deflate_stream
12499```
12500
12501[heading Member Functions]
12502[table [[Name][Description]]
12503  [
12504    [[*[link beast.ref.boost__beast__zlib__deflate_stream.clear clear]]
12505    ]
12506    [
12507
12508Clear the stream.
12509    ]
12510  ]
12511  [
12512    [[*[link beast.ref.boost__beast__zlib__deflate_stream.deflate_stream deflate_stream]]
12513    ]
12514    [
12515
12516Construct a default deflate stream.
12517    ]
12518  ]
12519  [
12520    [[*[link beast.ref.boost__beast__zlib__deflate_stream.params params]]
12521    ]
12522    [
12523
12524Update the compression level and strategy.
12525    ]
12526  ]
12527  [
12528    [[*[link beast.ref.boost__beast__zlib__deflate_stream.pending pending]]
12529    ]
12530    [
12531
12532Return bits pending in the output.
12533    ]
12534  ]
12535  [
12536    [[*[link beast.ref.boost__beast__zlib__deflate_stream.prime prime]]
12537    ]
12538    [
12539
12540Insert bits into the compressed output stream.
12541    ]
12542  ]
12543  [
12544    [[*[link beast.ref.boost__beast__zlib__deflate_stream.reset reset]]
12545    ]
12546    [
12547
12548Reset the stream and compression settings.
12549
12550Reset the stream without deallocating memory.
12551    ]
12552  ]
12553  [
12554    [[*[link beast.ref.boost__beast__zlib__deflate_stream.tune tune]]
12555    ]
12556    [
12557
12558Fine tune internal compression parameters.
12559    ]
12560  ]
12561  [
12562    [[*[link beast.ref.boost__beast__zlib__deflate_stream.upper_bound upper_bound]]
12563    ]
12564    [
12565
12566Returns the upper limit on the size of a compressed block.
12567    ]
12568  ]
12569  [
12570    [[*[link beast.ref.boost__beast__zlib__deflate_stream.write write]]
12571    ]
12572    [
12573
12574Compress input and write output.
12575    ]
12576  ]
12577]
12578[heading Description]
12579This is a port of zlib's "deflate" functionality to C++.
12580
12581[section:deflate_stream zlib::deflate_stream::deflate_stream]
12582[indexterm2 deflate_stream..zlib::deflate_stream]
12583
12584
12585Construct a default deflate stream.
12586[heading Synopsis]
12587```
12588deflate_stream();
12589```
12590
12591[heading Description]
12592Upon construction, the stream settings will be set to these default values:
12593
12594* `level = 6`
12595
12596* `windowBits = 15`
12597
12598* `memLevel = 8`
12599
12600* strategy = [link beast.ref.boost__beast__zlib__Strategy `Strategy::normal`]
12601
12602Although the stream is ready to be used immediately after construction, any required internal buffers are not dynamically allocated until needed.
12603
12604[endsect]
12605
12606[section:reset zlib::deflate_stream::reset]
12607[indexterm2 reset..zlib::deflate_stream]
12608
12609
12610Reset the stream and compression settings.
12611```
12612void
12613``[link beast.ref.boost__beast__zlib__deflate_stream.reset.overload1 reset]``(
12614    int level,
12615    int windowBits,
12616    int memLevel,
12617    Strategy strategy);
12618  ``[''''&raquo;''' [link beast.ref.boost__beast__zlib__deflate_stream.reset.overload1 `more...`]]``
12619```
12620
12621
12622Reset the stream without deallocating memory.
12623```
12624void
12625``[link beast.ref.boost__beast__zlib__deflate_stream.reset.overload2 reset]``();
12626  ``[''''&raquo;''' [link beast.ref.boost__beast__zlib__deflate_stream.reset.overload2 `more...`]]``
12627```
12628
12629[section:overload1 zlib::deflate_stream::reset (1 of 2 overloads)]
12630
12631Reset the stream and compression settings.
12632[heading Synopsis]
12633```
12634void
12635reset(
12636    int level,
12637    int windowBits,
12638    int memLevel,
12639    Strategy strategy);
12640```
12641
12642[heading Description]
12643This function initializes the stream to the specified compression settings.
12644Although the stream is ready to be used immediately after a reset, any required internal buffers are not dynamically allocated until needed.
12645
12646[heading Remarks]
12647Any unprocessed input or pending output from previous calls are discarded.
12648
12649[endsect]
12650
12651[section:overload2 zlib::deflate_stream::reset (2 of 2 overloads)]
12652
12653Reset the stream without deallocating memory.
12654[heading Synopsis]
12655```
12656void
12657reset();
12658```
12659
12660[heading Description]
12661This function performs the equivalent of calling `clear` followed by `reset` with the same compression settings, without deallocating the internal buffers.
12662
12663[heading Remarks]
12664Any unprocessed input or pending output from previous calls are discarded.
12665
12666[endsect]
12667
12668
12669[endsect]
12670
12671[section:clear zlib::deflate_stream::clear]
12672[indexterm2 clear..zlib::deflate_stream]
12673
12674
12675Clear the stream.
12676[heading Synopsis]
12677```
12678void
12679clear();
12680```
12681
12682[heading Description]
12683This function resets the stream and frees all dynamically allocated internal buffers. The compression settings are left unchanged.
12684
12685[heading Remarks]
12686Any unprocessed input or pending output from previous calls are discarded.
12687
12688[endsect]
12689
12690[section:upper_bound zlib::deflate_stream::upper_bound]
12691[indexterm2 upper_bound..zlib::deflate_stream]
12692
12693
12694Returns the upper limit on the size of a compressed block.
12695[heading Synopsis]
12696```
12697std::size_t
12698upper_bound(
12699    std::size_t sourceLen) const;
12700```
12701
12702[heading Description]
12703This function makes a conservative estimate of the maximum number of bytes needed to store the result of compressing a block of data based on the current compression level and strategy.
12704
12705[heading Parameters]
12706[table [[Name][Description]]
12707  [
12708    [`sourceLen`
12709    ]
12710    [
12711The size of the uncompressed data.
12712    ]
12713  ]
12714]
12715[heading Return Value]
12716The maximum number of resulting compressed bytes.
12717
12718[endsect]
12719
12720[section:tune zlib::deflate_stream::tune]
12721[indexterm2 tune..zlib::deflate_stream]
12722
12723
12724Fine tune internal compression parameters.
12725[heading Synopsis]
12726```
12727void
12728tune(
12729    int good_length,
12730    int max_lazy,
12731    int nice_length,
12732    int max_chain);
12733```
12734
12735[heading Description]
12736Compression parameters should only be tuned by someone who understands the algorithm used by zlib's deflate for searching for the best matching string, and even then only by the most fanatic optimizer trying to squeeze out the last compressed bit for their specific input data. Read the deflate.c source code (ZLib) for the meaning of the max_lazy, good_length, nice_length, and max_chain parameters.
12737
12738[endsect]
12739
12740[section:write zlib::deflate_stream::write]
12741[indexterm2 write..zlib::deflate_stream]
12742
12743
12744Compress input and write output.
12745[heading Synopsis]
12746```
12747void
12748write(
12749    z_params& zs,
12750    Flush flush,
12751    error_code& ec);
12752```
12753
12754[heading Description]
12755This function compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush.
12756In each call, one or both of these actions are performed:
12757
12758* Compress more input starting at `zs.next_in` and update `zs.next_in` and `zs.avail_in` accordingly. If not all input can be processed (because there is not enough room in the output buffer), `zs.next_in` and `zs.avail_in` are updated and processing will resume at this point for the next call.
12759
12760* Provide more output starting at `zs.next_out` and update `zs.next_out` and `zs.avail_out` accordingly. This action is forced if the parameter flush is not [link beast.ref.boost__beast__zlib__Flush `Flush::none`]. Forcing flush frequently degrades the compression ratio, so this parameter should be set only when necessary (in interactive applications). Some output may be provided even if flush is not set.
12761
12762Before the call, the application must ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating `zs.avail_in` or `zs.avail_out` accordingly; `zs.avail_out` should never be zero before the call. The application can consume the compressed output when it wants, for example when the output buffer is full (`zs.avail_out == 0`), or after each call of `write`. If `write` returns no error with zero `zs.avail_out`, it must be called again after making room in the output buffer because there might be more output pending.
12763Normally the parameter flush is set to [link beast.ref.boost__beast__zlib__Flush `Flush::none`], which allows deflate to decide how much data to accumulate before producing output, in order to maximize compression.
12764If the parameter flush is set to [link beast.ref.boost__beast__zlib__Flush `Flush::sync`], all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. In particular `zs.avail_in` is zero after the call if enough output space has been provided before the call. Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. This completes the current deflate block and follows it with an empty stored block that is three bits plus filler bits to the next byte, followed by the four bytes `{ 0x00, 0x00 0xff 0xff }`.
12765If flush is set to [link beast.ref.boost__beast__zlib__Flush `Flush::partial`], all pending output is flushed to the output buffer, but the output is not aligned to a byte boundary. All of the input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output in order for the decompressor to finish the block before the empty fixed code block.
12766If flush is set to [link beast.ref.boost__beast__zlib__Flush `Flush::block`], a deflate block is completed and emitted, as for [link beast.ref.boost__beast__zlib__Flush `Flush::sync`], but the output is not aligned on a byte boundary, and up to seven bits of the current block are held to be written as the next byte after the next deflate block is completed. In this case, the decompressor may not be provided enough bits at this point in order to complete decompression of the data provided so far to the compressor. It may need to wait for the next block to be emitted. This is for advanced applications that need to control the emission of deflate blocks.
12767If flush is set to [link beast.ref.boost__beast__zlib__Flush `Flush::full`], all output is flushed as with [link beast.ref.boost__beast__zlib__Flush `Flush::sync`], and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using [link beast.ref.boost__beast__zlib__Flush `Flush::full`] too often can seriously degrade compression.
12768If `write` returns with `zs.avail_out == 0`, this function must be called again with the same value of the flush parameter and more output space (updated `zs.avail_out`), until the flush is complete (`write` returns with non-zero `zs.avail_out`). In the case of a [link beast.ref.boost__beast__zlib__Flush `Flush::full`]or [link beast.ref.boost__beast__zlib__Flush `Flush::sync`], make sure that `zs.avail_out` is greater than six to avoid repeated flush markers due to `zs.avail_out == 0` on return.
12769If the parameter flush is set to [link beast.ref.boost__beast__zlib__Flush `Flush::finish`], pending input is processed, pending output is flushed and deflate returns the error [link beast.ref.boost__beast__zlib__error `error::end_of_stream`] if there was enough output space; if deflate returns with no error, this function must be called again with [link beast.ref.boost__beast__zlib__Flush `Flush::finish`] and more output space (updated `zs.avail_out`) but no more input data, until it returns the error [link beast.ref.boost__beast__zlib__error `error::end_of_stream`] or another error. After `write` has returned the [link beast.ref.boost__beast__zlib__error `error::end_of_stream`] error, the only possible operations on the stream are to reset or destroy.
12770[link beast.ref.boost__beast__zlib__Flush `Flush::finish`] can be used immediately after initialization if all the compression is to be done in a single step. In this case, `zs.avail_out` must be at least value returned by `upper_bound` (see below). Then `write` is guaranteed to return the [link beast.ref.boost__beast__zlib__error `error::end_of_stream`] error. If not enough output space is provided, deflate will not return [link beast.ref.boost__beast__zlib__error `error::end_of_stream`], and it must be called again as described above.
12771`write` returns no error if some progress has been made (more input processed or more output produced), [link beast.ref.boost__beast__zlib__error `error::end_of_stream`] if all input has been consumed and all output has been produced (only when flush is set to [link beast.ref.boost__beast__zlib__Flush `Flush::finish`]), [link beast.ref.boost__beast__zlib__error `error::stream_error`] if the stream state was inconsistent (for example if `zs.next_in` or `zs.next_out` was `nullptr`), [link beast.ref.boost__beast__zlib__error `error::need_buffers`] if no progress is possible (for example `zs.avail_in` or `zs.avail_out` was zero). Note that [link beast.ref.boost__beast__zlib__error `error::need_buffers`] is not fatal, and `write` can be called again with more input and more output space to continue compressing.
12772
12773[endsect]
12774
12775[section:params zlib::deflate_stream::params]
12776[indexterm2 params..zlib::deflate_stream]
12777
12778
12779Update the compression level and strategy.
12780[heading Synopsis]
12781```
12782void
12783params(
12784    z_params& zs,
12785    int level,
12786    Strategy strategy,
12787    error_code& ec);
12788```
12789
12790[heading Description]
12791This function dynamically updates the compression level and compression strategy. The interpretation of level and strategy is as in [link beast.ref.boost__beast__zlib__deflate_stream.reset `reset`]. This can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression level is changed, the input available so far is compressed with the old level (and may be flushed); the new level will take effect only at the next call of [link beast.ref.boost__beast__zlib__deflate_stream.write `write`].
12792Before the call of `params`, the stream state must be set as for a call of [link beast.ref.boost__beast__zlib__deflate_stream.write `write`], since the currently available input may have to be compressed and flushed. In particular, `zs.avail_out` must be non-zero.
12793
12794[heading Return Value]
12795`Z_OK` if success, `Z_STREAM_ERROR` if the source stream state was inconsistent or if a parameter was invalid, [link beast.ref.boost__beast__zlib__error `error::need_buffers`] if `zs.avail_out` was zero.
12796
12797[endsect]
12798
12799[section:pending zlib::deflate_stream::pending]
12800[indexterm2 pending..zlib::deflate_stream]
12801
12802
12803Return bits pending in the output.
12804[heading Synopsis]
12805```
12806void
12807pending(
12808    unsigned* value,
12809    int* bits);
12810```
12811
12812[heading Description]
12813This function returns the number of bytes and bits of output that have been generated, but not yet provided in the available output. The bytes not provided would be due to the available output space having being consumed. The number of bits of output not provided are between 0 and 7, where they await more bits to join them in order to fill out a full byte. If pending or bits are `nullptr`, then those values are not set.
12814
12815[heading Return Value]
12816`Z_OK` if success, or `Z_STREAM_ERROR` if the source stream state was inconsistent.
12817
12818[endsect]
12819
12820[section:prime zlib::deflate_stream::prime]
12821[indexterm2 prime..zlib::deflate_stream]
12822
12823
12824Insert bits into the compressed output stream.
12825[heading Synopsis]
12826```
12827void
12828prime(
12829    int bits,
12830    int value,
12831    error_code& ec);
12832```
12833
12834[heading Description]
12835This function inserts bits in the deflate output stream. The intent is that this function is used to start off the deflate output with the bits leftover from a previous deflate stream when appending to it. As such, this function can only be used for raw deflate, and must be used before the first `write` call after an initialization. `bits` must be less than or equal to 16, and that many of the least significant bits of `value` will be inserted in the output.
12836
12837[heading Return Value]
12838[link beast.ref.boost__beast__zlib__error `error::need_buffers`] if there was not enough room in the internal buffer to insert the bits.
12839
12840[endsect]
12841
12842
12843[endsect]
12844
12845[section:boost__beast__http__empty_body http::empty_body]
12846
12847An empty ['Body]
12848[heading Synopsis]
12849Defined in header [include_file boost/beast/http/empty_body.hpp]
12850
12851```
12852struct empty_body
12853```
12854
12855[heading Types]
12856[table [[Name][Description]]
12857  [
12858    [[*[link beast.ref.boost__beast__http__empty_body.reader reader]]
12859    ]
12860    [
12861
12862The algorithm for parsing the body.
12863    ]
12864  ]
12865  [
12866    [[*[link beast.ref.boost__beast__http__empty_body__value_type value_type]]
12867    ]
12868    [
12869
12870The type of container used for the body.
12871    ]
12872  ]
12873  [
12874    [[*[link beast.ref.boost__beast__http__empty_body.writer writer]]
12875    ]
12876    [
12877
12878The algorithm for serializing the body.
12879    ]
12880  ]
12881]
12882[heading Static Members]
12883[table [[Name][Description]]
12884  [
12885    [[*[link beast.ref.boost__beast__http__empty_body.size size]]
12886    ]
12887    [
12888
12889Returns the payload size of the body.
12890    ]
12891  ]
12892]
12893[heading Description]
12894This body is used to represent messages which do not have a message body. If this body is used with a parser, and the parser encounters octets corresponding to a message body, the parser will fail with the error [link beast.ref.boost__beast__http__error `
12895            http::unexpected_body
12896         `].
12897The Content-Length of this body is always 0.
12898
12899[section:reader http::empty_body::reader]
12900[indexterm2 reader..http::empty_body]
12901
12902
12903The algorithm for parsing the body.
12904[heading Synopsis]
12905```
12906using reader = ``['implementation-defined]``;
12907```
12908
12909[heading Description]
12910Meets the requirements of ['BodyReader].
12911
12912[endsect]
12913
12914[section:writer http::empty_body::writer]
12915[indexterm2 writer..http::empty_body]
12916
12917
12918The algorithm for serializing the body.
12919[heading Synopsis]
12920```
12921using writer = ``['implementation-defined]``;
12922```
12923
12924[heading Description]
12925Meets the requirements of ['BodyWriter].
12926
12927[endsect]
12928
12929[section:size http::empty_body::size]
12930[indexterm2 size..http::empty_body]
12931
12932
12933Returns the payload size of the body.
12934[heading Synopsis]
12935```
12936static
12937std::uint64_t
12938size(
12939    value_type);
12940```
12941
12942[heading Description]
12943When this body is used with [link beast.ref.boost__beast__http__message.prepare_payload `message::prepare_payload`], the Content-Length will be set to the payload size, and any chunked Transfer-Encoding will be removed.
12944
12945[endsect]
12946
12947
12948[endsect]
12949
12950[section:boost__beast__http__ext_list http::ext_list]
12951
12952A list of extensions in a comma separated HTTP field value.
12953[heading Synopsis]
12954Defined in header [include_file boost/beast/http/rfc7230.hpp]
12955
12956```
12957class ext_list
12958```
12959
12960[heading Types]
12961[table [[Name][Description]]
12962  [
12963    [[*[link beast.ref.boost__beast__http__ext_list.const_iterator const_iterator]]
12964    ]
12965    [
12966
12967A constant iterator to the list.
12968    ]
12969  ]
12970  [
12971    [[*[link beast.ref.boost__beast__http__ext_list.value_type value_type]]
12972    ]
12973    [
12974
12975The type of each element in the list.
12976    ]
12977  ]
12978]
12979[heading Member Functions]
12980[table [[Name][Description]]
12981  [
12982    [[*[link beast.ref.boost__beast__http__ext_list.begin begin]]
12983    ]
12984    [
12985
12986Return a const iterator to the beginning of the list.
12987    ]
12988  ]
12989  [
12990    [[*[link beast.ref.boost__beast__http__ext_list.cbegin cbegin]]
12991    ]
12992    [
12993
12994Return a const iterator to the beginning of the list.
12995    ]
12996  ]
12997  [
12998    [[*[link beast.ref.boost__beast__http__ext_list.cend cend]]
12999    ]
13000    [
13001
13002Return a const iterator to the end of the list.
13003    ]
13004  ]
13005  [
13006    [[*[link beast.ref.boost__beast__http__ext_list.end end]]
13007    ]
13008    [
13009
13010Return a const iterator to the end of the list.
13011    ]
13012  ]
13013  [
13014    [[*[link beast.ref.boost__beast__http__ext_list.exists exists]]
13015    ]
13016    [
13017
13018Return `true` if a token is present in the list.
13019    ]
13020  ]
13021  [
13022    [[*[link beast.ref.boost__beast__http__ext_list.ext_list ext_list]]
13023    ]
13024    [
13025
13026Construct a list.
13027    ]
13028  ]
13029  [
13030    [[*[link beast.ref.boost__beast__http__ext_list.find find]]
13031    ]
13032    [
13033
13034Find a token in the list.
13035    ]
13036  ]
13037]
13038[heading Description]
13039This container allows iteration of the extensions in an HTTP field value. The extension list is a comma separated list of token parameter list pairs.
13040If a parsing error is encountered while iterating the string, the behavior of the container will be as if a string containing only characters up to but excluding the first invalid character was used to construct the list.
13041
13042[heading BNF]
13043
13044```
13045ext-list    = *( "," OWS ) ext *( OWS "," [ OWS ext ] )
13046ext         = token param-list
13047param-list  = *( OWS ";" OWS param )
13048param       = token OWS [ "=" OWS ( token / quoted-string ) ]
13049```
13050
13051To use this class, construct with the string to be parsed and then use [link beast.ref.boost__beast__http__ext_list.begin `begin`] and [link beast.ref.boost__beast__http__ext_list.end `end`], or range-for to iterate each item:
13052
13053[heading Example]
13054
13055```
13056for(auto const& ext : ext_list{"none, 7z;level=9, zip;no_context_takeover;bits=15"})
13057{
13058    std::cout << ext.first << "\n";
13059    for(auto const& param : ext.second)
13060    {
13061        std::cout << ";" << param.first;
13062        if(! param.second.empty())
13063            std::cout << "=" << param.second;
13064        std::cout << "\n";
13065    }
13066}
13067```
13068
13069
13070[section:value_type http::ext_list::value_type]
13071[indexterm2 value_type..http::ext_list]
13072
13073
13074The type of each element in the list.
13075[heading Synopsis]
13076```
13077using value_type = std::pair< string_view, param_list >;
13078```
13079
13080[heading Types]
13081[table [[Name][Description]]
13082  [
13083    [[*[link beast.ref.boost__beast__http__param_list.const_iterator const_iterator]]
13084    ]
13085    [
13086
13087A constant iterator to the list.
13088    ]
13089  ]
13090  [
13091    [[*[link beast.ref.boost__beast__http__param_list.value_type value_type]]
13092    ]
13093    [
13094
13095The type of each element in the list.
13096    ]
13097  ]
13098]
13099[heading Member Functions]
13100[table [[Name][Description]]
13101  [
13102    [[*[link beast.ref.boost__beast__http__param_list.begin begin]]
13103    ]
13104    [
13105
13106Return a const iterator to the beginning of the list.
13107    ]
13108  ]
13109  [
13110    [[*[link beast.ref.boost__beast__http__param_list.cbegin cbegin]]
13111    ]
13112    [
13113
13114Return a const iterator to the beginning of the list.
13115    ]
13116  ]
13117  [
13118    [[*[link beast.ref.boost__beast__http__param_list.cend cend]]
13119    ]
13120    [
13121
13122Return a const iterator to the end of the list.
13123    ]
13124  ]
13125  [
13126    [[*[link beast.ref.boost__beast__http__param_list.end end]]
13127    ]
13128    [
13129
13130Return a const iterator to the end of the list.
13131    ]
13132  ]
13133  [
13134    [[*[link beast.ref.boost__beast__http__param_list.param_list param_list]]
13135    ]
13136    [
13137
13138Default constructor.
13139
13140Construct a list.
13141    ]
13142  ]
13143]
13144This container allows iteration of the parameter list in an HTTP extension. The parameter list is a series of name/value pairs with each pair starting with a semicolon. The value is optional.
13145If a parsing error is encountered while iterating the string, the behavior of the container will be as if a string containing only characters up to but excluding the first invalid character was used to construct the list.
13146
13147[heading BNF]
13148
13149```
13150param-list  = *( OWS ";" OWS param )
13151param       = token OWS [ "=" OWS ( token / quoted-string ) ]
13152```
13153
13154To use this class, construct with the string to be parsed and then use [link beast.ref.boost__beast__http__param_list.begin `begin`] and [link beast.ref.boost__beast__http__param_list.end `end`], or range-for to iterate each item:
13155
13156[heading Example]
13157
13158```
13159for(auto const& param : param_list{";level=9;no_context_takeover;bits=15"})
13160{
13161    std::cout << ";" << param.first;
13162    if(! param.second.empty())
13163        std::cout << "=" << param.second;
13164    std::cout << "\n";
13165}
13166```
13167
13168[heading Description]
13169The first element of the pair is the extension token, and the second element of the pair is an iterable container holding the extension's name/value parameters.
13170
13171[endsect]
13172
13173[section:const_iterator http::ext_list::const_iterator]
13174[indexterm2 const_iterator..http::ext_list]
13175
13176
13177A constant iterator to the list.
13178[heading Synopsis]
13179```
13180using const_iterator = ``['implementation-defined]``;
13181```
13182
13183[heading Description]
13184
13185[endsect]
13186
13187[section:ext_list http::ext_list::ext_list]
13188[indexterm2 ext_list..http::ext_list]
13189
13190
13191Construct a list.
13192[heading Synopsis]
13193```
13194ext_list(
13195    string_view s);
13196```
13197
13198[heading Description]
13199
13200[heading Parameters]
13201[table [[Name][Description]]
13202  [
13203    [`s`
13204    ]
13205    [
13206A string containing the list contents. The string must remain valid for the lifetime of the container.
13207    ]
13208  ]
13209]
13210
13211[endsect]
13212
13213[section:begin http::ext_list::begin]
13214[indexterm2 begin..http::ext_list]
13215
13216
13217Return a const iterator to the beginning of the list.
13218[heading Synopsis]
13219```
13220const_iterator
13221begin() const;
13222```
13223
13224[heading Description]
13225
13226[endsect]
13227
13228[section:end http::ext_list::end]
13229[indexterm2 end..http::ext_list]
13230
13231
13232Return a const iterator to the end of the list.
13233[heading Synopsis]
13234```
13235const_iterator
13236end() const;
13237```
13238
13239[heading Description]
13240
13241[endsect]
13242
13243[section:cbegin http::ext_list::cbegin]
13244[indexterm2 cbegin..http::ext_list]
13245
13246
13247Return a const iterator to the beginning of the list.
13248[heading Synopsis]
13249```
13250const_iterator
13251cbegin() const;
13252```
13253
13254[heading Description]
13255
13256[endsect]
13257
13258[section:cend http::ext_list::cend]
13259[indexterm2 cend..http::ext_list]
13260
13261
13262Return a const iterator to the end of the list.
13263[heading Synopsis]
13264```
13265const_iterator
13266cend() const;
13267```
13268
13269[heading Description]
13270
13271[endsect]
13272
13273[section:find http::ext_list::find]
13274[indexterm2 find..http::ext_list]
13275
13276
13277Find a token in the list.
13278[heading Synopsis]
13279```
13280const_iterator
13281find(
13282    string_view const& s);
13283```
13284
13285[heading Description]
13286
13287[heading Parameters]
13288[table [[Name][Description]]
13289  [
13290    [`s`
13291    ]
13292    [
13293The token to find. A case-insensitive comparison is used.
13294    ]
13295  ]
13296]
13297[heading Return Value]
13298An iterator to the matching token, or [link beast.ref.boost__beast__http__ext_list.end `end()`] if no token exists.
13299
13300[endsect]
13301
13302[section:exists http::ext_list::exists]
13303[indexterm2 exists..http::ext_list]
13304
13305
13306Return `true` if a token is present in the list.
13307[heading Synopsis]
13308```
13309bool
13310exists(
13311    string_view const& s);
13312```
13313
13314[heading Description]
13315
13316[heading Parameters]
13317[table [[Name][Description]]
13318  [
13319    [`s`
13320    ]
13321    [
13322The token to find. A case-insensitive comparison is used.
13323    ]
13324  ]
13325]
13326
13327[endsect]
13328
13329
13330[endsect]
13331
13332[section:boost__beast__test__fail_count test::fail_count]
13333
13334A countdown to simulated failure.
13335[heading Synopsis]
13336Defined in header [include_file boost/beast/_experimental/test/fail_count.hpp]
13337
13338```
13339class fail_count
13340```
13341
13342[heading Member Functions]
13343[table [[Name][Description]]
13344  [
13345    [[*[link beast.ref.boost__beast__test__fail_count.fail fail]]
13346    ]
13347    [
13348
13349Throw an exception on the Nth failure.
13350
13351Set an error code on the Nth failure.
13352    ]
13353  ]
13354  [
13355    [[*[link beast.ref.boost__beast__test__fail_count.fail_count fail_count]]
13356    ]
13357    [
13358
13359
13360Construct a counter.
13361    ]
13362  ]
13363]
13364[heading Description]
13365On the Nth operation, the class will fail with the specified error code, or the default error code of [link beast.ref.boost__beast__test__error `error::test_failure`].
13366Instances of this class may be used to build objects which are specifically designed to aid in writing unit tests, for interfaces which can throw exceptions or return `error_code` values representing failure.
13367
13368[section:fail_count test::fail_count::fail_count]
13369[indexterm2 fail_count..test::fail_count]
13370
13371
13372```
13373``[link beast.ref.boost__beast__test__fail_count.fail_count.overload1 fail_count]``(
13374    fail_count&&);
13375  ``[''''&raquo;''' [link beast.ref.boost__beast__test__fail_count.fail_count.overload1 `more...`]]``
13376```
13377
13378
13379Construct a counter.
13380```
13381explicit
13382``[link beast.ref.boost__beast__test__fail_count.fail_count.overload2 fail_count]``(
13383    std::size_t n,
13384    error_code ev = ``[link beast.ref.boost__beast__test__error error::test_failure]``);
13385  ``[''''&raquo;''' [link beast.ref.boost__beast__test__fail_count.fail_count.overload2 `more...`]]``
13386```
13387
13388[section:overload1 test::fail_count::fail_count (1 of 2 overloads)]
13389
13390[heading Synopsis]
13391```
13392fail_count(
13393    fail_count&&);
13394```
13395
13396[heading Description]
13397
13398[endsect]
13399
13400[section:overload2 test::fail_count::fail_count (2 of 2 overloads)]
13401
13402Construct a counter.
13403[heading Synopsis]
13404```
13405fail_count(
13406    std::size_t n,
13407    error_code ev = ``[link beast.ref.boost__beast__test__error error::test_failure]``);
13408```
13409
13410[heading Description]
13411
13412[heading Parameters]
13413[table [[Name][Description]]
13414  [
13415    [`n`
13416    ]
13417    [
13418The 0-based index of the operation to fail on or after
13419    ]
13420  ]
13421  [
13422    [`ev`
13423    ]
13424    [
13425An optional error code to use when generating a simulated failure
13426    ]
13427  ]
13428]
13429
13430[endsect]
13431
13432
13433[endsect]
13434
13435[section:fail test::fail_count::fail]
13436[indexterm2 fail..test::fail_count]
13437
13438
13439Throw an exception on the Nth failure.
13440```
13441void
13442``[link beast.ref.boost__beast__test__fail_count.fail.overload1 fail]``();
13443  ``[''''&raquo;''' [link beast.ref.boost__beast__test__fail_count.fail.overload1 `more...`]]``
13444```
13445
13446
13447Set an error code on the Nth failure.
13448```
13449bool
13450``[link beast.ref.boost__beast__test__fail_count.fail.overload2 fail]``(
13451    error_code& ec);
13452  ``[''''&raquo;''' [link beast.ref.boost__beast__test__fail_count.fail.overload2 `more...`]]``
13453```
13454
13455[section:overload1 test::fail_count::fail (1 of 2 overloads)]
13456
13457Throw an exception on the Nth failure.
13458[heading Synopsis]
13459```
13460void
13461fail();
13462```
13463
13464[heading Description]
13465
13466[endsect]
13467
13468[section:overload2 test::fail_count::fail (2 of 2 overloads)]
13469
13470Set an error code on the Nth failure.
13471[heading Synopsis]
13472```
13473bool
13474fail(
13475    error_code& ec);
13476```
13477
13478[heading Description]
13479
13480[endsect]
13481
13482
13483[endsect]
13484
13485
13486[endsect]
13487
13488[section:boost__beast__file file]
13489
13490An implementation of File.
13491[heading Synopsis]
13492Defined in header [include_file boost/beast/core/file.hpp]
13493
13494```
13495struct file :
13496    public file_stdio
13497```
13498
13499[heading Types]
13500[table [[Name][Description]]
13501  [
13502    [[*[link beast.ref.boost__beast__file.native_handle_type native_handle_type]]
13503    ]
13504    [
13505
13506The type of the underlying file handle.
13507    ]
13508  ]
13509]
13510[heading Member Functions]
13511[table [[Name][Description]]
13512  [
13513    [[*[link beast.ref.boost__beast__file.close close]]
13514    ]
13515    [
13516
13517Close the file if open.
13518    ]
13519  ]
13520  [
13521    [[*[link beast.ref.boost__beast__file.is_open is_open]]
13522    ]
13523    [
13524
13525Returns `true` if the file is open.
13526    ]
13527  ]
13528  [
13529    [[*[link beast.ref.boost__beast__file.native_handle native_handle]]
13530    ]
13531    [
13532
13533Returns the native handle associated with the file.
13534
13535Set the native handle associated with the file.
13536    ]
13537  ]
13538  [
13539    [[*[link beast.ref.boost__beast__file.open open]]
13540    ]
13541    [
13542
13543Open a file at the given path with the specified mode.
13544    ]
13545  ]
13546  [
13547    [[*[link beast.ref.boost__beast__file.pos pos]]
13548    ]
13549    [
13550
13551Return the current position in the open file.
13552    ]
13553  ]
13554  [
13555    [[*[link beast.ref.boost__beast__file.read read]]
13556    ]
13557    [
13558
13559Read from the open file.
13560    ]
13561  ]
13562  [
13563    [[*[link beast.ref.boost__beast__file.seek seek]]
13564    ]
13565    [
13566
13567Adjust the current position in the open file.
13568    ]
13569  ]
13570  [
13571    [[*[link beast.ref.boost__beast__file.size size]]
13572    ]
13573    [
13574
13575Return the size of the open file.
13576    ]
13577  ]
13578  [
13579    [[*[link beast.ref.boost__beast__file.write write]]
13580    ]
13581    [
13582
13583Write to the open file.
13584    ]
13585  ]
13586]
13587[heading Description]
13588This alias is set to the best available implementation of ['File] given the platform and build settings.
13589
13590[section:native_handle_type file::native_handle_type]
13591[indexterm2 native_handle_type..file]
13592
13593(Inherited from [link beast.ref.boost__beast__file_stdio `file_stdio`])
13594
13595The type of the underlying file handle.
13596[heading Synopsis]
13597```
13598using native_handle_type = std::FILE*;
13599```
13600
13601[heading Description]
13602This is platform-specific.
13603
13604[endsect]
13605
13606[section:native_handle file::native_handle]
13607[indexterm2 native_handle..file]
13608
13609
13610Returns the native handle associated with the file.
13611```
13612std::FILE*
13613``[link beast.ref.boost__beast__file.native_handle.overload1 native_handle]``() const;
13614  ``[''''&raquo;''' [link beast.ref.boost__beast__file.native_handle.overload1 `more...`]]``
13615```
13616
13617
13618Set the native handle associated with the file.
13619```
13620void
13621``[link beast.ref.boost__beast__file.native_handle.overload2 native_handle]``(
13622    std::FILE* f);
13623  ``[''''&raquo;''' [link beast.ref.boost__beast__file.native_handle.overload2 `more...`]]``
13624```
13625
13626[section:overload1 file::native_handle (1 of 2 overloads)]
13627(Inherited from [link beast.ref.boost__beast__file_stdio `file_stdio`])
13628
13629Returns the native handle associated with the file.
13630[heading Synopsis]
13631```
13632std::FILE*
13633native_handle() const;
13634```
13635
13636[heading Description]
13637
13638[endsect]
13639
13640[section:overload2 file::native_handle (2 of 2 overloads)]
13641(Inherited from [link beast.ref.boost__beast__file_stdio `file_stdio`])
13642
13643Set the native handle associated with the file.
13644[heading Synopsis]
13645```
13646void
13647native_handle(
13648    std::FILE* f);
13649```
13650
13651[heading Description]
13652If the file is open it is first closed.
13653
13654[heading Parameters]
13655[table [[Name][Description]]
13656  [
13657    [`f`
13658    ]
13659    [
13660The native file handle to assign.
13661    ]
13662  ]
13663]
13664
13665[endsect]
13666
13667
13668[endsect]
13669
13670[section:is_open file::is_open]
13671[indexterm2 is_open..file]
13672
13673(Inherited from [link beast.ref.boost__beast__file_stdio `file_stdio`])
13674
13675Returns `true` if the file is open.
13676[heading Synopsis]
13677```
13678bool
13679is_open() const;
13680```
13681
13682[heading Description]
13683
13684[endsect]
13685
13686[section:close file::close]
13687[indexterm2 close..file]
13688
13689(Inherited from [link beast.ref.boost__beast__file_stdio `file_stdio`])
13690
13691Close the file if open.
13692[heading Synopsis]
13693```
13694void
13695close(
13696    error_code& ec);
13697```
13698
13699[heading Description]
13700
13701[heading Parameters]
13702[table [[Name][Description]]
13703  [
13704    [`ec`
13705    ]
13706    [
13707Set to the error, if any occurred.
13708    ]
13709  ]
13710]
13711
13712[endsect]
13713
13714[section:open file::open]
13715[indexterm2 open..file]
13716
13717(Inherited from [link beast.ref.boost__beast__file_stdio `file_stdio`])
13718
13719Open a file at the given path with the specified mode.
13720[heading Synopsis]
13721```
13722void
13723open(
13724    char const* path,
13725    file_mode mode,
13726    error_code& ec);
13727```
13728
13729[heading Description]
13730
13731[heading Parameters]
13732[table [[Name][Description]]
13733  [
13734    [`path`
13735    ]
13736    [
13737The utf-8 encoded path to the file
13738    ]
13739  ]
13740  [
13741    [`mode`
13742    ]
13743    [
13744The file mode to use
13745    ]
13746  ]
13747  [
13748    [`ec`
13749    ]
13750    [
13751Set to the error, if any occurred
13752    ]
13753  ]
13754]
13755
13756[endsect]
13757
13758[section:size file::size]
13759[indexterm2 size..file]
13760
13761(Inherited from [link beast.ref.boost__beast__file_stdio `file_stdio`])
13762
13763Return the size of the open file.
13764[heading Synopsis]
13765```
13766std::uint64_t
13767size(
13768    error_code& ec) const;
13769```
13770
13771[heading Description]
13772
13773[heading Parameters]
13774[table [[Name][Description]]
13775  [
13776    [`ec`
13777    ]
13778    [
13779Set to the error, if any occurred
13780    ]
13781  ]
13782]
13783[heading Return Value]
13784The size in bytes
13785
13786[endsect]
13787
13788[section:pos file::pos]
13789[indexterm2 pos..file]
13790
13791(Inherited from [link beast.ref.boost__beast__file_stdio `file_stdio`])
13792
13793Return the current position in the open file.
13794[heading Synopsis]
13795```
13796std::uint64_t
13797pos(
13798    error_code& ec) const;
13799```
13800
13801[heading Description]
13802
13803[heading Parameters]
13804[table [[Name][Description]]
13805  [
13806    [`ec`
13807    ]
13808    [
13809Set to the error, if any occurred
13810    ]
13811  ]
13812]
13813[heading Return Value]
13814The offset in bytes from the beginning of the file
13815
13816[endsect]
13817
13818[section:seek file::seek]
13819[indexterm2 seek..file]
13820
13821(Inherited from [link beast.ref.boost__beast__file_stdio `file_stdio`])
13822
13823Adjust the current position in the open file.
13824[heading Synopsis]
13825```
13826void
13827seek(
13828    std::uint64_t offset,
13829    error_code& ec);
13830```
13831
13832[heading Description]
13833
13834[heading Parameters]
13835[table [[Name][Description]]
13836  [
13837    [`offset`
13838    ]
13839    [
13840The offset in bytes from the beginning of the file
13841    ]
13842  ]
13843  [
13844    [`ec`
13845    ]
13846    [
13847Set to the error, if any occurred
13848    ]
13849  ]
13850]
13851
13852[endsect]
13853
13854[section:read file::read]
13855[indexterm2 read..file]
13856
13857(Inherited from [link beast.ref.boost__beast__file_stdio `file_stdio`])
13858
13859Read from the open file.
13860[heading Synopsis]
13861```
13862std::size_t
13863read(
13864    void* buffer,
13865    std::size_t n,
13866    error_code& ec) const;
13867```
13868
13869[heading Description]
13870
13871[heading Parameters]
13872[table [[Name][Description]]
13873  [
13874    [`buffer`
13875    ]
13876    [
13877The buffer for storing the result of the read
13878    ]
13879  ]
13880  [
13881    [`n`
13882    ]
13883    [
13884The number of bytes to read
13885    ]
13886  ]
13887  [
13888    [`ec`
13889    ]
13890    [
13891Set to the error, if any occurred
13892    ]
13893  ]
13894]
13895
13896[endsect]
13897
13898[section:write file::write]
13899[indexterm2 write..file]
13900
13901(Inherited from [link beast.ref.boost__beast__file_stdio `file_stdio`])
13902
13903Write to the open file.
13904[heading Synopsis]
13905```
13906std::size_t
13907write(
13908    void const* buffer,
13909    std::size_t n,
13910    error_code& ec);
13911```
13912
13913[heading Description]
13914
13915[heading Parameters]
13916[table [[Name][Description]]
13917  [
13918    [`buffer`
13919    ]
13920    [
13921The buffer holding the data to write
13922    ]
13923  ]
13924  [
13925    [`n`
13926    ]
13927    [
13928The number of bytes to write
13929    ]
13930  ]
13931  [
13932    [`ec`
13933    ]
13934    [
13935Set to the error, if any occurred
13936    ]
13937  ]
13938]
13939
13940[endsect]
13941
13942
13943[endsect]
13944
13945[section:boost__beast__file_posix file_posix]
13946
13947An implementation of File for POSIX systems.
13948[heading Synopsis]
13949Defined in header [include_file boost/beast/core/file_posix.hpp]
13950
13951```
13952class file_posix
13953```
13954
13955[heading Types]
13956[table [[Name][Description]]
13957  [
13958    [[*[link beast.ref.boost__beast__file_posix.native_handle_type native_handle_type]]
13959    ]
13960    [
13961
13962The type of the underlying file handle.
13963    ]
13964  ]
13965]
13966[heading Member Functions]
13967[table [[Name][Description]]
13968  [
13969    [[*[link beast.ref.boost__beast__file_posix.close close]]
13970    ]
13971    [
13972
13973Close the file if open.
13974    ]
13975  ]
13976  [
13977    [[*[link beast.ref.boost__beast__file_posix.file_posix file_posix]]
13978    ]
13979    [
13980
13981Constructor.
13982    ]
13983  ]
13984  [
13985    [[*[link beast.ref.boost__beast__file_posix.is_open is_open]]
13986    ]
13987    [
13988
13989Returns `true` if the file is open.
13990    ]
13991  ]
13992  [
13993    [[*[link beast.ref.boost__beast__file_posix.native_handle native_handle]]
13994    ]
13995    [
13996
13997Returns the native handle associated with the file.
13998
13999Set the native handle associated with the file.
14000    ]
14001  ]
14002  [
14003    [[*[link beast.ref.boost__beast__file_posix.open open]]
14004    ]
14005    [
14006
14007Open a file at the given path with the specified mode.
14008    ]
14009  ]
14010  [
14011    [[*[link beast.ref.boost__beast__file_posix.operator_eq_ operator=]]
14012    ]
14013    [
14014
14015Assignment.
14016    ]
14017  ]
14018  [
14019    [[*[link beast.ref.boost__beast__file_posix.pos pos]]
14020    ]
14021    [
14022
14023Return the current position in the open file.
14024    ]
14025  ]
14026  [
14027    [[*[link beast.ref.boost__beast__file_posix.read read]]
14028    ]
14029    [
14030
14031Read from the open file.
14032    ]
14033  ]
14034  [
14035    [[*[link beast.ref.boost__beast__file_posix.seek seek]]
14036    ]
14037    [
14038
14039Adjust the current position in the open file.
14040    ]
14041  ]
14042  [
14043    [[*[link beast.ref.boost__beast__file_posix.size size]]
14044    ]
14045    [
14046
14047Return the size of the open file.
14048    ]
14049  ]
14050  [
14051    [[*[link beast.ref.boost__beast__file_posix.write write]]
14052    ]
14053    [
14054
14055Write to the open file.
14056    ]
14057  ]
14058  [
14059    [[*[link beast.ref.boost__beast__file_posix._file_posix ~file_posix]]
14060    ]
14061    [
14062
14063Destructor.
14064    ]
14065  ]
14066]
14067[heading Description]
14068This class implements a ['File] using POSIX interfaces.
14069
14070[section:native_handle_type file_posix::native_handle_type]
14071[indexterm2 native_handle_type..file_posix]
14072
14073
14074The type of the underlying file handle.
14075[heading Synopsis]
14076```
14077using native_handle_type = int;
14078```
14079
14080[heading Description]
14081This is platform-specific.
14082
14083[endsect]
14084
14085[section:_file_posix file_posix::~file_posix]
14086[indexterm2 ~file_posix..file_posix]
14087
14088
14089Destructor.
14090[heading Synopsis]
14091```
14092~file_posix();
14093```
14094
14095[heading Description]
14096If the file is open it is first closed.
14097
14098[endsect]
14099
14100[section:file_posix file_posix::file_posix]
14101[indexterm2 file_posix..file_posix]
14102
14103
14104Constructor.
14105```
14106``[link beast.ref.boost__beast__file_posix.file_posix.overload1 file_posix]``();
14107  ``[''''&raquo;''' [link beast.ref.boost__beast__file_posix.file_posix.overload1 `more...`]]``
14108
14109``[link beast.ref.boost__beast__file_posix.file_posix.overload2 file_posix]``(
14110    file_posix&& other);
14111  ``[''''&raquo;''' [link beast.ref.boost__beast__file_posix.file_posix.overload2 `more...`]]``
14112```
14113
14114[section:overload1 file_posix::file_posix (1 of 2 overloads)]
14115
14116Constructor.
14117[heading Synopsis]
14118```
14119file_posix();
14120```
14121
14122[heading Description]
14123There is no open file initially.
14124
14125[endsect]
14126
14127[section:overload2 file_posix::file_posix (2 of 2 overloads)]
14128
14129Constructor.
14130[heading Synopsis]
14131```
14132file_posix(
14133    file_posix&& other);
14134```
14135
14136[heading Description]
14137The moved-from object behaves as if default constructed.
14138
14139[endsect]
14140
14141
14142[endsect]
14143
14144[section:operator_eq_ file_posix::operator=]
14145[indexterm2 operator=..file_posix]
14146
14147
14148Assignment.
14149[heading Synopsis]
14150```
14151file_posix&
14152operator=(
14153    file_posix&& other);
14154```
14155
14156[heading Description]
14157The moved-from object behaves as if default constructed.
14158
14159[endsect]
14160
14161[section:native_handle file_posix::native_handle]
14162[indexterm2 native_handle..file_posix]
14163
14164
14165Returns the native handle associated with the file.
14166```
14167native_handle_type
14168``[link beast.ref.boost__beast__file_posix.native_handle.overload1 native_handle]``() const;
14169  ``[''''&raquo;''' [link beast.ref.boost__beast__file_posix.native_handle.overload1 `more...`]]``
14170```
14171
14172
14173Set the native handle associated with the file.
14174```
14175void
14176``[link beast.ref.boost__beast__file_posix.native_handle.overload2 native_handle]``(
14177    native_handle_type fd);
14178  ``[''''&raquo;''' [link beast.ref.boost__beast__file_posix.native_handle.overload2 `more...`]]``
14179```
14180
14181[section:overload1 file_posix::native_handle (1 of 2 overloads)]
14182
14183Returns the native handle associated with the file.
14184[heading Synopsis]
14185```
14186native_handle_type
14187native_handle() const;
14188```
14189
14190[heading Description]
14191
14192[endsect]
14193
14194[section:overload2 file_posix::native_handle (2 of 2 overloads)]
14195
14196Set the native handle associated with the file.
14197[heading Synopsis]
14198```
14199void
14200native_handle(
14201    native_handle_type fd);
14202```
14203
14204[heading Description]
14205If the file is open it is first closed.
14206
14207[heading Parameters]
14208[table [[Name][Description]]
14209  [
14210    [`fd`
14211    ]
14212    [
14213The native file handle to assign.
14214    ]
14215  ]
14216]
14217
14218[endsect]
14219
14220
14221[endsect]
14222
14223[section:is_open file_posix::is_open]
14224[indexterm2 is_open..file_posix]
14225
14226
14227Returns `true` if the file is open.
14228[heading Synopsis]
14229```
14230bool
14231is_open() const;
14232```
14233
14234[heading Description]
14235
14236[endsect]
14237
14238[section:close file_posix::close]
14239[indexterm2 close..file_posix]
14240
14241
14242Close the file if open.
14243[heading Synopsis]
14244```
14245void
14246close(
14247    error_code& ec);
14248```
14249
14250[heading Description]
14251
14252[heading Parameters]
14253[table [[Name][Description]]
14254  [
14255    [`ec`
14256    ]
14257    [
14258Set to the error, if any occurred.
14259    ]
14260  ]
14261]
14262
14263[endsect]
14264
14265[section:open file_posix::open]
14266[indexterm2 open..file_posix]
14267
14268
14269Open a file at the given path with the specified mode.
14270[heading Synopsis]
14271```
14272void
14273open(
14274    char const* path,
14275    file_mode mode,
14276    error_code& ec);
14277```
14278
14279[heading Description]
14280
14281[heading Parameters]
14282[table [[Name][Description]]
14283  [
14284    [`path`
14285    ]
14286    [
14287The utf-8 encoded path to the file
14288    ]
14289  ]
14290  [
14291    [`mode`
14292    ]
14293    [
14294The file mode to use
14295    ]
14296  ]
14297  [
14298    [`ec`
14299    ]
14300    [
14301Set to the error, if any occurred
14302    ]
14303  ]
14304]
14305
14306[endsect]
14307
14308[section:size file_posix::size]
14309[indexterm2 size..file_posix]
14310
14311
14312Return the size of the open file.
14313[heading Synopsis]
14314```
14315std::uint64_t
14316size(
14317    error_code& ec) const;
14318```
14319
14320[heading Description]
14321
14322[heading Parameters]
14323[table [[Name][Description]]
14324  [
14325    [`ec`
14326    ]
14327    [
14328Set to the error, if any occurred
14329    ]
14330  ]
14331]
14332[heading Return Value]
14333The size in bytes
14334
14335[endsect]
14336
14337[section:pos file_posix::pos]
14338[indexterm2 pos..file_posix]
14339
14340
14341Return the current position in the open file.
14342[heading Synopsis]
14343```
14344std::uint64_t
14345pos(
14346    error_code& ec) const;
14347```
14348
14349[heading Description]
14350
14351[heading Parameters]
14352[table [[Name][Description]]
14353  [
14354    [`ec`
14355    ]
14356    [
14357Set to the error, if any occurred
14358    ]
14359  ]
14360]
14361[heading Return Value]
14362The offset in bytes from the beginning of the file
14363
14364[endsect]
14365
14366[section:seek file_posix::seek]
14367[indexterm2 seek..file_posix]
14368
14369
14370Adjust the current position in the open file.
14371[heading Synopsis]
14372```
14373void
14374seek(
14375    std::uint64_t offset,
14376    error_code& ec);
14377```
14378
14379[heading Description]
14380
14381[heading Parameters]
14382[table [[Name][Description]]
14383  [
14384    [`offset`
14385    ]
14386    [
14387The offset in bytes from the beginning of the file
14388    ]
14389  ]
14390  [
14391    [`ec`
14392    ]
14393    [
14394Set to the error, if any occurred
14395    ]
14396  ]
14397]
14398
14399[endsect]
14400
14401[section:read file_posix::read]
14402[indexterm2 read..file_posix]
14403
14404
14405Read from the open file.
14406[heading Synopsis]
14407```
14408std::size_t
14409read(
14410    void* buffer,
14411    std::size_t n,
14412    error_code& ec) const;
14413```
14414
14415[heading Description]
14416
14417[heading Parameters]
14418[table [[Name][Description]]
14419  [
14420    [`buffer`
14421    ]
14422    [
14423The buffer for storing the result of the read
14424    ]
14425  ]
14426  [
14427    [`n`
14428    ]
14429    [
14430The number of bytes to read
14431    ]
14432  ]
14433  [
14434    [`ec`
14435    ]
14436    [
14437Set to the error, if any occurred
14438    ]
14439  ]
14440]
14441
14442[endsect]
14443
14444[section:write file_posix::write]
14445[indexterm2 write..file_posix]
14446
14447
14448Write to the open file.
14449[heading Synopsis]
14450```
14451std::size_t
14452write(
14453    void const* buffer,
14454    std::size_t n,
14455    error_code& ec);
14456```
14457
14458[heading Description]
14459
14460[heading Parameters]
14461[table [[Name][Description]]
14462  [
14463    [`buffer`
14464    ]
14465    [
14466The buffer holding the data to write
14467    ]
14468  ]
14469  [
14470    [`n`
14471    ]
14472    [
14473The number of bytes to write
14474    ]
14475  ]
14476  [
14477    [`ec`
14478    ]
14479    [
14480Set to the error, if any occurred
14481    ]
14482  ]
14483]
14484
14485[endsect]
14486
14487
14488[endsect]
14489
14490[section:boost__beast__file_stdio file_stdio]
14491
14492An implementation of File which uses cstdio.
14493[heading Synopsis]
14494Defined in header [include_file boost/beast/core/file_stdio.hpp]
14495
14496```
14497class file_stdio
14498```
14499
14500[heading Types]
14501[table [[Name][Description]]
14502  [
14503    [[*[link beast.ref.boost__beast__file_stdio.native_handle_type native_handle_type]]
14504    ]
14505    [
14506
14507The type of the underlying file handle.
14508    ]
14509  ]
14510]
14511[heading Member Functions]
14512[table [[Name][Description]]
14513  [
14514    [[*[link beast.ref.boost__beast__file_stdio.close close]]
14515    ]
14516    [
14517
14518Close the file if open.
14519    ]
14520  ]
14521  [
14522    [[*[link beast.ref.boost__beast__file_stdio.file_stdio file_stdio]]
14523    ]
14524    [
14525
14526Constructor.
14527    ]
14528  ]
14529  [
14530    [[*[link beast.ref.boost__beast__file_stdio.is_open is_open]]
14531    ]
14532    [
14533
14534Returns `true` if the file is open.
14535    ]
14536  ]
14537  [
14538    [[*[link beast.ref.boost__beast__file_stdio.native_handle native_handle]]
14539    ]
14540    [
14541
14542Returns the native handle associated with the file.
14543
14544Set the native handle associated with the file.
14545    ]
14546  ]
14547  [
14548    [[*[link beast.ref.boost__beast__file_stdio.open open]]
14549    ]
14550    [
14551
14552Open a file at the given path with the specified mode.
14553    ]
14554  ]
14555  [
14556    [[*[link beast.ref.boost__beast__file_stdio.operator_eq_ operator=]]
14557    ]
14558    [
14559
14560Assignment.
14561    ]
14562  ]
14563  [
14564    [[*[link beast.ref.boost__beast__file_stdio.pos pos]]
14565    ]
14566    [
14567
14568Return the current position in the open file.
14569    ]
14570  ]
14571  [
14572    [[*[link beast.ref.boost__beast__file_stdio.read read]]
14573    ]
14574    [
14575
14576Read from the open file.
14577    ]
14578  ]
14579  [
14580    [[*[link beast.ref.boost__beast__file_stdio.seek seek]]
14581    ]
14582    [
14583
14584Adjust the current position in the open file.
14585    ]
14586  ]
14587  [
14588    [[*[link beast.ref.boost__beast__file_stdio.size size]]
14589    ]
14590    [
14591
14592Return the size of the open file.
14593    ]
14594  ]
14595  [
14596    [[*[link beast.ref.boost__beast__file_stdio.write write]]
14597    ]
14598    [
14599
14600Write to the open file.
14601    ]
14602  ]
14603  [
14604    [[*[link beast.ref.boost__beast__file_stdio._file_stdio ~file_stdio]]
14605    ]
14606    [
14607
14608Destructor.
14609    ]
14610  ]
14611]
14612[heading Description]
14613This class implements a file using the interfaces present in the C++ Standard Library, in `<stdio>`.
14614
14615[section:native_handle_type file_stdio::native_handle_type]
14616[indexterm2 native_handle_type..file_stdio]
14617
14618
14619The type of the underlying file handle.
14620[heading Synopsis]
14621```
14622using native_handle_type = std::FILE*;
14623```
14624
14625[heading Description]
14626This is platform-specific.
14627
14628[endsect]
14629
14630[section:_file_stdio file_stdio::~file_stdio]
14631[indexterm2 ~file_stdio..file_stdio]
14632
14633
14634Destructor.
14635[heading Synopsis]
14636```
14637~file_stdio();
14638```
14639
14640[heading Description]
14641If the file is open it is first closed.
14642
14643[endsect]
14644
14645[section:file_stdio file_stdio::file_stdio]
14646[indexterm2 file_stdio..file_stdio]
14647
14648
14649Constructor.
14650```
14651``[link beast.ref.boost__beast__file_stdio.file_stdio.overload1 file_stdio]``();
14652  ``[''''&raquo;''' [link beast.ref.boost__beast__file_stdio.file_stdio.overload1 `more...`]]``
14653
14654``[link beast.ref.boost__beast__file_stdio.file_stdio.overload2 file_stdio]``(
14655    file_stdio&& other);
14656  ``[''''&raquo;''' [link beast.ref.boost__beast__file_stdio.file_stdio.overload2 `more...`]]``
14657```
14658
14659[section:overload1 file_stdio::file_stdio (1 of 2 overloads)]
14660
14661Constructor.
14662[heading Synopsis]
14663```
14664file_stdio();
14665```
14666
14667[heading Description]
14668There is no open file initially.
14669
14670[endsect]
14671
14672[section:overload2 file_stdio::file_stdio (2 of 2 overloads)]
14673
14674Constructor.
14675[heading Synopsis]
14676```
14677file_stdio(
14678    file_stdio&& other);
14679```
14680
14681[heading Description]
14682The moved-from object behaves as if default constructed.
14683
14684[endsect]
14685
14686
14687[endsect]
14688
14689[section:operator_eq_ file_stdio::operator=]
14690[indexterm2 operator=..file_stdio]
14691
14692
14693Assignment.
14694[heading Synopsis]
14695```
14696file_stdio&
14697operator=(
14698    file_stdio&& other);
14699```
14700
14701[heading Description]
14702The moved-from object behaves as if default constructed.
14703
14704[endsect]
14705
14706[section:native_handle file_stdio::native_handle]
14707[indexterm2 native_handle..file_stdio]
14708
14709
14710Returns the native handle associated with the file.
14711```
14712std::FILE*
14713``[link beast.ref.boost__beast__file_stdio.native_handle.overload1 native_handle]``() const;
14714  ``[''''&raquo;''' [link beast.ref.boost__beast__file_stdio.native_handle.overload1 `more...`]]``
14715```
14716
14717
14718Set the native handle associated with the file.
14719```
14720void
14721``[link beast.ref.boost__beast__file_stdio.native_handle.overload2 native_handle]``(
14722    std::FILE* f);
14723  ``[''''&raquo;''' [link beast.ref.boost__beast__file_stdio.native_handle.overload2 `more...`]]``
14724```
14725
14726[section:overload1 file_stdio::native_handle (1 of 2 overloads)]
14727
14728Returns the native handle associated with the file.
14729[heading Synopsis]
14730```
14731std::FILE*
14732native_handle() const;
14733```
14734
14735[heading Description]
14736
14737[endsect]
14738
14739[section:overload2 file_stdio::native_handle (2 of 2 overloads)]
14740
14741Set the native handle associated with the file.
14742[heading Synopsis]
14743```
14744void
14745native_handle(
14746    std::FILE* f);
14747```
14748
14749[heading Description]
14750If the file is open it is first closed.
14751
14752[heading Parameters]
14753[table [[Name][Description]]
14754  [
14755    [`f`
14756    ]
14757    [
14758The native file handle to assign.
14759    ]
14760  ]
14761]
14762
14763[endsect]
14764
14765
14766[endsect]
14767
14768[section:is_open file_stdio::is_open]
14769[indexterm2 is_open..file_stdio]
14770
14771
14772Returns `true` if the file is open.
14773[heading Synopsis]
14774```
14775bool
14776is_open() const;
14777```
14778
14779[heading Description]
14780
14781[endsect]
14782
14783[section:close file_stdio::close]
14784[indexterm2 close..file_stdio]
14785
14786
14787Close the file if open.
14788[heading Synopsis]
14789```
14790void
14791close(
14792    error_code& ec);
14793```
14794
14795[heading Description]
14796
14797[heading Parameters]
14798[table [[Name][Description]]
14799  [
14800    [`ec`
14801    ]
14802    [
14803Set to the error, if any occurred.
14804    ]
14805  ]
14806]
14807
14808[endsect]
14809
14810[section:open file_stdio::open]
14811[indexterm2 open..file_stdio]
14812
14813
14814Open a file at the given path with the specified mode.
14815[heading Synopsis]
14816```
14817void
14818open(
14819    char const* path,
14820    file_mode mode,
14821    error_code& ec);
14822```
14823
14824[heading Description]
14825
14826[heading Parameters]
14827[table [[Name][Description]]
14828  [
14829    [`path`
14830    ]
14831    [
14832The utf-8 encoded path to the file
14833    ]
14834  ]
14835  [
14836    [`mode`
14837    ]
14838    [
14839The file mode to use
14840    ]
14841  ]
14842  [
14843    [`ec`
14844    ]
14845    [
14846Set to the error, if any occurred
14847    ]
14848  ]
14849]
14850
14851[endsect]
14852
14853[section:size file_stdio::size]
14854[indexterm2 size..file_stdio]
14855
14856
14857Return the size of the open file.
14858[heading Synopsis]
14859```
14860std::uint64_t
14861size(
14862    error_code& ec) const;
14863```
14864
14865[heading Description]
14866
14867[heading Parameters]
14868[table [[Name][Description]]
14869  [
14870    [`ec`
14871    ]
14872    [
14873Set to the error, if any occurred
14874    ]
14875  ]
14876]
14877[heading Return Value]
14878The size in bytes
14879
14880[endsect]
14881
14882[section:pos file_stdio::pos]
14883[indexterm2 pos..file_stdio]
14884
14885
14886Return the current position in the open file.
14887[heading Synopsis]
14888```
14889std::uint64_t
14890pos(
14891    error_code& ec) const;
14892```
14893
14894[heading Description]
14895
14896[heading Parameters]
14897[table [[Name][Description]]
14898  [
14899    [`ec`
14900    ]
14901    [
14902Set to the error, if any occurred
14903    ]
14904  ]
14905]
14906[heading Return Value]
14907The offset in bytes from the beginning of the file
14908
14909[endsect]
14910
14911[section:seek file_stdio::seek]
14912[indexterm2 seek..file_stdio]
14913
14914
14915Adjust the current position in the open file.
14916[heading Synopsis]
14917```
14918void
14919seek(
14920    std::uint64_t offset,
14921    error_code& ec);
14922```
14923
14924[heading Description]
14925
14926[heading Parameters]
14927[table [[Name][Description]]
14928  [
14929    [`offset`
14930    ]
14931    [
14932The offset in bytes from the beginning of the file
14933    ]
14934  ]
14935  [
14936    [`ec`
14937    ]
14938    [
14939Set to the error, if any occurred
14940    ]
14941  ]
14942]
14943
14944[endsect]
14945
14946[section:read file_stdio::read]
14947[indexterm2 read..file_stdio]
14948
14949
14950Read from the open file.
14951[heading Synopsis]
14952```
14953std::size_t
14954read(
14955    void* buffer,
14956    std::size_t n,
14957    error_code& ec) const;
14958```
14959
14960[heading Description]
14961
14962[heading Parameters]
14963[table [[Name][Description]]
14964  [
14965    [`buffer`
14966    ]
14967    [
14968The buffer for storing the result of the read
14969    ]
14970  ]
14971  [
14972    [`n`
14973    ]
14974    [
14975The number of bytes to read
14976    ]
14977  ]
14978  [
14979    [`ec`
14980    ]
14981    [
14982Set to the error, if any occurred
14983    ]
14984  ]
14985]
14986
14987[endsect]
14988
14989[section:write file_stdio::write]
14990[indexterm2 write..file_stdio]
14991
14992
14993Write to the open file.
14994[heading Synopsis]
14995```
14996std::size_t
14997write(
14998    void const* buffer,
14999    std::size_t n,
15000    error_code& ec);
15001```
15002
15003[heading Description]
15004
15005[heading Parameters]
15006[table [[Name][Description]]
15007  [
15008    [`buffer`
15009    ]
15010    [
15011The buffer holding the data to write
15012    ]
15013  ]
15014  [
15015    [`n`
15016    ]
15017    [
15018The number of bytes to write
15019    ]
15020  ]
15021  [
15022    [`ec`
15023    ]
15024    [
15025Set to the error, if any occurred
15026    ]
15027  ]
15028]
15029
15030[endsect]
15031
15032
15033[endsect]
15034
15035[section:boost__beast__file_win32 file_win32]
15036
15037An implementation of File for Win32.
15038[heading Synopsis]
15039Defined in header [include_file boost/beast/core/file_win32.hpp]
15040
15041```
15042class file_win32
15043```
15044
15045[heading Types]
15046[table [[Name][Description]]
15047  [
15048    [[*[link beast.ref.boost__beast__file_win32.native_handle_type native_handle_type]]
15049    ]
15050    [
15051
15052The type of the underlying file handle.
15053    ]
15054  ]
15055]
15056[heading Member Functions]
15057[table [[Name][Description]]
15058  [
15059    [[*[link beast.ref.boost__beast__file_win32.close close]]
15060    ]
15061    [
15062
15063Close the file if open.
15064    ]
15065  ]
15066  [
15067    [[*[link beast.ref.boost__beast__file_win32.file_win32 file_win32]]
15068    ]
15069    [
15070
15071Constructor.
15072    ]
15073  ]
15074  [
15075    [[*[link beast.ref.boost__beast__file_win32.is_open is_open]]
15076    ]
15077    [
15078
15079Returns `true` if the file is open.
15080    ]
15081  ]
15082  [
15083    [[*[link beast.ref.boost__beast__file_win32.native_handle native_handle]]
15084    ]
15085    [
15086
15087Returns the native handle associated with the file.
15088
15089Set the native handle associated with the file.
15090    ]
15091  ]
15092  [
15093    [[*[link beast.ref.boost__beast__file_win32.open open]]
15094    ]
15095    [
15096
15097Open a file at the given path with the specified mode.
15098    ]
15099  ]
15100  [
15101    [[*[link beast.ref.boost__beast__file_win32.operator_eq_ operator=]]
15102    ]
15103    [
15104
15105Assignment.
15106    ]
15107  ]
15108  [
15109    [[*[link beast.ref.boost__beast__file_win32.pos pos]]
15110    ]
15111    [
15112
15113Return the current position in the open file.
15114    ]
15115  ]
15116  [
15117    [[*[link beast.ref.boost__beast__file_win32.read read]]
15118    ]
15119    [
15120
15121Read from the open file.
15122    ]
15123  ]
15124  [
15125    [[*[link beast.ref.boost__beast__file_win32.seek seek]]
15126    ]
15127    [
15128
15129Adjust the current position in the open file.
15130    ]
15131  ]
15132  [
15133    [[*[link beast.ref.boost__beast__file_win32.size size]]
15134    ]
15135    [
15136
15137Return the size of the open file.
15138    ]
15139  ]
15140  [
15141    [[*[link beast.ref.boost__beast__file_win32.write write]]
15142    ]
15143    [
15144
15145Write to the open file.
15146    ]
15147  ]
15148  [
15149    [[*[link beast.ref.boost__beast__file_win32._file_win32 ~file_win32]]
15150    ]
15151    [
15152
15153Destructor.
15154    ]
15155  ]
15156]
15157[heading Description]
15158This class implements a ['File] using Win32 native interfaces.
15159
15160[section:native_handle_type file_win32::native_handle_type]
15161[indexterm2 native_handle_type..file_win32]
15162
15163
15164The type of the underlying file handle.
15165[heading Synopsis]
15166```
15167using native_handle_type = HANDLE;
15168```
15169
15170[heading Description]
15171This is platform-specific.
15172
15173[endsect]
15174
15175[section:_file_win32 file_win32::~file_win32]
15176[indexterm2 ~file_win32..file_win32]
15177
15178
15179Destructor.
15180[heading Synopsis]
15181```
15182~file_win32();
15183```
15184
15185[heading Description]
15186If the file is open it is first closed.
15187
15188[endsect]
15189
15190[section:file_win32 file_win32::file_win32]
15191[indexterm2 file_win32..file_win32]
15192
15193
15194Constructor.
15195```
15196``[link beast.ref.boost__beast__file_win32.file_win32.overload1 file_win32]``();
15197  ``[''''&raquo;''' [link beast.ref.boost__beast__file_win32.file_win32.overload1 `more...`]]``
15198
15199``[link beast.ref.boost__beast__file_win32.file_win32.overload2 file_win32]``(
15200    file_win32&& other);
15201  ``[''''&raquo;''' [link beast.ref.boost__beast__file_win32.file_win32.overload2 `more...`]]``
15202```
15203
15204[section:overload1 file_win32::file_win32 (1 of 2 overloads)]
15205
15206Constructor.
15207[heading Synopsis]
15208```
15209file_win32();
15210```
15211
15212[heading Description]
15213There is no open file initially.
15214
15215[endsect]
15216
15217[section:overload2 file_win32::file_win32 (2 of 2 overloads)]
15218
15219Constructor.
15220[heading Synopsis]
15221```
15222file_win32(
15223    file_win32&& other);
15224```
15225
15226[heading Description]
15227The moved-from object behaves as if default constructed.
15228
15229[endsect]
15230
15231
15232[endsect]
15233
15234[section:operator_eq_ file_win32::operator=]
15235[indexterm2 operator=..file_win32]
15236
15237
15238Assignment.
15239[heading Synopsis]
15240```
15241file_win32&
15242operator=(
15243    file_win32&& other);
15244```
15245
15246[heading Description]
15247The moved-from object behaves as if default constructed.
15248
15249[endsect]
15250
15251[section:native_handle file_win32::native_handle]
15252[indexterm2 native_handle..file_win32]
15253
15254
15255Returns the native handle associated with the file.
15256```
15257native_handle_type
15258``[link beast.ref.boost__beast__file_win32.native_handle.overload1 native_handle]``();
15259  ``[''''&raquo;''' [link beast.ref.boost__beast__file_win32.native_handle.overload1 `more...`]]``
15260```
15261
15262
15263Set the native handle associated with the file.
15264```
15265void
15266``[link beast.ref.boost__beast__file_win32.native_handle.overload2 native_handle]``(
15267    native_handle_type h);
15268  ``[''''&raquo;''' [link beast.ref.boost__beast__file_win32.native_handle.overload2 `more...`]]``
15269```
15270
15271[section:overload1 file_win32::native_handle (1 of 2 overloads)]
15272
15273Returns the native handle associated with the file.
15274[heading Synopsis]
15275```
15276native_handle_type
15277native_handle();
15278```
15279
15280[heading Description]
15281
15282[endsect]
15283
15284[section:overload2 file_win32::native_handle (2 of 2 overloads)]
15285
15286Set the native handle associated with the file.
15287[heading Synopsis]
15288```
15289void
15290native_handle(
15291    native_handle_type h);
15292```
15293
15294[heading Description]
15295If the file is open it is first closed.
15296
15297[heading Parameters]
15298[table [[Name][Description]]
15299  [
15300    [`h`
15301    ]
15302    [
15303The native file handle to assign.
15304    ]
15305  ]
15306]
15307
15308[endsect]
15309
15310
15311[endsect]
15312
15313[section:is_open file_win32::is_open]
15314[indexterm2 is_open..file_win32]
15315
15316
15317Returns `true` if the file is open.
15318[heading Synopsis]
15319```
15320bool
15321is_open() const;
15322```
15323
15324[heading Description]
15325
15326[endsect]
15327
15328[section:close file_win32::close]
15329[indexterm2 close..file_win32]
15330
15331
15332Close the file if open.
15333[heading Synopsis]
15334```
15335void
15336close(
15337    error_code& ec);
15338```
15339
15340[heading Description]
15341
15342[heading Parameters]
15343[table [[Name][Description]]
15344  [
15345    [`ec`
15346    ]
15347    [
15348Set to the error, if any occurred.
15349    ]
15350  ]
15351]
15352
15353[endsect]
15354
15355[section:open file_win32::open]
15356[indexterm2 open..file_win32]
15357
15358
15359Open a file at the given path with the specified mode.
15360[heading Synopsis]
15361```
15362void
15363open(
15364    char const* path,
15365    file_mode mode,
15366    error_code& ec);
15367```
15368
15369[heading Description]
15370
15371[heading Parameters]
15372[table [[Name][Description]]
15373  [
15374    [`path`
15375    ]
15376    [
15377The utf-8 encoded path to the file
15378    ]
15379  ]
15380  [
15381    [`mode`
15382    ]
15383    [
15384The file mode to use
15385    ]
15386  ]
15387  [
15388    [`ec`
15389    ]
15390    [
15391Set to the error, if any occurred
15392    ]
15393  ]
15394]
15395
15396[endsect]
15397
15398[section:size file_win32::size]
15399[indexterm2 size..file_win32]
15400
15401
15402Return the size of the open file.
15403[heading Synopsis]
15404```
15405std::uint64_t
15406size(
15407    error_code& ec) const;
15408```
15409
15410[heading Description]
15411
15412[heading Parameters]
15413[table [[Name][Description]]
15414  [
15415    [`ec`
15416    ]
15417    [
15418Set to the error, if any occurred
15419    ]
15420  ]
15421]
15422[heading Return Value]
15423The size in bytes
15424
15425[endsect]
15426
15427[section:pos file_win32::pos]
15428[indexterm2 pos..file_win32]
15429
15430
15431Return the current position in the open file.
15432[heading Synopsis]
15433```
15434std::uint64_t
15435pos(
15436    error_code& ec);
15437```
15438
15439[heading Description]
15440
15441[heading Parameters]
15442[table [[Name][Description]]
15443  [
15444    [`ec`
15445    ]
15446    [
15447Set to the error, if any occurred
15448    ]
15449  ]
15450]
15451[heading Return Value]
15452The offset in bytes from the beginning of the file
15453
15454[endsect]
15455
15456[section:seek file_win32::seek]
15457[indexterm2 seek..file_win32]
15458
15459
15460Adjust the current position in the open file.
15461[heading Synopsis]
15462```
15463void
15464seek(
15465    std::uint64_t offset,
15466    error_code& ec);
15467```
15468
15469[heading Description]
15470
15471[heading Parameters]
15472[table [[Name][Description]]
15473  [
15474    [`offset`
15475    ]
15476    [
15477The offset in bytes from the beginning of the file
15478    ]
15479  ]
15480  [
15481    [`ec`
15482    ]
15483    [
15484Set to the error, if any occurred
15485    ]
15486  ]
15487]
15488
15489[endsect]
15490
15491[section:read file_win32::read]
15492[indexterm2 read..file_win32]
15493
15494
15495Read from the open file.
15496[heading Synopsis]
15497```
15498std::size_t
15499read(
15500    void* buffer,
15501    std::size_t n,
15502    error_code& ec);
15503```
15504
15505[heading Description]
15506
15507[heading Parameters]
15508[table [[Name][Description]]
15509  [
15510    [`buffer`
15511    ]
15512    [
15513The buffer for storing the result of the read
15514    ]
15515  ]
15516  [
15517    [`n`
15518    ]
15519    [
15520The number of bytes to read
15521    ]
15522  ]
15523  [
15524    [`ec`
15525    ]
15526    [
15527Set to the error, if any occurred
15528    ]
15529  ]
15530]
15531
15532[endsect]
15533
15534[section:write file_win32::write]
15535[indexterm2 write..file_win32]
15536
15537
15538Write to the open file.
15539[heading Synopsis]
15540```
15541std::size_t
15542write(
15543    void const* buffer,
15544    std::size_t n,
15545    error_code& ec);
15546```
15547
15548[heading Description]
15549
15550[heading Parameters]
15551[table [[Name][Description]]
15552  [
15553    [`buffer`
15554    ]
15555    [
15556The buffer holding the data to write
15557    ]
15558  ]
15559  [
15560    [`n`
15561    ]
15562    [
15563The number of bytes to write
15564    ]
15565  ]
15566  [
15567    [`ec`
15568    ]
15569    [
15570Set to the error, if any occurred
15571    ]
15572  ]
15573]
15574
15575[endsect]
15576
15577
15578[endsect]
15579
15580[section:boost__beast__flat_static_buffer flat_static_buffer]
15581
15582A ['DynamicBuffer] with a fixed size internal buffer.
15583[heading Synopsis]
15584Defined in header [include_file boost/beast/core/flat_static_buffer.hpp]
15585
15586```
15587template<
15588    std::size_t N>
15589class flat_static_buffer :
15590    public flat_static_buffer_base
15591```
15592
15593[heading Types]
15594[table [[Name][Description]]
15595  [
15596    [[*[link beast.ref.boost__beast__flat_static_buffer.const_buffers_type const_buffers_type]]
15597    ]
15598    [
15599
15600The ConstBufferSequence used to represent the readable bytes.
15601    ]
15602  ]
15603  [
15604    [[*[link beast.ref.boost__beast__flat_static_buffer.mutable_buffers_type mutable_buffers_type]]
15605    ]
15606    [
15607
15608The MutableBufferSequence used to represent the writable bytes.
15609    ]
15610  ]
15611]
15612[heading Member Functions]
15613[table [[Name][Description]]
15614  [
15615    [[*[link beast.ref.boost__beast__flat_static_buffer.base base]]
15616    ]
15617    [
15618
15619Returns the [link beast.ref.boost__beast__flat_static_buffer_base `flat_static_buffer_base`] portion of this object.
15620    ]
15621  ]
15622  [
15623    [[*[link beast.ref.boost__beast__flat_static_buffer.capacity capacity]]
15624    ]
15625    [
15626
15627Return the maximum sum of input and output sizes that can be held without an allocation.
15628    ]
15629  ]
15630  [
15631    [[*[link beast.ref.boost__beast__flat_static_buffer.cdata cdata]]
15632    ]
15633    [
15634
15635Returns a constant buffer sequence representing the readable bytes.
15636    ]
15637  ]
15638  [
15639    [[*[link beast.ref.boost__beast__flat_static_buffer.clear clear]]
15640    ]
15641    [
15642
15643Clear the readable and writable bytes to zero.
15644    ]
15645  ]
15646  [
15647    [[*[link beast.ref.boost__beast__flat_static_buffer.commit commit]]
15648    ]
15649    [
15650
15651Append writable bytes to the readable bytes.
15652    ]
15653  ]
15654  [
15655    [[*[link beast.ref.boost__beast__flat_static_buffer.consume consume]]
15656    ]
15657    [
15658
15659Remove bytes from beginning of the readable bytes.
15660    ]
15661  ]
15662  [
15663    [[*[link beast.ref.boost__beast__flat_static_buffer.data data]]
15664    ]
15665    [
15666
15667Returns a constant buffer sequence representing the readable bytes.
15668
15669Returns a mutable buffer sequence representing the readable bytes.
15670    ]
15671  ]
15672  [
15673    [[*[link beast.ref.boost__beast__flat_static_buffer.flat_static_buffer flat_static_buffer]]
15674    ]
15675    [
15676
15677Constructor.
15678    ]
15679  ]
15680  [
15681    [[*[link beast.ref.boost__beast__flat_static_buffer.max_size max_size]]
15682    ]
15683    [
15684
15685Return the maximum sum of the input and output sequence sizes.
15686    ]
15687  ]
15688  [
15689    [[*[link beast.ref.boost__beast__flat_static_buffer.operator_eq_ operator=]]
15690    ]
15691    [
15692
15693Assignment.
15694    ]
15695  ]
15696  [
15697    [[*[link beast.ref.boost__beast__flat_static_buffer.prepare prepare]]
15698    ]
15699    [
15700
15701Returns a mutable buffer sequence representing writable bytes.
15702    ]
15703  ]
15704  [
15705    [[*[link beast.ref.boost__beast__flat_static_buffer.size size]]
15706    ]
15707    [
15708
15709Returns the number of readable bytes.
15710    ]
15711  ]
15712]
15713[heading Protected Member Functions]
15714[table [[Name][Description]]
15715  [
15716    [[*[link beast.ref.boost__beast__flat_static_buffer.reset reset]]
15717    ]
15718    [
15719
15720Reset the pointed-to buffer.
15721    ]
15722  ]
15723]
15724[heading Description]
15725Buffer sequences returned by [link beast.ref.boost__beast__flat_static_buffer.data `data`] and [link beast.ref.boost__beast__flat_static_buffer.prepare `prepare`] will always be of length one. This implements a dynamic buffer using no memory allocations.
15726
15727[heading Template Parameters]
15728[table [[Type][Description]]
15729  [
15730    [`N`
15731    ]
15732    [
15733The number of bytes in the internal buffer.
15734    ]
15735  ]
15736]
15737[heading Remarks]
15738To reduce the number of template instantiations when passing objects of this type in a deduced context, the signature of the receiving function should use [link beast.ref.boost__beast__flat_static_buffer_base `flat_static_buffer_base`] instead.
15739[heading See Also]
15740[link beast.ref.boost__beast__flat_static_buffer_base `flat_static_buffer_base`]
15741
15742[section:flat_static_buffer flat_static_buffer::flat_static_buffer]
15743[indexterm2 flat_static_buffer..flat_static_buffer]
15744
15745
15746Constructor.
15747```
15748``[link beast.ref.boost__beast__flat_static_buffer.flat_static_buffer.overload1 flat_static_buffer]``(
15749    flat_static_buffer const&);
15750  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_static_buffer.flat_static_buffer.overload1 `more...`]]``
15751
15752``[link beast.ref.boost__beast__flat_static_buffer.flat_static_buffer.overload2 flat_static_buffer]``();
15753  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_static_buffer.flat_static_buffer.overload2 `more...`]]``
15754```
15755
15756[section:overload1 flat_static_buffer::flat_static_buffer (1 of 2 overloads)]
15757
15758Constructor.
15759[heading Synopsis]
15760```
15761flat_static_buffer(
15762    flat_static_buffer const&);
15763```
15764
15765[heading Description]
15766
15767[endsect]
15768
15769[section:overload2 flat_static_buffer::flat_static_buffer (2 of 2 overloads)]
15770
15771Constructor.
15772[heading Synopsis]
15773```
15774flat_static_buffer();
15775```
15776
15777[heading Description]
15778
15779[endsect]
15780
15781
15782[endsect]
15783
15784[section:operator_eq_ flat_static_buffer::operator=]
15785[indexterm2 operator=..flat_static_buffer]
15786
15787
15788Assignment.
15789[heading Synopsis]
15790```
15791flat_static_buffer&
15792operator=(
15793    flat_static_buffer const&);
15794```
15795
15796[heading Description]
15797
15798[endsect]
15799
15800[section:base flat_static_buffer::base]
15801[indexterm2 base..flat_static_buffer]
15802
15803
15804Returns the [link beast.ref.boost__beast__flat_static_buffer_base `flat_static_buffer_base`] portion of this object.
15805```
15806flat_static_buffer_base&
15807``[link beast.ref.boost__beast__flat_static_buffer.base.overload1 base]``();
15808  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_static_buffer.base.overload1 `more...`]]``
15809
15810flat_static_buffer_base const&
15811``[link beast.ref.boost__beast__flat_static_buffer.base.overload2 base]``() const;
15812  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_static_buffer.base.overload2 `more...`]]``
15813```
15814
15815[section:overload1 flat_static_buffer::base (1 of 2 overloads)]
15816
15817Returns the [link beast.ref.boost__beast__flat_static_buffer_base `flat_static_buffer_base`] portion of this object.
15818[heading Synopsis]
15819```
15820flat_static_buffer_base&
15821base();
15822```
15823
15824[heading Description]
15825
15826[endsect]
15827
15828[section:overload2 flat_static_buffer::base (2 of 2 overloads)]
15829
15830Returns the [link beast.ref.boost__beast__flat_static_buffer_base `flat_static_buffer_base`] portion of this object.
15831[heading Synopsis]
15832```
15833flat_static_buffer_base const&
15834base() const;
15835```
15836
15837[heading Description]
15838
15839[endsect]
15840
15841
15842[endsect]
15843
15844[section:max_size flat_static_buffer::max_size]
15845[indexterm2 max_size..flat_static_buffer]
15846
15847
15848Return the maximum sum of the input and output sequence sizes.
15849[heading Synopsis]
15850```
15851std::size_t constexpr
15852max_size() const;
15853```
15854
15855[heading Description]
15856
15857[endsect]
15858
15859[section:capacity flat_static_buffer::capacity]
15860[indexterm2 capacity..flat_static_buffer]
15861
15862
15863Return the maximum sum of input and output sizes that can be held without an allocation.
15864[heading Synopsis]
15865```
15866std::size_t constexpr
15867capacity() const;
15868```
15869
15870[heading Description]
15871
15872[endsect]
15873
15874[section:clear flat_static_buffer::clear]
15875[indexterm2 clear..flat_static_buffer]
15876
15877
15878Clear the readable and writable bytes to zero.
15879[heading Synopsis]
15880```
15881void
15882clear();
15883```
15884
15885[heading Description]
15886This function causes the readable and writable bytes to become empty. The capacity is not changed.
15887Buffer sequences previously obtained using [link beast.ref.boost__beast__flat_static_buffer.data `data`] or [link beast.ref.boost__beast__flat_static_buffer.prepare `prepare`] become invalid.
15888
15889[heading Exception Safety]
15890
15891No-throw guarantee.
15892
15893[endsect]
15894
15895[section:size flat_static_buffer::size]
15896[indexterm2 size..flat_static_buffer]
15897
15898
15899Returns the number of readable bytes.
15900[heading Synopsis]
15901```
15902std::size_t
15903size() const;
15904```
15905
15906[heading Description]
15907
15908[endsect]
15909
15910[section:data flat_static_buffer::data]
15911[indexterm2 data..flat_static_buffer]
15912
15913
15914Returns a constant buffer sequence representing the readable bytes.
15915```
15916const_buffers_type
15917``[link beast.ref.boost__beast__flat_static_buffer.data.overload1 data]``() const;
15918  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_static_buffer.data.overload1 `more...`]]``
15919```
15920
15921
15922Returns a mutable buffer sequence representing the readable bytes.
15923```
15924mutable_buffers_type
15925``[link beast.ref.boost__beast__flat_static_buffer.data.overload2 data]``();
15926  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_static_buffer.data.overload2 `more...`]]``
15927```
15928
15929[section:overload1 flat_static_buffer::data (1 of 2 overloads)]
15930
15931Returns a constant buffer sequence representing the readable bytes.
15932[heading Synopsis]
15933```
15934const_buffers_type
15935data() const;
15936```
15937
15938[heading Description]
15939
15940[endsect]
15941
15942[section:overload2 flat_static_buffer::data (2 of 2 overloads)]
15943
15944Returns a mutable buffer sequence representing the readable bytes.
15945[heading Synopsis]
15946```
15947mutable_buffers_type
15948data();
15949```
15950
15951[heading Description]
15952
15953[endsect]
15954
15955
15956[endsect]
15957
15958[section:cdata flat_static_buffer::cdata]
15959[indexterm2 cdata..flat_static_buffer]
15960
15961
15962Returns a constant buffer sequence representing the readable bytes.
15963[heading Synopsis]
15964```
15965const_buffers_type
15966cdata() const;
15967```
15968
15969[heading Description]
15970
15971[endsect]
15972
15973[section:prepare flat_static_buffer::prepare]
15974[indexterm2 prepare..flat_static_buffer]
15975
15976
15977Returns a mutable buffer sequence representing writable bytes.
15978[heading Synopsis]
15979```
15980mutable_buffers_type
15981prepare(
15982    std::size_t n);
15983```
15984
15985[heading Description]
15986Returns a mutable buffer sequence representing the writable bytes containing exactly `n` bytes of storage.
15987All buffers sequences previously obtained using [link beast.ref.boost__beast__flat_static_buffer.data `data`] or [link beast.ref.boost__beast__flat_static_buffer.prepare `prepare`] are invalidated.
15988
15989[heading Parameters]
15990[table [[Name][Description]]
15991  [
15992    [`n`
15993    ]
15994    [
15995The desired number of bytes in the returned buffer sequence.
15996    ]
15997  ]
15998]
15999[heading Exceptions]
16000[table [[Type][Thrown On]]
16001  [
16002    [`std::length_error`
16003    ]
16004    [
16005if [link beast.ref.boost__beast__flat_static_buffer.size `size()`] + n exceeds [link beast.ref.boost__beast__flat_static_buffer_base.max_size `max_size()`].
16006    ]
16007  ]
16008]
16009[heading Exception Safety]
16010
16011Strong guarantee.
16012
16013[endsect]
16014
16015[section:commit flat_static_buffer::commit]
16016[indexterm2 commit..flat_static_buffer]
16017
16018
16019Append writable bytes to the readable bytes.
16020[heading Synopsis]
16021```
16022void
16023commit(
16024    std::size_t n);
16025```
16026
16027[heading Description]
16028Appends n bytes from the start of the writable bytes to the end of the readable bytes. The remainder of the writable bytes are discarded. If n is greater than the number of writable bytes, all writable bytes are appended to the readable bytes.
16029All buffers sequences previously obtained using [link beast.ref.boost__beast__flat_static_buffer.data `data`] or [link beast.ref.boost__beast__flat_static_buffer.prepare `prepare`] are invalidated.
16030
16031[heading Parameters]
16032[table [[Name][Description]]
16033  [
16034    [`n`
16035    ]
16036    [
16037The number of bytes to append. If this number is greater than the number of writable bytes, all writable bytes are appended.
16038    ]
16039  ]
16040]
16041[heading Exception Safety]
16042
16043No-throw guarantee.
16044
16045[endsect]
16046
16047[section:consume flat_static_buffer::consume]
16048[indexterm2 consume..flat_static_buffer]
16049
16050
16051Remove bytes from beginning of the readable bytes.
16052[heading Synopsis]
16053```
16054void
16055consume(
16056    std::size_t n);
16057```
16058
16059[heading Description]
16060Removes n bytes from the beginning of the readable bytes.
16061All buffers sequences previously obtained using [link beast.ref.boost__beast__flat_static_buffer.data `data`] or [link beast.ref.boost__beast__flat_static_buffer.prepare `prepare`] are invalidated.
16062
16063[heading Parameters]
16064[table [[Name][Description]]
16065  [
16066    [`n`
16067    ]
16068    [
16069The number of bytes to remove. If this number is greater than the number of readable bytes, all readable bytes are removed.
16070    ]
16071  ]
16072]
16073[heading Exception Safety]
16074
16075No-throw guarantee.
16076
16077[endsect]
16078
16079[section:const_buffers_type flat_static_buffer::const_buffers_type]
16080[indexterm2 const_buffers_type..flat_static_buffer]
16081
16082
16083The ConstBufferSequence used to represent the readable bytes.
16084[heading Synopsis]
16085```
16086using const_buffers_type = net::const_buffer;
16087```
16088
16089[heading Description]
16090
16091[endsect]
16092
16093[section:mutable_buffers_type flat_static_buffer::mutable_buffers_type]
16094[indexterm2 mutable_buffers_type..flat_static_buffer]
16095
16096
16097The MutableBufferSequence used to represent the writable bytes.
16098[heading Synopsis]
16099```
16100using mutable_buffers_type = net::mutable_buffer;
16101```
16102
16103[heading Description]
16104
16105[endsect]
16106
16107[section:reset flat_static_buffer::reset]
16108[indexterm2 reset..flat_static_buffer]
16109
16110
16111Reset the pointed-to buffer.
16112[heading Synopsis]
16113```
16114void
16115reset(
16116    void* p,
16117    std::size_t n);
16118```
16119
16120[heading Description]
16121This function resets the internal state to the buffer provided. All input and output sequences are invalidated. This function allows the derived class to construct its members before initializing the static buffer.
16122
16123[heading Parameters]
16124[table [[Name][Description]]
16125  [
16126    [`p`
16127    ]
16128    [
16129A pointer to valid storage of at least `n` bytes.
16130    ]
16131  ]
16132  [
16133    [`n`
16134    ]
16135    [
16136The number of valid bytes pointed to by `p`.
16137    ]
16138  ]
16139]
16140[heading Exception Safety]
16141
16142No-throw guarantee.
16143
16144[endsect]
16145
16146
16147[endsect]
16148
16149[section:boost__beast__flat_static_buffer_base flat_static_buffer_base]
16150
16151A dynamic buffer using a fixed size internal buffer.
16152[heading Synopsis]
16153Defined in header [include_file boost/beast/core/flat_static_buffer.hpp]
16154
16155```
16156class flat_static_buffer_base
16157```
16158
16159[heading Types]
16160[table [[Name][Description]]
16161  [
16162    [[*[link beast.ref.boost__beast__flat_static_buffer_base.const_buffers_type const_buffers_type]]
16163    ]
16164    [
16165
16166The ConstBufferSequence used to represent the readable bytes.
16167    ]
16168  ]
16169  [
16170    [[*[link beast.ref.boost__beast__flat_static_buffer_base.mutable_buffers_type mutable_buffers_type]]
16171    ]
16172    [
16173
16174The MutableBufferSequence used to represent the writable bytes.
16175    ]
16176  ]
16177]
16178[heading Member Functions]
16179[table [[Name][Description]]
16180  [
16181    [[*[link beast.ref.boost__beast__flat_static_buffer_base.capacity capacity]]
16182    ]
16183    [
16184
16185Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
16186    ]
16187  ]
16188  [
16189    [[*[link beast.ref.boost__beast__flat_static_buffer_base.cdata cdata]]
16190    ]
16191    [
16192
16193Returns a constant buffer sequence representing the readable bytes.
16194    ]
16195  ]
16196  [
16197    [[*[link beast.ref.boost__beast__flat_static_buffer_base.clear clear]]
16198    ]
16199    [
16200
16201Clear the readable and writable bytes to zero.
16202    ]
16203  ]
16204  [
16205    [[*[link beast.ref.boost__beast__flat_static_buffer_base.commit commit]]
16206    ]
16207    [
16208
16209Append writable bytes to the readable bytes.
16210    ]
16211  ]
16212  [
16213    [[*[link beast.ref.boost__beast__flat_static_buffer_base.consume consume]]
16214    ]
16215    [
16216
16217Remove bytes from beginning of the readable bytes.
16218    ]
16219  ]
16220  [
16221    [[*[link beast.ref.boost__beast__flat_static_buffer_base.data data]]
16222    ]
16223    [
16224
16225Returns a constant buffer sequence representing the readable bytes.
16226
16227Returns a mutable buffer sequence representing the readable bytes.
16228    ]
16229  ]
16230  [
16231    [[*[link beast.ref.boost__beast__flat_static_buffer_base.flat_static_buffer_base flat_static_buffer_base]]
16232    ]
16233    [
16234
16235Constructor.
16236    ]
16237  ]
16238  [
16239    [[*[link beast.ref.boost__beast__flat_static_buffer_base.max_size max_size]]
16240    ]
16241    [
16242
16243Return the maximum number of bytes, both readable and writable, that can ever be held.
16244    ]
16245  ]
16246  [
16247    [[*[link beast.ref.boost__beast__flat_static_buffer_base.prepare prepare]]
16248    ]
16249    [
16250
16251Returns a mutable buffer sequence representing writable bytes.
16252    ]
16253  ]
16254  [
16255    [[*[link beast.ref.boost__beast__flat_static_buffer_base.size size]]
16256    ]
16257    [
16258
16259Returns the number of readable bytes.
16260    ]
16261  ]
16262]
16263[heading Protected Member Functions]
16264[table [[Name][Description]]
16265  [
16266    [[*[link beast.ref.boost__beast__flat_static_buffer_base.flat_static_buffer_base flat_static_buffer_base]]
16267    ]
16268    [
16269
16270Constructor.
16271    ]
16272  ]
16273  [
16274    [[*[link beast.ref.boost__beast__flat_static_buffer_base.reset reset]]
16275    ]
16276    [
16277
16278Reset the pointed-to buffer.
16279    ]
16280  ]
16281]
16282[heading Description]
16283A dynamic buffer encapsulates memory storage that may be automatically resized as required, where the memory is divided into two regions: readable bytes followed by writable bytes. These memory regions are internal to the dynamic buffer, but direct access to the elements is provided to permit them to be efficiently used with I/O operations.
16284Objects of this type meet the requirements of ['DynamicBuffer] and have the following additional properties:
16285
16286* A mutable buffer sequence representing the readable bytes is returned by [link beast.ref.boost__beast__flat_static_buffer_base.data `data`] when `this` is non-const.
16287
16288* Buffer sequences representing the readable and writable bytes, returned by [link beast.ref.boost__beast__flat_static_buffer_base.data `data`] and [link beast.ref.boost__beast__flat_static_buffer_base.prepare `prepare`], will have length one.
16289
16290* Ownership of the underlying storage belongs to the derived class.
16291
16292[heading Remarks]
16293Variables are usually declared using the template class [link beast.ref.boost__beast__flat_static_buffer `flat_static_buffer`]; however, to reduce the number of template instantiations, objects should be passed [link beast.ref.boost__beast__flat_static_buffer_base `flat_static_buffer_base`]&.
16294[heading See Also]
16295[link beast.ref.boost__beast__flat_static_buffer `flat_static_buffer`]
16296
16297[section:const_buffers_type flat_static_buffer_base::const_buffers_type]
16298[indexterm2 const_buffers_type..flat_static_buffer_base]
16299
16300
16301The ConstBufferSequence used to represent the readable bytes.
16302[heading Synopsis]
16303```
16304using const_buffers_type = net::const_buffer;
16305```
16306
16307[heading Description]
16308
16309[endsect]
16310
16311[section:mutable_buffers_type flat_static_buffer_base::mutable_buffers_type]
16312[indexterm2 mutable_buffers_type..flat_static_buffer_base]
16313
16314
16315The MutableBufferSequence used to represent the writable bytes.
16316[heading Synopsis]
16317```
16318using mutable_buffers_type = net::mutable_buffer;
16319```
16320
16321[heading Description]
16322
16323[endsect]
16324
16325[section:flat_static_buffer_base flat_static_buffer_base::flat_static_buffer_base]
16326[indexterm2 flat_static_buffer_base..flat_static_buffer_base]
16327
16328
16329Constructor.
16330```
16331``[link beast.ref.boost__beast__flat_static_buffer_base.flat_static_buffer_base.overload1 flat_static_buffer_base]``(
16332    void* p,
16333    std::size_t n);
16334  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_static_buffer_base.flat_static_buffer_base.overload1 `more...`]]``
16335
16336``[link beast.ref.boost__beast__flat_static_buffer_base.flat_static_buffer_base.overload2 flat_static_buffer_base]``();
16337  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_static_buffer_base.flat_static_buffer_base.overload2 `more...`]]``
16338```
16339
16340[section:overload1 flat_static_buffer_base::flat_static_buffer_base (1 of 2 overloads)]
16341
16342Constructor.
16343[heading Synopsis]
16344```
16345flat_static_buffer_base(
16346    void* p,
16347    std::size_t n);
16348```
16349
16350[heading Description]
16351This creates a dynamic buffer using the provided storage area.
16352
16353[heading Parameters]
16354[table [[Name][Description]]
16355  [
16356    [`p`
16357    ]
16358    [
16359A pointer to valid storage of at least `n` bytes.
16360    ]
16361  ]
16362  [
16363    [`n`
16364    ]
16365    [
16366The number of valid bytes pointed to by `p`.
16367    ]
16368  ]
16369]
16370
16371[endsect]
16372
16373[section:overload2 flat_static_buffer_base::flat_static_buffer_base (2 of 2 overloads)]
16374
16375Constructor.
16376[heading Synopsis]
16377```
16378flat_static_buffer_base();
16379```
16380
16381[heading Description]
16382The buffer will be in an undefined state. It is necessary for the derived class to call [link beast.ref.boost__beast__flat_static_buffer_base.reset `reset`] with a pointer and size in order to initialize the object.
16383
16384[endsect]
16385
16386
16387[endsect]
16388
16389[section:clear flat_static_buffer_base::clear]
16390[indexterm2 clear..flat_static_buffer_base]
16391
16392
16393Clear the readable and writable bytes to zero.
16394[heading Synopsis]
16395```
16396void
16397clear();
16398```
16399
16400[heading Description]
16401This function causes the readable and writable bytes to become empty. The capacity is not changed.
16402Buffer sequences previously obtained using [link beast.ref.boost__beast__flat_static_buffer_base.data `data`] or [link beast.ref.boost__beast__flat_static_buffer_base.prepare `prepare`] become invalid.
16403
16404[heading Exception Safety]
16405
16406No-throw guarantee.
16407
16408[endsect]
16409
16410[section:size flat_static_buffer_base::size]
16411[indexterm2 size..flat_static_buffer_base]
16412
16413
16414Returns the number of readable bytes.
16415[heading Synopsis]
16416```
16417std::size_t
16418size() const;
16419```
16420
16421[heading Description]
16422
16423[endsect]
16424
16425[section:max_size flat_static_buffer_base::max_size]
16426[indexterm2 max_size..flat_static_buffer_base]
16427
16428
16429Return the maximum number of bytes, both readable and writable, that can ever be held.
16430[heading Synopsis]
16431```
16432std::size_t
16433max_size() const;
16434```
16435
16436[heading Description]
16437
16438[endsect]
16439
16440[section:capacity flat_static_buffer_base::capacity]
16441[indexterm2 capacity..flat_static_buffer_base]
16442
16443
16444Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
16445[heading Synopsis]
16446```
16447std::size_t
16448capacity() const;
16449```
16450
16451[heading Description]
16452
16453[endsect]
16454
16455[section:data flat_static_buffer_base::data]
16456[indexterm2 data..flat_static_buffer_base]
16457
16458
16459Returns a constant buffer sequence representing the readable bytes.
16460```
16461const_buffers_type
16462``[link beast.ref.boost__beast__flat_static_buffer_base.data.overload1 data]``() const;
16463  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_static_buffer_base.data.overload1 `more...`]]``
16464```
16465
16466
16467Returns a mutable buffer sequence representing the readable bytes.
16468```
16469mutable_buffers_type
16470``[link beast.ref.boost__beast__flat_static_buffer_base.data.overload2 data]``();
16471  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_static_buffer_base.data.overload2 `more...`]]``
16472```
16473
16474[section:overload1 flat_static_buffer_base::data (1 of 2 overloads)]
16475
16476Returns a constant buffer sequence representing the readable bytes.
16477[heading Synopsis]
16478```
16479const_buffers_type
16480data() const;
16481```
16482
16483[heading Description]
16484
16485[endsect]
16486
16487[section:overload2 flat_static_buffer_base::data (2 of 2 overloads)]
16488
16489Returns a mutable buffer sequence representing the readable bytes.
16490[heading Synopsis]
16491```
16492mutable_buffers_type
16493data();
16494```
16495
16496[heading Description]
16497
16498[endsect]
16499
16500
16501[endsect]
16502
16503[section:cdata flat_static_buffer_base::cdata]
16504[indexterm2 cdata..flat_static_buffer_base]
16505
16506
16507Returns a constant buffer sequence representing the readable bytes.
16508[heading Synopsis]
16509```
16510const_buffers_type
16511cdata() const;
16512```
16513
16514[heading Description]
16515
16516[endsect]
16517
16518[section:prepare flat_static_buffer_base::prepare]
16519[indexterm2 prepare..flat_static_buffer_base]
16520
16521
16522Returns a mutable buffer sequence representing writable bytes.
16523[heading Synopsis]
16524```
16525mutable_buffers_type
16526prepare(
16527    std::size_t n);
16528```
16529
16530[heading Description]
16531Returns a mutable buffer sequence representing the writable bytes containing exactly `n` bytes of storage.
16532All buffers sequences previously obtained using [link beast.ref.boost__beast__flat_static_buffer_base.data `data`] or [link beast.ref.boost__beast__flat_static_buffer_base.prepare `prepare`] are invalidated.
16533
16534[heading Parameters]
16535[table [[Name][Description]]
16536  [
16537    [`n`
16538    ]
16539    [
16540The desired number of bytes in the returned buffer sequence.
16541    ]
16542  ]
16543]
16544[heading Exceptions]
16545[table [[Type][Thrown On]]
16546  [
16547    [`std::length_error`
16548    ]
16549    [
16550if [link beast.ref.boost__beast__flat_static_buffer_base.size `size()`] + n exceeds [link beast.ref.boost__beast__flat_static_buffer_base.max_size `max_size()`].
16551    ]
16552  ]
16553]
16554[heading Exception Safety]
16555
16556Strong guarantee.
16557
16558[endsect]
16559
16560[section:commit flat_static_buffer_base::commit]
16561[indexterm2 commit..flat_static_buffer_base]
16562
16563
16564Append writable bytes to the readable bytes.
16565[heading Synopsis]
16566```
16567void
16568commit(
16569    std::size_t n);
16570```
16571
16572[heading Description]
16573Appends n bytes from the start of the writable bytes to the end of the readable bytes. The remainder of the writable bytes are discarded. If n is greater than the number of writable bytes, all writable bytes are appended to the readable bytes.
16574All buffers sequences previously obtained using [link beast.ref.boost__beast__flat_static_buffer_base.data `data`] or [link beast.ref.boost__beast__flat_static_buffer_base.prepare `prepare`] are invalidated.
16575
16576[heading Parameters]
16577[table [[Name][Description]]
16578  [
16579    [`n`
16580    ]
16581    [
16582The number of bytes to append. If this number is greater than the number of writable bytes, all writable bytes are appended.
16583    ]
16584  ]
16585]
16586[heading Exception Safety]
16587
16588No-throw guarantee.
16589
16590[endsect]
16591
16592[section:consume flat_static_buffer_base::consume]
16593[indexterm2 consume..flat_static_buffer_base]
16594
16595
16596Remove bytes from beginning of the readable bytes.
16597[heading Synopsis]
16598```
16599void
16600consume(
16601    std::size_t n);
16602```
16603
16604[heading Description]
16605Removes n bytes from the beginning of the readable bytes.
16606All buffers sequences previously obtained using [link beast.ref.boost__beast__flat_static_buffer_base.data `data`] or [link beast.ref.boost__beast__flat_static_buffer_base.prepare `prepare`] are invalidated.
16607
16608[heading Parameters]
16609[table [[Name][Description]]
16610  [
16611    [`n`
16612    ]
16613    [
16614The number of bytes to remove. If this number is greater than the number of readable bytes, all readable bytes are removed.
16615    ]
16616  ]
16617]
16618[heading Exception Safety]
16619
16620No-throw guarantee.
16621
16622[endsect]
16623
16624[section:reset flat_static_buffer_base::reset]
16625[indexterm2 reset..flat_static_buffer_base]
16626
16627
16628Reset the pointed-to buffer.
16629[heading Synopsis]
16630```
16631void
16632reset(
16633    void* p,
16634    std::size_t n);
16635```
16636
16637[heading Description]
16638This function resets the internal state to the buffer provided. All input and output sequences are invalidated. This function allows the derived class to construct its members before initializing the static buffer.
16639
16640[heading Parameters]
16641[table [[Name][Description]]
16642  [
16643    [`p`
16644    ]
16645    [
16646A pointer to valid storage of at least `n` bytes.
16647    ]
16648  ]
16649  [
16650    [`n`
16651    ]
16652    [
16653The number of valid bytes pointed to by `p`.
16654    ]
16655  ]
16656]
16657[heading Exception Safety]
16658
16659No-throw guarantee.
16660
16661[endsect]
16662
16663
16664[endsect]
16665
16666[section:boost__beast__flat_stream flat_stream]
16667
16668Stream wrapper to improve write performance.
16669[heading Synopsis]
16670Defined in header [include_file boost/beast/core/flat_stream.hpp]
16671
16672```
16673template<
16674    class NextLayer>
16675class flat_stream
16676```
16677
16678[heading Types]
16679[table [[Name][Description]]
16680  [
16681    [[*[link beast.ref.boost__beast__flat_stream.executor_type executor_type]]
16682    ]
16683    [
16684
16685The type of the executor associated with the object.
16686    ]
16687  ]
16688  [
16689    [[*[link beast.ref.boost__beast__flat_stream.next_layer_type next_layer_type]]
16690    ]
16691    [
16692
16693The type of the next layer.
16694    ]
16695  ]
16696]
16697[heading Member Functions]
16698[table [[Name][Description]]
16699  [
16700    [[*[link beast.ref.boost__beast__flat_stream.async_read_some async_read_some]]
16701    ]
16702    [
16703
16704Start an asynchronous read.
16705    ]
16706  ]
16707  [
16708    [[*[link beast.ref.boost__beast__flat_stream.async_write_some async_write_some]]
16709    ]
16710    [
16711
16712Start an asynchronous write.
16713    ]
16714  ]
16715  [
16716    [[*[link beast.ref.boost__beast__flat_stream.flat_stream flat_stream]]
16717    ]
16718    [
16719
16720
16721Constructor.
16722    ]
16723  ]
16724  [
16725    [[*[link beast.ref.boost__beast__flat_stream.get_executor get_executor]]
16726    ]
16727    [
16728
16729Get the executor associated with the object.
16730    ]
16731  ]
16732  [
16733    [[*[link beast.ref.boost__beast__flat_stream.next_layer next_layer]]
16734    ]
16735    [
16736
16737Get a reference to the next layer.
16738    ]
16739  ]
16740  [
16741    [[*[link beast.ref.boost__beast__flat_stream.operator_eq_ operator=]]
16742    ]
16743    [
16744
16745    ]
16746  ]
16747  [
16748    [[*[link beast.ref.boost__beast__flat_stream.read_some read_some]]
16749    ]
16750    [
16751
16752Read some data from the stream.
16753    ]
16754  ]
16755  [
16756    [[*[link beast.ref.boost__beast__flat_stream.write_some write_some]]
16757    ]
16758    [
16759
16760Write some data to the stream.
16761    ]
16762  ]
16763  [
16764    [[*[link beast.ref.boost__beast__flat_stream._flat_stream ~flat_stream]]
16765    ]
16766    [
16767
16768Destructor.
16769    ]
16770  ]
16771]
16772[heading Description]
16773This wrapper flattens writes for buffer sequences having length greater than 1 and total size below a predefined amount, using a dynamic memory allocation. It is primarily designed to overcome a performance limitation of the current version of `net::ssl::stream`, which does not use OpenSSL's scatter/gather interface for its low-level read some and write some operations.
16774It is normally not necessary to use this class directly if you are already using [link beast.ref.boost__beast__ssl_stream `ssl_stream`]. The following examples shows how to use this class with the ssl stream that comes with networking:
16775
16776[heading Example]
16777
16778To use the [link beast.ref.boost__beast__flat_stream `flat_stream`] template with SSL streams, declare a variable of the correct type. Parameters passed to the constructor will be forwarded to the next layer's constructor:
16779
16780```
16781flat_stream<net::ssl::stream<ip::tcp::socket>> fs{ioc, ctx};
16782```
16783
16784Alternatively you can write
16785```
16786ssl::stream<ip::tcp::socket> ss{ioc, ctx};
16787flat_stream<net::ssl::stream<ip::tcp::socket>&> fs{ss};
16788```
16789
16790The resulting stream may be passed to any stream algorithms which operate on synchronous or asynchronous read or write streams, examples include:
16791
16792* [link beast.ref.boost__beast__file_mode `net::read`], `net::async_read`
16793
16794* [link beast.ref.boost__beast__file_mode `net::write`], `net::async_write`
16795
16796* `net::read_until`, `net::async_read_until`
16797
16798The stream may also be used as a template parameter in other stream wrappers, such as for websocket:
16799```
16800websocket::stream<flat_stream<net::ssl::stream<ip::tcp::socket>>> ws{ioc, ctx};
16801```
16802
16803
16804[heading Template Parameters]
16805[table [[Type][Description]]
16806  [
16807    [`NextLayer`
16808    ]
16809    [
16810The type representing the next layer, to which data will be read and written during operations. For synchronous operations, the type must support the [*SyncStream] concept. For asynchronous operations, the type must support the [*AsyncStream] concept. This type will usually be some variation of `net::ssl::stream`.
16811    ]
16812  ]
16813]
16814[heading See Also]
16815
16816* [@https://github.com/boostorg/asio/issues/100 https://github.com/boostorg/asio/issues/100]
16817* [@https://github.com/boostorg/beast/issues/1108 https://github.com/boostorg/beast/issues/1108]
16818* [@https://stackoverflow.com/questions/38198638/openssl-ssl-write-from-multiple-buffers-ssl-writev https://stackoverflow.com/questions/38198638/openssl-ssl-write-from-multiple-buffers-ssl-writev]
16819* [@https://stackoverflow.com/questions/50026167/performance-drop-on-port-from-beast-1-0-0-b66-to-boost-1-67-0-beast https://stackoverflow.com/questions/50026167/performance-drop-on-port-from-beast-1-0-0-b66-to-boost-1-67-0-beast]
16820
16821
16822[section:next_layer_type flat_stream::next_layer_type]
16823[indexterm2 next_layer_type..flat_stream]
16824
16825
16826The type of the next layer.
16827[heading Synopsis]
16828```
16829using next_layer_type = typename std::remove_reference< NextLayer >::type;
16830```
16831
16832[heading Description]
16833
16834[endsect]
16835
16836[section:executor_type flat_stream::executor_type]
16837[indexterm2 executor_type..flat_stream]
16838
16839
16840The type of the executor associated with the object.
16841[heading Synopsis]
16842```
16843using executor_type = beast::executor_type< next_layer_type >;
16844```
16845
16846[heading Description]
16847
16848[endsect]
16849
16850[section:flat_stream flat_stream::flat_stream]
16851[indexterm2 flat_stream..flat_stream]
16852
16853
16854```
16855``[link beast.ref.boost__beast__flat_stream.flat_stream.overload1 flat_stream]``(
16856    flat_stream&&);
16857  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_stream.flat_stream.overload1 `more...`]]``
16858
16859``[link beast.ref.boost__beast__flat_stream.flat_stream.overload2 flat_stream]``(
16860    flat_stream const&);
16861  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_stream.flat_stream.overload2 `more...`]]``
16862```
16863
16864
16865Constructor.
16866```
16867template<
16868    class... Args>
16869explicit
16870``[link beast.ref.boost__beast__flat_stream.flat_stream.overload3 flat_stream]``(
16871    Args&&... args);
16872  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_stream.flat_stream.overload3 `more...`]]``
16873```
16874
16875[section:overload1 flat_stream::flat_stream (1 of 3 overloads)]
16876
16877[heading Synopsis]
16878```
16879flat_stream(
16880    flat_stream&&);
16881```
16882
16883[heading Description]
16884
16885[endsect]
16886
16887[section:overload2 flat_stream::flat_stream (2 of 3 overloads)]
16888
16889[heading Synopsis]
16890```
16891flat_stream(
16892    flat_stream const&);
16893```
16894
16895[heading Description]
16896
16897[endsect]
16898
16899[section:overload3 flat_stream::flat_stream (3 of 3 overloads)]
16900
16901Constructor.
16902[heading Synopsis]
16903```
16904template<
16905    class... Args>
16906flat_stream(
16907    Args&&... args);
16908```
16909
16910[heading Description]
16911Arguments, if any, are forwarded to the next layer's constructor.
16912
16913[endsect]
16914
16915
16916[endsect]
16917
16918[section:operator_eq_ flat_stream::operator=]
16919[indexterm2 operator=..flat_stream]
16920
16921
16922```
16923flat_stream&
16924``[link beast.ref.boost__beast__flat_stream.operator_eq_.overload1 operator=]``(
16925    flat_stream&&);
16926  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_stream.operator_eq_.overload1 `more...`]]``
16927
16928flat_stream&
16929``[link beast.ref.boost__beast__flat_stream.operator_eq_.overload2 operator=]``(
16930    flat_stream const&);
16931  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_stream.operator_eq_.overload2 `more...`]]``
16932```
16933
16934[section:overload1 flat_stream::operator= (1 of 2 overloads)]
16935
16936[heading Synopsis]
16937```
16938flat_stream&
16939operator=(
16940    flat_stream&&);
16941```
16942
16943[heading Description]
16944
16945[endsect]
16946
16947[section:overload2 flat_stream::operator= (2 of 2 overloads)]
16948
16949[heading Synopsis]
16950```
16951flat_stream&
16952operator=(
16953    flat_stream const&);
16954```
16955
16956[heading Description]
16957
16958[endsect]
16959
16960
16961[endsect]
16962
16963[section:_flat_stream flat_stream::~flat_stream]
16964[indexterm2 ~flat_stream..flat_stream]
16965
16966
16967Destructor.
16968[heading Synopsis]
16969```
16970~flat_stream();
16971```
16972
16973[heading Description]
16974The treatment of pending operations will be the same as that of the next layer.
16975
16976[endsect]
16977
16978[section:get_executor flat_stream::get_executor]
16979[indexterm2 get_executor..flat_stream]
16980
16981
16982Get the executor associated with the object.
16983[heading Synopsis]
16984```
16985executor_type
16986get_executor();
16987```
16988
16989[heading Description]
16990This function may be used to obtain the executor object that the stream uses to dispatch handlers for asynchronous operations.
16991
16992[heading Return Value]
16993A copy of the executor that stream will use to dispatch handlers.
16994
16995[endsect]
16996
16997[section:next_layer flat_stream::next_layer]
16998[indexterm2 next_layer..flat_stream]
16999
17000
17001Get a reference to the next layer.
17002```
17003next_layer_type&
17004``[link beast.ref.boost__beast__flat_stream.next_layer.overload1 next_layer]``();
17005  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_stream.next_layer.overload1 `more...`]]``
17006
17007next_layer_type const&
17008``[link beast.ref.boost__beast__flat_stream.next_layer.overload2 next_layer]``() const;
17009  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_stream.next_layer.overload2 `more...`]]``
17010```
17011
17012[section:overload1 flat_stream::next_layer (1 of 2 overloads)]
17013
17014Get a reference to the next layer.
17015[heading Synopsis]
17016```
17017next_layer_type&
17018next_layer();
17019```
17020
17021[heading Description]
17022This function returns a reference to the next layer in a stack of stream layers.
17023
17024[heading Return Value]
17025A reference to the next layer in the stack of stream layers.
17026
17027[endsect]
17028
17029[section:overload2 flat_stream::next_layer (2 of 2 overloads)]
17030
17031Get a reference to the next layer.
17032[heading Synopsis]
17033```
17034next_layer_type const&
17035next_layer() const;
17036```
17037
17038[heading Description]
17039This function returns a reference to the next layer in a stack of stream layers.
17040
17041[heading Return Value]
17042A reference to the next layer in the stack of stream layers.
17043
17044[endsect]
17045
17046
17047[endsect]
17048
17049[section:read_some flat_stream::read_some]
17050[indexterm2 read_some..flat_stream]
17051
17052
17053Read some data from the stream.
17054```
17055template<
17056    class __MutableBufferSequence__>
17057std::size_t
17058``[link beast.ref.boost__beast__flat_stream.read_some.overload1 read_some]``(
17059    MutableBufferSequence const& buffers);
17060  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_stream.read_some.overload1 `more...`]]``
17061
17062template<
17063    class __MutableBufferSequence__>
17064std::size_t
17065``[link beast.ref.boost__beast__flat_stream.read_some.overload2 read_some]``(
17066    MutableBufferSequence const& buffers,
17067    error_code& ec);
17068  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_stream.read_some.overload2 `more...`]]``
17069```
17070
17071[section:overload1 flat_stream::read_some (1 of 2 overloads)]
17072
17073Read some data from the stream.
17074[heading Synopsis]
17075```
17076template<
17077    class __MutableBufferSequence__>
17078std::size_t
17079read_some(
17080    MutableBufferSequence const& buffers);
17081```
17082
17083[heading Description]
17084This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
17085
17086[heading Parameters]
17087[table [[Name][Description]]
17088  [
17089    [`buffers`
17090    ]
17091    [
17092The buffers into which the data will be read.
17093    ]
17094  ]
17095]
17096[heading Return Value]
17097The number of bytes read.
17098[heading Exceptions]
17099[table [[Type][Thrown On]]
17100  [
17101    [`boost::system::system_error`
17102    ]
17103    [
17104Thrown on failure.
17105    ]
17106  ]
17107]
17108[heading Remarks]
17109The `read_some` operation may not read all of the requested number of bytes. Consider using the function [link beast.ref.boost__beast__file_mode `net::read`] if you need to ensure that the requested amount of data is read before the blocking operation completes.
17110
17111[endsect]
17112
17113[section:overload2 flat_stream::read_some (2 of 2 overloads)]
17114
17115Read some data from the stream.
17116[heading Synopsis]
17117```
17118template<
17119    class __MutableBufferSequence__>
17120std::size_t
17121read_some(
17122    MutableBufferSequence const& buffers,
17123    error_code& ec);
17124```
17125
17126[heading Description]
17127This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
17128
17129[heading Parameters]
17130[table [[Name][Description]]
17131  [
17132    [`buffers`
17133    ]
17134    [
17135The buffers into which the data will be read.
17136    ]
17137  ]
17138  [
17139    [`ec`
17140    ]
17141    [
17142Set to indicate what error occurred, if any.
17143    ]
17144  ]
17145]
17146[heading Return Value]
17147The number of bytes read.
17148[heading Remarks]
17149The `read_some` operation may not read all of the requested number of bytes. Consider using the function [link beast.ref.boost__beast__file_mode `net::read`] if you need to ensure that the requested amount of data is read before the blocking operation completes.
17150
17151[endsect]
17152
17153
17154[endsect]
17155
17156[section:async_read_some flat_stream::async_read_some]
17157[indexterm2 async_read_some..flat_stream]
17158
17159
17160Start an asynchronous read.
17161[heading Synopsis]
17162```
17163template<
17164    class __MutableBufferSequence__,
17165    class __ReadHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__flat_stream.executor_type executor_type]``>>
17166``__deduced__``
17167async_read_some(
17168    MutableBufferSequence const& buffers,
17169    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__flat_stream.executor_type executor_type]`` >{});
17170```
17171
17172[heading Description]
17173This function is used to asynchronously read one or more bytes of data from the stream. The function call always returns immediately.
17174
17175[heading Parameters]
17176[table [[Name][Description]]
17177  [
17178    [`buffers`
17179    ]
17180    [
17181The buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.
17182    ]
17183  ]
17184  [
17185    [`handler`
17186    ]
17187    [
17188
17189The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
17190```
17191void handler(
17192    error_code const& error,        // Result of operation.
17193    std::size_t bytes_transferred   // Number of bytes read.
17194);
17195```
17196
17197Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
17198    ]
17199  ]
17200]
17201[heading Remarks]
17202The `read_some` operation may not read all of the requested number of bytes. Consider using the function `net::async_read` if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
17203
17204[endsect]
17205
17206[section:write_some flat_stream::write_some]
17207[indexterm2 write_some..flat_stream]
17208
17209
17210Write some data to the stream.
17211```
17212template<
17213    class __ConstBufferSequence__>
17214std::size_t
17215``[link beast.ref.boost__beast__flat_stream.write_some.overload1 write_some]``(
17216    ConstBufferSequence const& buffers);
17217  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_stream.write_some.overload1 `more...`]]``
17218
17219template<
17220    class __ConstBufferSequence__>
17221std::size_t
17222``[link beast.ref.boost__beast__flat_stream.write_some.overload2 write_some]``(
17223    ConstBufferSequence const& buffers,
17224    error_code& ec);
17225  ``[''''&raquo;''' [link beast.ref.boost__beast__flat_stream.write_some.overload2 `more...`]]``
17226```
17227
17228[section:overload1 flat_stream::write_some (1 of 2 overloads)]
17229
17230Write some data to the stream.
17231[heading Synopsis]
17232```
17233template<
17234    class __ConstBufferSequence__>
17235std::size_t
17236write_some(
17237    ConstBufferSequence const& buffers);
17238```
17239
17240[heading Description]
17241This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
17242
17243[heading Parameters]
17244[table [[Name][Description]]
17245  [
17246    [`buffers`
17247    ]
17248    [
17249The data to be written.
17250    ]
17251  ]
17252]
17253[heading Return Value]
17254The number of bytes written.
17255[heading Exceptions]
17256[table [[Type][Thrown On]]
17257  [
17258    [`boost::system::system_error`
17259    ]
17260    [
17261Thrown on failure.
17262    ]
17263  ]
17264]
17265[heading Remarks]
17266The `write_some` operation may not transmit all of the data to the peer. Consider using the function [link beast.ref.boost__beast__file_mode `net::write`] if you need to ensure that all data is written before the blocking operation completes.
17267
17268[endsect]
17269
17270[section:overload2 flat_stream::write_some (2 of 2 overloads)]
17271
17272Write some data to the stream.
17273[heading Synopsis]
17274```
17275template<
17276    class __ConstBufferSequence__>
17277std::size_t
17278write_some(
17279    ConstBufferSequence const& buffers,
17280    error_code& ec);
17281```
17282
17283[heading Description]
17284This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
17285
17286[heading Parameters]
17287[table [[Name][Description]]
17288  [
17289    [`buffers`
17290    ]
17291    [
17292The data to be written.
17293    ]
17294  ]
17295  [
17296    [`ec`
17297    ]
17298    [
17299Set to indicate what error occurred, if any.
17300    ]
17301  ]
17302]
17303[heading Return Value]
17304The number of bytes written.
17305[heading Remarks]
17306The `write_some` operation may not transmit all of the data to the peer. Consider using the function [link beast.ref.boost__beast__file_mode `net::write`] if you need to ensure that all data is written before the blocking operation completes.
17307
17308[endsect]
17309
17310
17311[endsect]
17312
17313[section:async_write_some flat_stream::async_write_some]
17314[indexterm2 async_write_some..flat_stream]
17315
17316
17317Start an asynchronous write.
17318[heading Synopsis]
17319```
17320template<
17321    class __ConstBufferSequence__,
17322    class __WriteHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__flat_stream.executor_type executor_type]``>>
17323``__deduced__``
17324async_write_some(
17325    ConstBufferSequence const& buffers,
17326    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__flat_stream.executor_type executor_type]`` >{});
17327```
17328
17329[heading Description]
17330This function is used to asynchronously write one or more bytes of data to the stream. The function call always returns immediately.
17331
17332[heading Parameters]
17333[table [[Name][Description]]
17334  [
17335    [`buffers`
17336    ]
17337    [
17338The data to be written to the stream. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.
17339    ]
17340  ]
17341  [
17342    [`handler`
17343    ]
17344    [
17345
17346The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
17347```
17348void handler(
17349    error_code const& ec,           // Result of operation.
17350    std::size_t bytes_transferred   // Number of bytes written.
17351);
17352```
17353
17354    ]
17355  ]
17356]
17357Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
17358
17359[heading Remarks]
17360The `async_write_some` operation may not transmit all of the data to the peer. Consider using the function `net::async_write` if you need to ensure that all data is written before the asynchronous operation completes.
17361
17362[endsect]
17363
17364
17365[endsect]
17366
17367[section:boost__beast__test__handler test::handler]
17368
17369A CompletionHandler used for testing.
17370[heading Synopsis]
17371Defined in header [include_file boost/beast/_experimental/test/handler.hpp]
17372
17373```
17374class handler
17375```
17376
17377[heading Member Functions]
17378[table [[Name][Description]]
17379  [
17380    [[*[link beast.ref.boost__beast__test__handler.handler handler]]
17381    ]
17382    [
17383
17384    ]
17385  ]
17386  [
17387    [[*[link beast.ref.boost__beast__test__handler.operator_lp__rp_ operator()]]
17388    ]
17389    [
17390
17391    ]
17392  ]
17393  [
17394    [[*[link beast.ref.boost__beast__test__handler._handler ~handler]]
17395    ]
17396    [
17397
17398    ]
17399  ]
17400]
17401[heading Description]
17402This completion handler is used by tests to ensure correctness of behavior. It is designed as a single type to reduce template instantiations, with configurable settings through constructor arguments. Typically this type will be used in type lists and not instantiated directly; instances of this class are returned by the helper functions listed below.
17403
17404[heading See Also]
17405[link beast.ref.boost__beast__test__success_handler `success_handler`], [link beast.ref.boost__beast__test__fail_handler `fail_handler`], [link beast.ref.boost__beast__test__any_handler `any_handler`]
17406
17407[section:handler test::handler::handler]
17408[indexterm2 handler..test::handler]
17409
17410
17411```
17412``[link beast.ref.boost__beast__test__handler.handler.overload1 handler]``();
17413  ``[''''&raquo;''' [link beast.ref.boost__beast__test__handler.handler.overload1 `more...`]]``
17414
17415explicit
17416``[link beast.ref.boost__beast__test__handler.handler.overload2 handler]``(
17417    error_code ec);
17418  ``[''''&raquo;''' [link beast.ref.boost__beast__test__handler.handler.overload2 `more...`]]``
17419
17420explicit
17421``[link beast.ref.boost__beast__test__handler.handler.overload3 handler]``(
17422    boost::none_t);
17423  ``[''''&raquo;''' [link beast.ref.boost__beast__test__handler.handler.overload3 `more...`]]``
17424
17425``[link beast.ref.boost__beast__test__handler.handler.overload4 handler]``(
17426    handler&& other);
17427  ``[''''&raquo;''' [link beast.ref.boost__beast__test__handler.handler.overload4 `more...`]]``
17428```
17429
17430[section:overload1 test::handler::handler (1 of 4 overloads)]
17431
17432[heading Synopsis]
17433```
17434handler();
17435```
17436
17437[heading Description]
17438
17439[endsect]
17440
17441[section:overload2 test::handler::handler (2 of 4 overloads)]
17442
17443[heading Synopsis]
17444```
17445handler(
17446    error_code ec);
17447```
17448
17449[heading Description]
17450
17451[endsect]
17452
17453[section:overload3 test::handler::handler (3 of 4 overloads)]
17454
17455[heading Synopsis]
17456```
17457handler(
17458    boost::none_t);
17459```
17460
17461[heading Description]
17462
17463[endsect]
17464
17465[section:overload4 test::handler::handler (4 of 4 overloads)]
17466
17467[heading Synopsis]
17468```
17469handler(
17470    handler&& other);
17471```
17472
17473[heading Description]
17474
17475[endsect]
17476
17477
17478[endsect]
17479
17480[section:_handler test::handler::~handler]
17481[indexterm2 ~handler..test::handler]
17482
17483
17484[heading Synopsis]
17485```
17486~handler();
17487```
17488
17489[heading Description]
17490
17491[endsect]
17492
17493[section:operator_lp__rp_ test::handler::operator()]
17494[indexterm2 operator()..test::handler]
17495
17496
17497```
17498template<
17499    class... Args>
17500void
17501``[link beast.ref.boost__beast__test__handler.operator_lp__rp_.overload1 operator()]``(
17502    error_code ec,
17503    Args&& ...);
17504  ``[''''&raquo;''' [link beast.ref.boost__beast__test__handler.operator_lp__rp_.overload1 `more...`]]``
17505
17506void
17507``[link beast.ref.boost__beast__test__handler.operator_lp__rp_.overload2 operator()]``();
17508  ``[''''&raquo;''' [link beast.ref.boost__beast__test__handler.operator_lp__rp_.overload2 `more...`]]``
17509
17510template<
17511    class Arg0,
17512    class... Args,
17513    [role red error.param neither has a declname nor a 'class ' prefix in the type][role red error.param neither has a declname nor a 'class ' prefix in the type][role red error.param neither has a declname nor a 'class ' prefix in the type][role red error.param neither has a declname nor a 'class ' prefix in the type] = typename std::enable_if<            ! std::is_convertible<Arg0, ``[link beast.ref.boost__beast__error_code error_code]``>::value>::type>
17514void
17515``[link beast.ref.boost__beast__test__handler.operator_lp__rp_.overload3 operator()]``(
17516    Arg0&&,
17517    Args&& ...);
17518  ``[''''&raquo;''' [link beast.ref.boost__beast__test__handler.operator_lp__rp_.overload3 `more...`]]``
17519```
17520
17521[section:overload1 test::handler::operator() (1 of 3 overloads)]
17522
17523[heading Synopsis]
17524```
17525template<
17526    class... Args>
17527void
17528operator()(
17529    error_code ec,
17530    Args&& ...);
17531```
17532
17533[heading Description]
17534
17535[endsect]
17536
17537[section:overload2 test::handler::operator() (2 of 3 overloads)]
17538
17539[heading Synopsis]
17540```
17541void
17542operator()();
17543```
17544
17545[heading Description]
17546
17547[endsect]
17548
17549[section:overload3 test::handler::operator() (3 of 3 overloads)]
17550
17551[heading Synopsis]
17552```
17553template<
17554    class Arg0,
17555    class... Args,
17556    [role red error.param neither has a declname nor a 'class ' prefix in the type][role red error.param neither has a declname nor a 'class ' prefix in the type][role red error.param neither has a declname nor a 'class ' prefix in the type][role red error.param neither has a declname nor a 'class ' prefix in the type] = typename std::enable_if<            ! std::is_convertible<Arg0, ``[link beast.ref.boost__beast__error_code error_code]``>::value>::type>
17557void
17558operator()(
17559    Arg0&&,
17560    Args&& ...);
17561```
17562
17563[heading Description]
17564
17565[endsect]
17566
17567
17568[endsect]
17569
17570
17571[endsect]
17572
17573[section:boost__beast__http__header http::header]
17574
17575A container for an HTTP request or response header.
17576[heading Synopsis]
17577Defined in header [include_file boost/beast/http/message.hpp]
17578
17579```
17580template<
17581    bool isRequest,
17582    class __Fields__ = ``[link beast.ref.boost__beast__http__fields fields]``>
17583class header :
17584    public Fields
17585```
17586
17587[heading Types]
17588[table [[Name][Description]]
17589  [
17590    [[*[link beast.ref.boost__beast__http__header.fields_type fields_type]]
17591    ]
17592    [
17593
17594The type representing the fields.
17595    ]
17596  ]
17597  [
17598    [[*[link beast.ref.boost__beast__http__header.is_request is_request]]
17599    ]
17600    [
17601
17602Indicates if the header is a request or response.
17603    ]
17604  ]
17605]
17606[heading Member Functions]
17607[table [[Name][Description]]
17608  [
17609    [[*[link beast.ref.boost__beast__http__header.header header]]
17610    ]
17611    [
17612
17613Constructor.
17614    ]
17615  ]
17616  [
17617    [[*[link beast.ref.boost__beast__http__header.method method]]
17618    ]
17619    [
17620
17621Return the request-method verb.
17622
17623Set the request-method.
17624    ]
17625  ]
17626  [
17627    [[*[link beast.ref.boost__beast__http__header.method_string method_string]]
17628    ]
17629    [
17630
17631Return the request-method as a string.
17632
17633Set the request-method.
17634    ]
17635  ]
17636  [
17637    [[*[link beast.ref.boost__beast__http__header.operator_eq_ operator=]]
17638    ]
17639    [
17640
17641Assignment.
17642    ]
17643  ]
17644  [
17645    [[*[link beast.ref.boost__beast__http__header.reason reason]]
17646    ]
17647    [
17648
17649Return the response reason-phrase.
17650
17651Set the response reason-phrase (deprecated)
17652    ]
17653  ]
17654  [
17655    [[*[link beast.ref.boost__beast__http__header.result result]]
17656    ]
17657    [
17658
17659The response status-code result.
17660
17661Set the response status-code.
17662
17663Set the response status-code as an integer.
17664    ]
17665  ]
17666  [
17667    [[*[link beast.ref.boost__beast__http__header.result_int result_int]]
17668    ]
17669    [
17670
17671The response status-code expressed as an integer.
17672    ]
17673  ]
17674  [
17675    [[*[link beast.ref.boost__beast__http__header.target target]]
17676    ]
17677    [
17678
17679Returns the request-target string.
17680
17681Set the request-target string.
17682    ]
17683  ]
17684  [
17685    [[*[link beast.ref.boost__beast__http__header.version version]]
17686    ]
17687    [
17688
17689Return the HTTP-version.
17690
17691Set the HTTP-version.
17692    ]
17693  ]
17694]
17695[heading Description]
17696This container is derived from the `Fields` template type. To understand all of the members of this class it is necessary to view the declaration for the `Fields` type. When using the default fields container, those declarations are in [link beast.ref.boost__beast__http__fields `fields`].
17697Newly constructed header objects have version set to HTTP/1.1. Newly constructed response objects also have result code set to [link beast.ref.boost__beast__http__status `status::ok`].
17698A `header` includes the start-line and header-fields.
17699
17700[section:is_request http::header::is_request]
17701[indexterm2 is_request..http::header]
17702
17703
17704Indicates if the header is a request or response.
17705[heading Synopsis]
17706```
17707using is_request = std::integral_constant< bool, isRequest >;
17708```
17709
17710[heading Description]
17711
17712[endsect]
17713
17714[section:fields_type http::header::fields_type]
17715[indexterm2 fields_type..http::header]
17716
17717
17718The type representing the fields.
17719[heading Synopsis]
17720```
17721using fields_type = Fields;
17722```
17723
17724[heading Description]
17725
17726[endsect]
17727
17728[section:header http::header::header]
17729[indexterm2 header..http::header]
17730
17731
17732Constructor.
17733```
17734``[link beast.ref.boost__beast__http__header.header.overload1 header]``();
17735  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.header.overload1 `more...`]]``
17736
17737``[link beast.ref.boost__beast__http__header.header.overload2 header]``(
17738    header&&);
17739  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.header.overload2 `more...`]]``
17740
17741``[link beast.ref.boost__beast__http__header.header.overload3 header]``(
17742    header const&);
17743  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.header.overload3 `more...`]]``
17744
17745template<
17746    class... Args>
17747explicit
17748``[link beast.ref.boost__beast__http__header.header.overload4 header]``(
17749    Args&&... args);
17750  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.header.overload4 `more...`]]``
17751```
17752
17753[section:overload1 http::header::header (1 of 4 overloads)]
17754
17755Constructor.
17756[heading Synopsis]
17757```
17758header();
17759```
17760
17761[heading Description]
17762
17763[endsect]
17764
17765[section:overload2 http::header::header (2 of 4 overloads)]
17766
17767Constructor.
17768[heading Synopsis]
17769```
17770header(
17771    header&&);
17772```
17773
17774[heading Description]
17775
17776[endsect]
17777
17778[section:overload3 http::header::header (3 of 4 overloads)]
17779
17780Constructor.
17781[heading Synopsis]
17782```
17783header(
17784    header const&);
17785```
17786
17787[heading Description]
17788
17789[endsect]
17790
17791[section:overload4 http::header::header (4 of 4 overloads)]
17792
17793Constructor.
17794[heading Synopsis]
17795```
17796template<
17797    class... Args>
17798header(
17799    Args&&... args);
17800```
17801
17802[heading Description]
17803
17804[heading Parameters]
17805[table [[Name][Description]]
17806  [
17807    [`args`
17808    ]
17809    [
17810Arguments forwarded to the `Fields` base class constructor.
17811    ]
17812  ]
17813]
17814[heading Remarks]
17815This constructor participates in overload resolution if and only if the first parameter is not convertible to [link beast.ref.boost__beast__http__header `header`], [link beast.ref.boost__beast__http__verb `verb`], or [link beast.ref.boost__beast__http__status `status`].
17816
17817[endsect]
17818
17819
17820[endsect]
17821
17822[section:operator_eq_ http::header::operator=]
17823[indexterm2 operator=..http::header]
17824
17825
17826Assignment.
17827```
17828header&
17829``[link beast.ref.boost__beast__http__header.operator_eq_.overload1 operator=]``(
17830    header&&);
17831  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.operator_eq_.overload1 `more...`]]``
17832
17833header&
17834``[link beast.ref.boost__beast__http__header.operator_eq_.overload2 operator=]``(
17835    header const&);
17836  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.operator_eq_.overload2 `more...`]]``
17837```
17838
17839[section:overload1 http::header::operator= (1 of 2 overloads)]
17840
17841Assignment.
17842[heading Synopsis]
17843```
17844header&
17845operator=(
17846    header&&);
17847```
17848
17849[heading Description]
17850
17851[endsect]
17852
17853[section:overload2 http::header::operator= (2 of 2 overloads)]
17854
17855Assignment.
17856[heading Synopsis]
17857```
17858header&
17859operator=(
17860    header const&);
17861```
17862
17863[heading Description]
17864
17865[endsect]
17866
17867
17868[endsect]
17869
17870[section:version http::header::version]
17871[indexterm2 version..http::header]
17872
17873
17874Return the HTTP-version.
17875```
17876unsigned
17877``[link beast.ref.boost__beast__http__header.version.overload1 version]``() const;
17878  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.version.overload1 `more...`]]``
17879```
17880
17881
17882Set the HTTP-version.
17883```
17884void
17885``[link beast.ref.boost__beast__http__header.version.overload2 version]``(
17886    unsigned value);
17887  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.version.overload2 `more...`]]``
17888```
17889
17890[section:overload1 http::header::version (1 of 2 overloads)]
17891
17892Return the HTTP-version.
17893[heading Synopsis]
17894```
17895unsigned
17896version() const;
17897```
17898
17899[heading Description]
17900
17901This holds both the major and minor version numbers, using these formulas:
17902```
17903unsigned major = version / 10;
17904unsigned minor = version % 10;
17905```
17906
17907Newly constructed headers will use HTTP/1.1 by default.
17908
17909[endsect]
17910
17911[section:overload2 http::header::version (2 of 2 overloads)]
17912
17913Set the HTTP-version.
17914[heading Synopsis]
17915```
17916void
17917version(
17918    unsigned value);
17919```
17920
17921[heading Description]
17922
17923This holds both the major and minor version numbers, using these formulas:
17924```
17925unsigned major = version / 10;
17926unsigned minor = version % 10;
17927```
17928
17929Newly constructed headers will use HTTP/1.1 by default.
17930
17931[heading Parameters]
17932[table [[Name][Description]]
17933  [
17934    [`value`
17935    ]
17936    [
17937The version number to use
17938    ]
17939  ]
17940]
17941
17942[endsect]
17943
17944
17945[endsect]
17946
17947[section:method http::header::method]
17948[indexterm2 method..http::header]
17949
17950
17951Return the request-method verb.
17952```
17953verb
17954``[link beast.ref.boost__beast__http__header.method.overload1 method]``() const;
17955  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.method.overload1 `more...`]]``
17956```
17957
17958
17959Set the request-method.
17960```
17961void
17962``[link beast.ref.boost__beast__http__header.method.overload2 method]``(
17963    verb v);
17964  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.method.overload2 `more...`]]``
17965```
17966
17967[section:overload1 http::header::method (1 of 2 overloads)]
17968
17969Return the request-method verb.
17970[heading Synopsis]
17971```
17972verb
17973method() const;
17974```
17975
17976[heading Description]
17977If the request-method is not one of the recognized verbs, [link beast.ref.boost__beast__http__field `verb::unknown`] is returned. Callers may use [link beast.ref.boost__beast__http__header.method_string `method_string`] to retrieve the exact text.
17978
17979[heading Remarks]
17980This function is only available when `isRequest == true`.
17981[heading See Also]
17982[link beast.ref.boost__beast__http__header.method_string `method_string`]
17983
17984[endsect]
17985
17986[section:overload2 http::header::method (2 of 2 overloads)]
17987
17988Set the request-method.
17989[heading Synopsis]
17990```
17991void
17992method(
17993    verb v);
17994```
17995
17996[heading Description]
17997This function will set the method for requests to a known verb.
17998
17999[heading Parameters]
18000[table [[Name][Description]]
18001  [
18002    [`v`
18003    ]
18004    [
18005The request method verb to set. This may not be [link beast.ref.boost__beast__http__field `verb::unknown`].
18006    ]
18007  ]
18008]
18009[heading Exceptions]
18010[table [[Type][Thrown On]]
18011  [
18012    [`std::invalid_argument`
18013    ]
18014    [
18015when v == [link beast.ref.boost__beast__http__field `verb::unknown`].
18016    ]
18017  ]
18018]
18019[heading Remarks]
18020This function is only available when `isRequest == true`.
18021
18022[endsect]
18023
18024
18025[endsect]
18026
18027[section:method_string http::header::method_string]
18028[indexterm2 method_string..http::header]
18029
18030
18031Return the request-method as a string.
18032```
18033string_view
18034``[link beast.ref.boost__beast__http__header.method_string.overload1 method_string]``() const;
18035  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.method_string.overload1 `more...`]]``
18036```
18037
18038
18039Set the request-method.
18040```
18041void
18042``[link beast.ref.boost__beast__http__header.method_string.overload2 method_string]``(
18043    string_view s);
18044  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.method_string.overload2 `more...`]]``
18045```
18046
18047[section:overload1 http::header::method_string (1 of 2 overloads)]
18048
18049Return the request-method as a string.
18050[heading Synopsis]
18051```
18052string_view
18053method_string() const;
18054```
18055
18056[heading Description]
18057
18058[heading Remarks]
18059This function is only available when `isRequest == true`.
18060[heading See Also]
18061[link beast.ref.boost__beast__http__header.method `method`]
18062
18063[endsect]
18064
18065[section:overload2 http::header::method_string (2 of 2 overloads)]
18066
18067Set the request-method.
18068[heading Synopsis]
18069```
18070void
18071method_string(
18072    string_view s);
18073```
18074
18075[heading Description]
18076This function will set the request-method a known verb if the string matches, otherwise it will store a copy of the passed string.
18077
18078[heading Parameters]
18079[table [[Name][Description]]
18080  [
18081    [`s`
18082    ]
18083    [
18084A string representing the request-method.
18085    ]
18086  ]
18087]
18088[heading Remarks]
18089This function is only available when `isRequest == true`.
18090
18091[endsect]
18092
18093
18094[endsect]
18095
18096[section:target http::header::target]
18097[indexterm2 target..http::header]
18098
18099
18100Returns the request-target string.
18101```
18102string_view
18103``[link beast.ref.boost__beast__http__header.target.overload1 target]``() const;
18104  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.target.overload1 `more...`]]``
18105```
18106
18107
18108Set the request-target string.
18109```
18110void
18111``[link beast.ref.boost__beast__http__header.target.overload2 target]``(
18112    string_view s);
18113  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.target.overload2 `more...`]]``
18114```
18115
18116[section:overload1 http::header::target (1 of 2 overloads)]
18117
18118Returns the request-target string.
18119[heading Synopsis]
18120```
18121string_view
18122target() const;
18123```
18124
18125[heading Description]
18126The request target string returned is the same string which was received from the network or stored. In particular, it will contain url-encoded characters and should follow the syntax rules for URIs used with HTTP.
18127
18128[heading Remarks]
18129This function is only available when `isRequest == true`.
18130
18131[endsect]
18132
18133[section:overload2 http::header::target (2 of 2 overloads)]
18134
18135Set the request-target string.
18136[heading Synopsis]
18137```
18138void
18139target(
18140    string_view s);
18141```
18142
18143[heading Description]
18144It is the caller's responsibility to ensure that the request target string follows the syntax rules for URIs used with HTTP. In particular, reserved or special characters must be url-encoded. The implementation does not perform syntax checking on the passed string.
18145
18146[heading Parameters]
18147[table [[Name][Description]]
18148  [
18149    [`s`
18150    ]
18151    [
18152A string representing the request-target.
18153    ]
18154  ]
18155]
18156[heading Remarks]
18157This function is only available when `isRequest == true`.
18158
18159[endsect]
18160
18161
18162[endsect]
18163
18164[section:result http::header::result]
18165[indexterm2 result..http::header]
18166
18167
18168The response status-code result.
18169```
18170status
18171``[link beast.ref.boost__beast__http__header.result.overload1 result]``() const;
18172  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.result.overload1 `more...`]]``
18173```
18174
18175
18176Set the response status-code.
18177```
18178void
18179``[link beast.ref.boost__beast__http__header.result.overload2 result]``(
18180    status v);
18181  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.result.overload2 `more...`]]``
18182```
18183
18184
18185Set the response status-code as an integer.
18186```
18187void
18188``[link beast.ref.boost__beast__http__header.result.overload3 result]``(
18189    unsigned v);
18190  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.result.overload3 `more...`]]``
18191```
18192
18193[section:overload1 http::header::result (1 of 3 overloads)]
18194
18195The response status-code result.
18196[heading Synopsis]
18197```
18198status
18199result() const;
18200```
18201
18202[heading Description]
18203If the actual status code is not a known code, this function returns [link beast.ref.boost__beast__http__field `status::unknown`]. Use [link beast.ref.boost__beast__http__header.result_int `result_int`] to return the raw status code as a number.
18204
18205[heading Remarks]
18206This member is only available when `isRequest == false`.
18207
18208[endsect]
18209
18210[section:overload2 http::header::result (2 of 3 overloads)]
18211
18212Set the response status-code.
18213[heading Synopsis]
18214```
18215void
18216result(
18217    status v);
18218```
18219
18220[heading Description]
18221
18222[heading Parameters]
18223[table [[Name][Description]]
18224  [
18225    [`v`
18226    ]
18227    [
18228The code to set.
18229    ]
18230  ]
18231]
18232[heading Remarks]
18233This member is only available when `isRequest == false`.
18234
18235[endsect]
18236
18237[section:overload3 http::header::result (3 of 3 overloads)]
18238
18239Set the response status-code as an integer.
18240[heading Synopsis]
18241```
18242void
18243result(
18244    unsigned v);
18245```
18246
18247[heading Description]
18248This sets the status code to the exact number passed in. If the number does not correspond to one of the known status codes, the function [link beast.ref.boost__beast__http__header.result `result`] will return [link beast.ref.boost__beast__http__field `status::unknown`]. Use [link beast.ref.boost__beast__http__header.result_int `result_int`] to obtain the original raw status-code.
18249
18250[heading Parameters]
18251[table [[Name][Description]]
18252  [
18253    [`v`
18254    ]
18255    [
18256The status-code integer to set.
18257    ]
18258  ]
18259]
18260[heading Exceptions]
18261[table [[Type][Thrown On]]
18262  [
18263    [`std::invalid_argument`
18264    ]
18265    [
18266if `v > 999`.
18267    ]
18268  ]
18269]
18270
18271[endsect]
18272
18273
18274[endsect]
18275
18276[section:result_int http::header::result_int]
18277[indexterm2 result_int..http::header]
18278
18279
18280The response status-code expressed as an integer.
18281[heading Synopsis]
18282```
18283unsigned
18284result_int() const;
18285```
18286
18287[heading Description]
18288This returns the raw status code as an integer, even when that code is not in the list of known status codes.
18289
18290[heading Remarks]
18291This member is only available when `isRequest == false`.
18292
18293[endsect]
18294
18295[section:reason http::header::reason]
18296[indexterm2 reason..http::header]
18297
18298
18299Return the response reason-phrase.
18300```
18301string_view
18302``[link beast.ref.boost__beast__http__header.reason.overload1 reason]``() const;
18303  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.reason.overload1 `more...`]]``
18304```
18305
18306
18307Set the response reason-phrase (deprecated)
18308```
18309void
18310``[link beast.ref.boost__beast__http__header.reason.overload2 reason]``(
18311    string_view s);
18312  ``[''''&raquo;''' [link beast.ref.boost__beast__http__header.reason.overload2 `more...`]]``
18313```
18314
18315[section:overload1 http::header::reason (1 of 2 overloads)]
18316
18317Return the response reason-phrase.
18318[heading Synopsis]
18319```
18320string_view
18321reason() const;
18322```
18323
18324[heading Description]
18325The reason-phrase is obsolete as of rfc7230.
18326
18327[heading Remarks]
18328This function is only available when `isRequest == false`.
18329
18330[endsect]
18331
18332[section:overload2 http::header::reason (2 of 2 overloads)]
18333
18334Set the response reason-phrase (deprecated)
18335[heading Synopsis]
18336```
18337void
18338reason(
18339    string_view s);
18340```
18341
18342[heading Description]
18343This function sets a custom reason-phrase to a copy of the string passed in. Normally it is not necessary to set the reason phrase on an outgoing response object; the implementation will automatically use the standard reason text for the corresponding status code.
18344To clear a previously set custom phrase, pass an empty string. This will restore the default standard reason text based on the status code used when serializing.
18345The reason-phrase is obsolete as of rfc7230.
18346
18347[heading Parameters]
18348[table [[Name][Description]]
18349  [
18350    [`s`
18351    ]
18352    [
18353The string to use for the reason-phrase.
18354    ]
18355  ]
18356]
18357[heading Remarks]
18358This function is only available when `isRequest == false`.
18359
18360[endsect]
18361
18362
18363[endsect]
18364
18365
18366[endsect]
18367
18368[section:boost__beast__http__icy_stream http::icy_stream]
18369
18370Stream wrapper to process Shoutcast HTTP responses.
18371[heading Synopsis]
18372Defined in header [include_file boost/beast/_experimental/http/icy_stream.hpp]
18373
18374```
18375template<
18376    class NextLayer>
18377class icy_stream
18378```
18379
18380[heading Types]
18381[table [[Name][Description]]
18382  [
18383    [[*[link beast.ref.boost__beast__http__icy_stream.executor_type executor_type]]
18384    ]
18385    [
18386
18387The type of the executor associated with the object.
18388    ]
18389  ]
18390  [
18391    [[*[link beast.ref.boost__beast__http__icy_stream.next_layer_type next_layer_type]]
18392    ]
18393    [
18394
18395The type of the next layer.
18396    ]
18397  ]
18398]
18399[heading Member Functions]
18400[table [[Name][Description]]
18401  [
18402    [[*[link beast.ref.boost__beast__http__icy_stream.async_read_some async_read_some]]
18403    ]
18404    [
18405
18406Start an asynchronous read.
18407    ]
18408  ]
18409  [
18410    [[*[link beast.ref.boost__beast__http__icy_stream.async_write_some async_write_some]]
18411    ]
18412    [
18413
18414Start an asynchronous write.
18415    ]
18416  ]
18417  [
18418    [[*[link beast.ref.boost__beast__http__icy_stream.get_executor get_executor]]
18419    ]
18420    [
18421
18422Get the executor associated with the object.
18423    ]
18424  ]
18425  [
18426    [[*[link beast.ref.boost__beast__http__icy_stream.icy_stream icy_stream]]
18427    ]
18428    [
18429
18430
18431Constructor.
18432    ]
18433  ]
18434  [
18435    [[*[link beast.ref.boost__beast__http__icy_stream.next_layer next_layer]]
18436    ]
18437    [
18438
18439Get a reference to the next layer.
18440    ]
18441  ]
18442  [
18443    [[*[link beast.ref.boost__beast__http__icy_stream.operator_eq_ operator=]]
18444    ]
18445    [
18446
18447    ]
18448  ]
18449  [
18450    [[*[link beast.ref.boost__beast__http__icy_stream.read_some read_some]]
18451    ]
18452    [
18453
18454Read some data from the stream.
18455    ]
18456  ]
18457  [
18458    [[*[link beast.ref.boost__beast__http__icy_stream.write_some write_some]]
18459    ]
18460    [
18461
18462Write some data to the stream.
18463    ]
18464  ]
18465  [
18466    [[*[link beast.ref.boost__beast__http__icy_stream._icy_stream ~icy_stream]]
18467    ]
18468    [
18469
18470Destructor.
18471    ]
18472  ]
18473]
18474[heading Description]
18475This wrapper replaces the word "ICY" in the first HTTP response received on the connection, with "HTTP/1.1". This allows the Beast parser to be used with Shoutcast servers, which send a non-standard HTTP message as the response.
18476For asynchronous operations, the application must ensure that they are are all performed within the same implicit or explicit strand.
18477
18478[heading Thread Safety]
18479
18480['Distinct]['objects:]Safe.
18481
18482
18483['Shared]['objects:]Unsafe. The application must also ensure that all asynchronous operations are performed within the same implicit or explicit strand.
18484[heading Example]
18485
18486To use the [link beast.ref.boost__beast__http__icy_stream `icy_stream`] template with an [link beast.ref.boost__beast__tcp_stream `tcp_stream`] you would write:
18487```
18488http::icy_stream<tcp_stream> is(ioc);
18489```
18490
18491[heading Template Parameters]
18492[table [[Type][Description]]
18493  [
18494    [`NextLayer`
18495    ]
18496    [
18497The type representing the next layer, to which data will be read and written during operations. For synchronous operations, the type must support the ['SyncStream] concept. For asynchronous operations, the type must support the ['AsyncStream] concept.
18498    ]
18499  ]
18500]
18501[heading Remarks]
18502A stream object must not be moved or destroyed while there are pending asynchronous operations associated with it.
18503
18504[section:next_layer_type http::icy_stream::next_layer_type]
18505[indexterm2 next_layer_type..http::icy_stream]
18506
18507
18508The type of the next layer.
18509[heading Synopsis]
18510```
18511using next_layer_type = typename std::remove_reference< NextLayer >::type;
18512```
18513
18514[heading Description]
18515
18516[endsect]
18517
18518[section:executor_type http::icy_stream::executor_type]
18519[indexterm2 executor_type..http::icy_stream]
18520
18521
18522The type of the executor associated with the object.
18523[heading Synopsis]
18524```
18525using executor_type = typename next_layer_type::executor_type;
18526```
18527
18528[heading Description]
18529
18530[endsect]
18531
18532[section:icy_stream http::icy_stream::icy_stream]
18533[indexterm2 icy_stream..http::icy_stream]
18534
18535
18536```
18537``[link beast.ref.boost__beast__http__icy_stream.icy_stream.overload1 icy_stream]``(
18538    icy_stream&&);
18539  ``[''''&raquo;''' [link beast.ref.boost__beast__http__icy_stream.icy_stream.overload1 `more...`]]``
18540
18541``[link beast.ref.boost__beast__http__icy_stream.icy_stream.overload2 icy_stream]``(
18542    icy_stream const&);
18543  ``[''''&raquo;''' [link beast.ref.boost__beast__http__icy_stream.icy_stream.overload2 `more...`]]``
18544```
18545
18546
18547Constructor.
18548```
18549template<
18550    class... Args>
18551explicit
18552``[link beast.ref.boost__beast__http__icy_stream.icy_stream.overload3 icy_stream]``(
18553    Args&&... args);
18554  ``[''''&raquo;''' [link beast.ref.boost__beast__http__icy_stream.icy_stream.overload3 `more...`]]``
18555```
18556
18557[section:overload1 http::icy_stream::icy_stream (1 of 3 overloads)]
18558
18559[heading Synopsis]
18560```
18561icy_stream(
18562    icy_stream&&);
18563```
18564
18565[heading Description]
18566
18567[endsect]
18568
18569[section:overload2 http::icy_stream::icy_stream (2 of 3 overloads)]
18570
18571[heading Synopsis]
18572```
18573icy_stream(
18574    icy_stream const&);
18575```
18576
18577[heading Description]
18578
18579[endsect]
18580
18581[section:overload3 http::icy_stream::icy_stream (3 of 3 overloads)]
18582
18583Constructor.
18584[heading Synopsis]
18585```
18586template<
18587    class... Args>
18588icy_stream(
18589    Args&&... args);
18590```
18591
18592[heading Description]
18593Arguments, if any, are forwarded to the next layer's constructor.
18594
18595[endsect]
18596
18597
18598[endsect]
18599
18600[section:operator_eq_ http::icy_stream::operator=]
18601[indexterm2 operator=..http::icy_stream]
18602
18603
18604```
18605icy_stream&
18606``[link beast.ref.boost__beast__http__icy_stream.operator_eq_.overload1 operator=]``(
18607    icy_stream&&);
18608  ``[''''&raquo;''' [link beast.ref.boost__beast__http__icy_stream.operator_eq_.overload1 `more...`]]``
18609
18610icy_stream&
18611``[link beast.ref.boost__beast__http__icy_stream.operator_eq_.overload2 operator=]``(
18612    icy_stream const&);
18613  ``[''''&raquo;''' [link beast.ref.boost__beast__http__icy_stream.operator_eq_.overload2 `more...`]]``
18614```
18615
18616[section:overload1 http::icy_stream::operator= (1 of 2 overloads)]
18617
18618[heading Synopsis]
18619```
18620icy_stream&
18621operator=(
18622    icy_stream&&);
18623```
18624
18625[heading Description]
18626
18627[endsect]
18628
18629[section:overload2 http::icy_stream::operator= (2 of 2 overloads)]
18630
18631[heading Synopsis]
18632```
18633icy_stream&
18634operator=(
18635    icy_stream const&);
18636```
18637
18638[heading Description]
18639
18640[endsect]
18641
18642
18643[endsect]
18644
18645[section:_icy_stream http::icy_stream::~icy_stream]
18646[indexterm2 ~icy_stream..http::icy_stream]
18647
18648
18649Destructor.
18650[heading Synopsis]
18651```
18652~icy_stream();
18653```
18654
18655[heading Description]
18656The treatment of pending operations will be the same as that of the next layer.
18657
18658[endsect]
18659
18660[section:get_executor http::icy_stream::get_executor]
18661[indexterm2 get_executor..http::icy_stream]
18662
18663
18664Get the executor associated with the object.
18665[heading Synopsis]
18666```
18667executor_type
18668get_executor();
18669```
18670
18671[heading Description]
18672This function may be used to obtain the executor object that the stream uses to dispatch handlers for asynchronous operations.
18673
18674[heading Return Value]
18675A copy of the executor that stream will use to dispatch handlers.
18676
18677[endsect]
18678
18679[section:next_layer http::icy_stream::next_layer]
18680[indexterm2 next_layer..http::icy_stream]
18681
18682
18683Get a reference to the next layer.
18684```
18685next_layer_type&
18686``[link beast.ref.boost__beast__http__icy_stream.next_layer.overload1 next_layer]``();
18687  ``[''''&raquo;''' [link beast.ref.boost__beast__http__icy_stream.next_layer.overload1 `more...`]]``
18688
18689next_layer_type const&
18690``[link beast.ref.boost__beast__http__icy_stream.next_layer.overload2 next_layer]``() const;
18691  ``[''''&raquo;''' [link beast.ref.boost__beast__http__icy_stream.next_layer.overload2 `more...`]]``
18692```
18693
18694[section:overload1 http::icy_stream::next_layer (1 of 2 overloads)]
18695
18696Get a reference to the next layer.
18697[heading Synopsis]
18698```
18699next_layer_type&
18700next_layer();
18701```
18702
18703[heading Description]
18704This function returns a reference to the next layer in a stack of stream layers.
18705
18706[heading Return Value]
18707A reference to the next layer in the stack of stream layers.
18708
18709[endsect]
18710
18711[section:overload2 http::icy_stream::next_layer (2 of 2 overloads)]
18712
18713Get a reference to the next layer.
18714[heading Synopsis]
18715```
18716next_layer_type const&
18717next_layer() const;
18718```
18719
18720[heading Description]
18721This function returns a reference to the next layer in a stack of stream layers.
18722
18723[heading Return Value]
18724A reference to the next layer in the stack of stream layers.
18725
18726[endsect]
18727
18728
18729[endsect]
18730
18731[section:read_some http::icy_stream::read_some]
18732[indexterm2 read_some..http::icy_stream]
18733
18734
18735Read some data from the stream.
18736```
18737template<
18738    class __MutableBufferSequence__>
18739std::size_t
18740``[link beast.ref.boost__beast__http__icy_stream.read_some.overload1 read_some]``(
18741    MutableBufferSequence const& buffers);
18742  ``[''''&raquo;''' [link beast.ref.boost__beast__http__icy_stream.read_some.overload1 `more...`]]``
18743
18744template<
18745    class __MutableBufferSequence__>
18746std::size_t
18747``[link beast.ref.boost__beast__http__icy_stream.read_some.overload2 read_some]``(
18748    MutableBufferSequence const& buffers,
18749    error_code& ec);
18750  ``[''''&raquo;''' [link beast.ref.boost__beast__http__icy_stream.read_some.overload2 `more...`]]``
18751```
18752
18753[section:overload1 http::icy_stream::read_some (1 of 2 overloads)]
18754
18755Read some data from the stream.
18756[heading Synopsis]
18757```
18758template<
18759    class __MutableBufferSequence__>
18760std::size_t
18761read_some(
18762    MutableBufferSequence const& buffers);
18763```
18764
18765[heading Description]
18766This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
18767
18768[heading Parameters]
18769[table [[Name][Description]]
18770  [
18771    [`buffers`
18772    ]
18773    [
18774The buffers into which the data will be read.
18775    ]
18776  ]
18777]
18778[heading Return Value]
18779The number of bytes read.
18780[heading Exceptions]
18781[table [[Type][Thrown On]]
18782  [
18783    [`system_error`
18784    ]
18785    [
18786Thrown on failure.
18787    ]
18788  ]
18789]
18790[heading Remarks]
18791The `read_some` operation may not read all of the requested number of bytes. Consider using the function [link beast.ref.boost__beast__file_mode `net::read`] if you need to ensure that the requested amount of data is read before the blocking operation completes.
18792
18793[endsect]
18794
18795[section:overload2 http::icy_stream::read_some (2 of 2 overloads)]
18796
18797Read some data from the stream.
18798[heading Synopsis]
18799```
18800template<
18801    class __MutableBufferSequence__>
18802std::size_t
18803read_some(
18804    MutableBufferSequence const& buffers,
18805    error_code& ec);
18806```
18807
18808[heading Description]
18809This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
18810
18811[heading Parameters]
18812[table [[Name][Description]]
18813  [
18814    [`buffers`
18815    ]
18816    [
18817The buffers into which the data will be read.
18818    ]
18819  ]
18820  [
18821    [`ec`
18822    ]
18823    [
18824Set to indicate what error occurred, if any.
18825    ]
18826  ]
18827]
18828[heading Return Value]
18829The number of bytes read.
18830[heading Remarks]
18831The `read_some` operation may not read all of the requested number of bytes. Consider using the function [link beast.ref.boost__beast__file_mode `net::read`] if you need to ensure that the requested amount of data is read before the blocking operation completes.
18832
18833[endsect]
18834
18835
18836[endsect]
18837
18838[section:async_read_some http::icy_stream::async_read_some]
18839[indexterm2 async_read_some..http::icy_stream]
18840
18841
18842Start an asynchronous read.
18843[heading Synopsis]
18844```
18845template<
18846    class __MutableBufferSequence__,
18847    class __ReadHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__http__icy_stream.executor_type executor_type]``>>
18848``__deduced__``
18849async_read_some(
18850    MutableBufferSequence const& buffers,
18851    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__http__icy_stream.executor_type executor_type]`` >{});
18852```
18853
18854[heading Description]
18855This function is used to asynchronously read one or more bytes of data from the stream. The function call always returns immediately.
18856
18857[heading Parameters]
18858[table [[Name][Description]]
18859  [
18860    [`buffers`
18861    ]
18862    [
18863The buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.
18864    ]
18865  ]
18866  [
18867    [`handler`
18868    ]
18869    [
18870
18871The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
18872```
18873void handler(
18874  const boost::system::error_code& error, // Result of operation.
18875  std::size_t bytes_transferred           // Number of bytes read.
18876);
18877```
18878
18879Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using [link beast.ref.boost__beast__http__verb `net::post`].
18880    ]
18881  ]
18882]
18883[heading Remarks]
18884The `async_read_some` operation may not read all of the requested number of bytes. Consider using the function `net::async_read` if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
18885
18886[endsect]
18887
18888[section:write_some http::icy_stream::write_some]
18889[indexterm2 write_some..http::icy_stream]
18890
18891
18892Write some data to the stream.
18893```
18894template<
18895    class __ConstBufferSequence__>
18896std::size_t
18897``[link beast.ref.boost__beast__http__icy_stream.write_some.overload1 write_some]``(
18898    ConstBufferSequence const& buffers);
18899  ``[''''&raquo;''' [link beast.ref.boost__beast__http__icy_stream.write_some.overload1 `more...`]]``
18900
18901template<
18902    class __ConstBufferSequence__>
18903std::size_t
18904``[link beast.ref.boost__beast__http__icy_stream.write_some.overload2 write_some]``(
18905    ConstBufferSequence const& buffers,
18906    error_code& ec);
18907  ``[''''&raquo;''' [link beast.ref.boost__beast__http__icy_stream.write_some.overload2 `more...`]]``
18908```
18909
18910[section:overload1 http::icy_stream::write_some (1 of 2 overloads)]
18911
18912Write some data to the stream.
18913[heading Synopsis]
18914```
18915template<
18916    class __ConstBufferSequence__>
18917std::size_t
18918write_some(
18919    ConstBufferSequence const& buffers);
18920```
18921
18922[heading Description]
18923This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
18924
18925[heading Parameters]
18926[table [[Name][Description]]
18927  [
18928    [`buffers`
18929    ]
18930    [
18931The data to be written.
18932    ]
18933  ]
18934]
18935[heading Return Value]
18936The number of bytes written.
18937[heading Exceptions]
18938[table [[Type][Thrown On]]
18939  [
18940    [`system_error`
18941    ]
18942    [
18943Thrown on failure.
18944    ]
18945  ]
18946]
18947[heading Remarks]
18948The `write_some` operation may not transmit all of the data to the peer. Consider using the function [link beast.ref.boost__beast__file_mode `net::write`] if you need to ensure that all data is written before the blocking operation completes.
18949
18950[endsect]
18951
18952[section:overload2 http::icy_stream::write_some (2 of 2 overloads)]
18953
18954Write some data to the stream.
18955[heading Synopsis]
18956```
18957template<
18958    class __ConstBufferSequence__>
18959std::size_t
18960write_some(
18961    ConstBufferSequence const& buffers,
18962    error_code& ec);
18963```
18964
18965[heading Description]
18966This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
18967
18968[heading Parameters]
18969[table [[Name][Description]]
18970  [
18971    [`buffers`
18972    ]
18973    [
18974The data to be written.
18975    ]
18976  ]
18977  [
18978    [`ec`
18979    ]
18980    [
18981Set to indicate what error occurred, if any.
18982    ]
18983  ]
18984]
18985[heading Return Value]
18986The number of bytes written.
18987[heading Remarks]
18988The `write_some` operation may not transmit all of the data to the peer. Consider using the function [link beast.ref.boost__beast__file_mode `net::write`] if you need to ensure that all data is written before the blocking operation completes.
18989
18990[endsect]
18991
18992
18993[endsect]
18994
18995[section:async_write_some http::icy_stream::async_write_some]
18996[indexterm2 async_write_some..http::icy_stream]
18997
18998
18999Start an asynchronous write.
19000[heading Synopsis]
19001```
19002template<
19003    class __ConstBufferSequence__,
19004    class __WriteHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__http__icy_stream.executor_type executor_type]``>>
19005``__deduced__``
19006async_write_some(
19007    ConstBufferSequence const& buffers,
19008    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__http__icy_stream.executor_type executor_type]`` >{});
19009```
19010
19011[heading Description]
19012This function is used to asynchronously write one or more bytes of data to the stream. The function call always returns immediately.
19013
19014[heading Parameters]
19015[table [[Name][Description]]
19016  [
19017    [`buffers`
19018    ]
19019    [
19020The data to be written to the stream. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.
19021    ]
19022  ]
19023  [
19024    [`handler`
19025    ]
19026    [
19027
19028The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
19029```
19030void handler(
19031  error_code const& error,          // Result of operation.
19032  std::size_t bytes_transferred     // Number of bytes written.
19033);
19034```
19035
19036Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using [link beast.ref.boost__beast__http__verb `net::post`].
19037    ]
19038  ]
19039]
19040[heading Remarks]
19041The `async_write_some` operation may not transmit all of the data to the peer. Consider using the function `net::async_write` if you need to ensure that all data is written before the asynchronous operation completes.
19042
19043[endsect]
19044
19045
19046[endsect]
19047
19048[section:boost__beast__iequal iequal]
19049
19050A case-insensitive equality predicate for strings.
19051[heading Synopsis]
19052Defined in header [include_file boost/beast/core/string.hpp]
19053
19054```
19055struct iequal
19056```
19057
19058[heading Types]
19059[table [[Name][Description]]
19060  [
19061    [[*[link beast.ref.boost__beast__iequal.is_transparent is_transparent]]
19062    ]
19063    [
19064
19065    ]
19066  ]
19067]
19068[heading Member Functions]
19069[table [[Name][Description]]
19070  [
19071    [[*[link beast.ref.boost__beast__iequal.operator_lp__rp_ operator()]]
19072    ]
19073    [
19074
19075    ]
19076  ]
19077]
19078[heading Description]
19079The case-comparison operation is defined only for low-ASCII characters.
19080As of C++14, containers using this class as the `Compare` type will take part in heterogeneous lookup if the search term is implicitly convertible to [link beast.ref.boost__beast__string_view `string_view`].
19081
19082[section:is_transparent iequal::is_transparent]
19083[indexterm2 is_transparent..iequal]
19084
19085
19086[heading Synopsis]
19087```
19088using is_transparent = void;
19089```
19090
19091[heading Description]
19092
19093[endsect]
19094
19095[section:operator_lp__rp_ iequal::operator()]
19096[indexterm2 operator()..iequal]
19097
19098
19099[heading Synopsis]
19100```
19101bool
19102operator()(
19103    string_view lhs,
19104    string_view rhs) const;
19105```
19106
19107[heading Description]
19108
19109[endsect]
19110
19111
19112[endsect]
19113
19114[section:boost__beast__iless iless]
19115
19116A case-insensitive less predicate for strings.
19117[heading Synopsis]
19118Defined in header [include_file boost/beast/core/string.hpp]
19119
19120```
19121struct iless
19122```
19123
19124[heading Types]
19125[table [[Name][Description]]
19126  [
19127    [[*[link beast.ref.boost__beast__iless.is_transparent is_transparent]]
19128    ]
19129    [
19130
19131    ]
19132  ]
19133]
19134[heading Member Functions]
19135[table [[Name][Description]]
19136  [
19137    [[*[link beast.ref.boost__beast__iless.operator_lp__rp_ operator()]]
19138    ]
19139    [
19140
19141    ]
19142  ]
19143]
19144[heading Description]
19145The case-comparison operation is defined only for low-ASCII characters.
19146As of C++14, containers using this class as the `Compare` type will take part in heterogeneous lookup if the search term is implicitly convertible to [link beast.ref.boost__beast__string_view `string_view`].
19147
19148[section:is_transparent iless::is_transparent]
19149[indexterm2 is_transparent..iless]
19150
19151
19152[heading Synopsis]
19153```
19154using is_transparent = void;
19155```
19156
19157[heading Description]
19158
19159[endsect]
19160
19161[section:operator_lp__rp_ iless::operator()]
19162[indexterm2 operator()..iless]
19163
19164
19165[heading Synopsis]
19166```
19167bool
19168operator()(
19169    string_view lhs,
19170    string_view rhs) const;
19171```
19172
19173[heading Description]
19174
19175[endsect]
19176
19177
19178[endsect]
19179
19180[section:boost__beast__zlib__inflate_stream zlib::inflate_stream]
19181
19182Raw deflate stream decompressor.
19183[heading Synopsis]
19184Defined in header [include_file boost/beast/zlib/inflate_stream.hpp]
19185
19186```
19187class inflate_stream :
19188    private inflate_stream
19189```
19190
19191[heading Member Functions]
19192[table [[Name][Description]]
19193  [
19194    [[*[link beast.ref.boost__beast__zlib__inflate_stream.clear clear]]
19195    ]
19196    [
19197
19198Put the stream in a newly constructed state.
19199    ]
19200  ]
19201  [
19202    [[*[link beast.ref.boost__beast__zlib__inflate_stream.inflate_stream inflate_stream]]
19203    ]
19204    [
19205
19206Construct a raw deflate decompression stream.
19207    ]
19208  ]
19209  [
19210    [[*[link beast.ref.boost__beast__zlib__inflate_stream.reset reset]]
19211    ]
19212    [
19213
19214Reset the stream.
19215    ]
19216  ]
19217  [
19218    [[*[link beast.ref.boost__beast__zlib__inflate_stream.write write]]
19219    ]
19220    [
19221
19222Decompress input and produce output.
19223    ]
19224  ]
19225]
19226[heading Description]
19227This implements a raw deflate stream decompressor. The deflate protocol is a compression protocol described in "DEFLATE Compressed Data Format Specification version 1.3" located here: [@https://tools.ietf.org/html/rfc1951 https://tools.ietf.org/html/rfc1951]
19228The implementation is a refactored port to C++ of ZLib's "inflate". A more detailed description of ZLib is at [@http://zlib.net/ http://zlib.net/].
19229Compression can be done in a single step if the buffers are large enough (for example if an input file is memory mapped), or can be done by repeated calls of the compression function. In the latter case, the application must provide more input and/or consume the output (providing more output space) before each call.
19230
19231[section:inflate_stream zlib::inflate_stream::inflate_stream]
19232[indexterm2 inflate_stream..zlib::inflate_stream]
19233
19234
19235Construct a raw deflate decompression stream.
19236[heading Synopsis]
19237```
19238inflate_stream();
19239```
19240
19241[heading Description]
19242The window size is set to the default of 15 bits.
19243
19244[endsect]
19245
19246[section:reset zlib::inflate_stream::reset]
19247[indexterm2 reset..zlib::inflate_stream]
19248
19249
19250Reset the stream.
19251```
19252void
19253``[link beast.ref.boost__beast__zlib__inflate_stream.reset.overload1 reset]``();
19254  ``[''''&raquo;''' [link beast.ref.boost__beast__zlib__inflate_stream.reset.overload1 `more...`]]``
19255
19256void
19257``[link beast.ref.boost__beast__zlib__inflate_stream.reset.overload2 reset]``(
19258    int windowBits);
19259  ``[''''&raquo;''' [link beast.ref.boost__beast__zlib__inflate_stream.reset.overload2 `more...`]]``
19260```
19261
19262[section:overload1 zlib::inflate_stream::reset (1 of 2 overloads)]
19263
19264Reset the stream.
19265[heading Synopsis]
19266```
19267void
19268reset();
19269```
19270
19271[heading Description]
19272This puts the stream in a newly constructed state with the previously specified window size, but without de-allocating any dynamically created structures.
19273
19274[endsect]
19275
19276[section:overload2 zlib::inflate_stream::reset (2 of 2 overloads)]
19277
19278Reset the stream.
19279[heading Synopsis]
19280```
19281void
19282reset(
19283    int windowBits);
19284```
19285
19286[heading Description]
19287This puts the stream in a newly constructed state with the specified window size, but without de-allocating any dynamically created structures.
19288
19289[endsect]
19290
19291
19292[endsect]
19293
19294[section:clear zlib::inflate_stream::clear]
19295[indexterm2 clear..zlib::inflate_stream]
19296
19297
19298Put the stream in a newly constructed state.
19299[heading Synopsis]
19300```
19301void
19302clear();
19303```
19304
19305[heading Description]
19306All dynamically allocated memory is de-allocated.
19307
19308[endsect]
19309
19310[section:write zlib::inflate_stream::write]
19311[indexterm2 write..zlib::inflate_stream]
19312
19313
19314Decompress input and produce output.
19315[heading Synopsis]
19316```
19317void
19318write(
19319    z_params& zs,
19320    Flush flush,
19321    error_code& ec);
19322```
19323
19324[heading Description]
19325This function decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush.
19326One or both of the following actions are performed:
19327
19328* Decompress more input starting at `zs.next_in` and update `zs.next_in` and `zs.avail_in` accordingly. If not all input can be processed (because there is not enough room in the output buffer), `zs.next_in` is updated and processing will resume at this point for the next call.
19329
19330* Provide more output starting at `zs.next_out` and update `zs.next_out` and `zs.avail_out` accordingly. `write` provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter).
19331
19332Before the call, the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the values in `zs` accordingly. The application can consume the uncompressed output when it wants, for example when the output buffer is full (`zs.avail_out == 0`), or after each call. If `write` returns no error and with zero `zs.avail_out`, it must be called again after making room in the output buffer because there might be more output pending.
19333The flush parameter may be [link beast.ref.boost__beast__zlib__Flush `Flush::none`], [link beast.ref.boost__beast__zlib__Flush `Flush::sync`], [link beast.ref.boost__beast__zlib__Flush `Flush::finish`], [link beast.ref.boost__beast__zlib__Flush `Flush::block`], or [link beast.ref.boost__beast__zlib__Flush `Flush::trees`]. [link beast.ref.boost__beast__zlib__Flush `Flush::sync`] requests to flush as much output as possible to the output buffer. [link beast.ref.boost__beast__zlib__Flush `Flush::block`] requests to stop if and when it gets to the next deflate block boundary. When decoding the zlib or gzip format, this will cause `write` to return immediately after the header and before the first block. When doing a raw inflate, `write` will go ahead and process the first block, and will return when it gets to the end of that block, or when it runs out of data.
19334The [link beast.ref.boost__beast__zlib__Flush `Flush::block`] option assists in appending to or combining deflate streams. Also to assist in this, on return `write` will set `zs.data_type` to the number of unused bits in the last byte taken from `zs.next_in`, plus 64 if `write` is currently decoding the last block in the deflate stream, plus 128 if `write` returned immediately after decoding an end-of-block code or decoding the complete header up to just before the first byte of the deflate stream. The end-of-block will not be indicated until all of the uncompressed data from that block has been written to `zs.next_out`. The number of unused bits may in general be greater than seven, except when bit 7 of `zs.data_type` is set, in which case the number of unused bits will be less than eight. `zs.data_type` is set as noted here every time `write` returns for all flush options, and so can be used to determine the amount of currently consumed input in bits.
19335The [link beast.ref.boost__beast__zlib__Flush `Flush::trees`] option behaves as [link beast.ref.boost__beast__zlib__Flush `Flush::block`] does, but it also returns when the end of each deflate block header is reached, before any actual data in that block is decoded. This allows the caller to determine the length of the deflate block header for later use in random access within a deflate block. 256 is added to the value of `zs.data_type` when `write` returns immediately after reaching the end of the deflate block header.
19336`write` should normally be called until it returns [link beast.ref.boost__beast__zlib__error `error::end_of_stream`] or another error. However if all decompression is to be performed in a single step (a single call of `write`), the parameter flush should be set to [link beast.ref.boost__beast__zlib__Flush `Flush::finish`]. In this case all pending input is processed and all pending output is flushed; `zs.avail_out` must be large enough to hold all of the uncompressed data for the operation to complete. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The use of [link beast.ref.boost__beast__zlib__Flush `Flush::finish`] is not required to perform an inflation in one step. However it may be used to inform inflate that a faster approach can be used for the single call. [link beast.ref.boost__beast__zlib__Flush `Flush::finish`] also informs inflate to not maintain a sliding window if the stream completes, which reduces inflate's memory footprint. If the stream does not complete, either because not all of the stream is provided or not enough output space is provided, then a sliding window will be allocated and `write` can be called again to continue the operation as if [link beast.ref.boost__beast__zlib__Flush `Flush::none`] had been used.
19337In this implementation, `write` always flushes as much output as possible to the output buffer, and always uses the faster approach on the first call. So the effects of the flush parameter in this implementation are on the return value of `write` as noted below, when `write` returns early when [link beast.ref.boost__beast__zlib__Flush `Flush::block`] or [link beast.ref.boost__beast__zlib__Flush `Flush::trees`] is used, and when `write` avoids the allocation of memory for a sliding window when [link beast.ref.boost__beast__zlib__Flush `Flush::finish`] is used.
19338If a preset dictionary is needed after this call, `write` sets `zs.adler` to the Adler-32 checksum of the dictionary chosen by the compressor and returns `error::need_dictionary`; otherwise it sets `zs.adler` to the Adler-32 checksum of all output produced so far (that is, `zs.total_out bytes`) and returns no error, [link beast.ref.boost__beast__zlib__error `error::end_of_stream`], or an error code as described below. At the end of the stream, `write` checks that its computed adler32 checksum is equal to that saved by the compressor and returns [link beast.ref.boost__beast__zlib__error `error::end_of_stream`] only if the checksum is correct.
19339This function returns no error if some progress has been made (more input processed or more output produced), [link beast.ref.boost__beast__zlib__error `error::end_of_stream`] if the end of the compressed data has been reached and all uncompressed output has been produced, `error::need_dictionary` if a preset dictionary is needed at this point, `error::invalid_data` if the input data was corrupted (input stream not conforming to the zlib format or incorrect check value), [link beast.ref.boost__beast__zlib__error `error::stream_error`] if the stream structure was inconsistent (for example if `zs.next_in` or `zs.next_out` was null), [link beast.ref.boost__beast__zlib__error `error::need_buffers`] if no progress is possible or if there was not enough room in the output buffer when [link beast.ref.boost__beast__zlib__Flush `Flush::finish`] is used. Note that [link beast.ref.boost__beast__zlib__error `error::need_buffers`] is not fatal, and `write` can be called again with more input and more output space to continue decompressing.
19340
19341[endsect]
19342
19343
19344[endsect]
19345
19346[section:boost__beast__is_file is_file]
19347
19348Determine if `T` meets the requirements of ['File].
19349[heading Synopsis]
19350Defined in header [include_file boost/beast/core/file_base.hpp]
19351
19352```
19353template<
19354    class T>
19355struct is_file :
19356    public std::integral_constant< bool,... >
19357```
19358
19359[heading Description]
19360Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, else the type will be `std::false_type`.
19361
19362[heading Example]
19363
19364Use with `static_assert`:
19365
19366```
19367template<class File>
19368void f(File& file)
19369{
19370    static_assert(is_file<File>::value,
19371        "File type requirements not met");
19372...
19373```
19374
19375Use with `std::enable_if` (SFINAE):
19376
19377```
19378template<class File>
19379typename std::enable_if<is_file<File>::value>::type
19380f(File& file);
19381```
19382
19383
19384
19385[endsect]
19386
19387[section:boost__beast__http__message http::message]
19388
19389A container for a complete HTTP message.
19390[heading Synopsis]
19391Defined in header [include_file boost/beast/http/message.hpp]
19392
19393```
19394template<
19395    bool isRequest,
19396    class __Body__,
19397    class __Fields__ = ``[link beast.ref.boost__beast__http__fields fields]``>
19398class message :
19399    public http::header< isRequest, Fields >
19400```
19401
19402[heading Types]
19403[table [[Name][Description]]
19404  [
19405    [[*[link beast.ref.boost__beast__http__message.body_type body_type]]
19406    ]
19407    [
19408
19409The type providing the body traits.
19410    ]
19411  ]
19412  [
19413    [[*[link beast.ref.boost__beast__http__message.fields_type fields_type]]
19414    ]
19415    [
19416
19417The type representing the fields.
19418    ]
19419  ]
19420  [
19421    [[*[link beast.ref.boost__beast__http__message.header_type header_type]]
19422    ]
19423    [
19424
19425The base class used to hold the header portion of the message.
19426    ]
19427  ]
19428  [
19429    [[*[link beast.ref.boost__beast__http__message.is_request is_request]]
19430    ]
19431    [
19432
19433Indicates if the header is a request or response.
19434    ]
19435  ]
19436]
19437[heading Member Functions]
19438[table [[Name][Description]]
19439  [
19440    [[*[link beast.ref.boost__beast__http__message.base base]]
19441    ]
19442    [
19443
19444Returns the header portion of the message.
19445    ]
19446  ]
19447  [
19448    [[*[link beast.ref.boost__beast__http__message.body body]]
19449    ]
19450    [
19451
19452Returns the body.
19453    ]
19454  ]
19455  [
19456    [[*[link beast.ref.boost__beast__http__message.chunked chunked]]
19457    ]
19458    [
19459
19460Returns `true` if the chunked Transfer-Encoding is specified.
19461
19462Set or clear the chunked Transfer-Encoding.
19463    ]
19464  ]
19465  [
19466    [[*[link beast.ref.boost__beast__http__message.content_length content_length]]
19467    ]
19468    [
19469
19470Set or clear the Content-Length field.
19471    ]
19472  ]
19473  [
19474    [[*[link beast.ref.boost__beast__http__message.has_content_length has_content_length]]
19475    ]
19476    [
19477
19478Returns `true` if the Content-Length field is present.
19479    ]
19480  ]
19481  [
19482    [[*[link beast.ref.boost__beast__http__message.keep_alive keep_alive]]
19483    ]
19484    [
19485
19486Returns `true` if the message semantics indicate keep-alive.
19487
19488Set the keep-alive message semantic option.
19489    ]
19490  ]
19491  [
19492    [[*[link beast.ref.boost__beast__http__message.message message]]
19493    ]
19494    [
19495
19496Constructor.
19497
19498Construct a message.
19499    ]
19500  ]
19501  [
19502    [[*[link beast.ref.boost__beast__http__message.method method]]
19503    ]
19504    [
19505
19506Return the request-method verb.
19507
19508Set the request-method.
19509    ]
19510  ]
19511  [
19512    [[*[link beast.ref.boost__beast__http__message.method_string method_string]]
19513    ]
19514    [
19515
19516Return the request-method as a string.
19517
19518Set the request-method.
19519    ]
19520  ]
19521  [
19522    [[*[link beast.ref.boost__beast__http__message.need_eof need_eof]]
19523    ]
19524    [
19525
19526Returns `true` if the message semantics require an end of file.
19527    ]
19528  ]
19529  [
19530    [[*[link beast.ref.boost__beast__http__message.operator_eq_ operator=]]
19531    ]
19532    [
19533
19534Assignment.
19535    ]
19536  ]
19537  [
19538    [[*[link beast.ref.boost__beast__http__message.payload_size payload_size]]
19539    ]
19540    [
19541
19542Returns the payload size of the body in octets if possible.
19543    ]
19544  ]
19545  [
19546    [[*[link beast.ref.boost__beast__http__message.prepare_payload prepare_payload]]
19547    ]
19548    [
19549
19550Prepare the message payload fields for the body.
19551    ]
19552  ]
19553  [
19554    [[*[link beast.ref.boost__beast__http__message.reason reason]]
19555    ]
19556    [
19557
19558Return the response reason-phrase.
19559
19560Set the response reason-phrase (deprecated)
19561    ]
19562  ]
19563  [
19564    [[*[link beast.ref.boost__beast__http__message.result result]]
19565    ]
19566    [
19567
19568The response status-code result.
19569
19570Set the response status-code.
19571
19572Set the response status-code as an integer.
19573    ]
19574  ]
19575  [
19576    [[*[link beast.ref.boost__beast__http__message.result_int result_int]]
19577    ]
19578    [
19579
19580The response status-code expressed as an integer.
19581    ]
19582  ]
19583  [
19584    [[*[link beast.ref.boost__beast__http__message.target target]]
19585    ]
19586    [
19587
19588Returns the request-target string.
19589
19590Set the request-target string.
19591    ]
19592  ]
19593  [
19594    [[*[link beast.ref.boost__beast__http__message.version version]]
19595    ]
19596    [
19597
19598Return the HTTP-version.
19599
19600Set the HTTP-version.
19601    ]
19602  ]
19603]
19604[heading Description]
19605This container is derived from the `Fields` template type. To understand all of the members of this class it is necessary to view the declaration for the `Fields` type. When using the default fields container, those declarations are in [link beast.ref.boost__beast__http__fields `fields`].
19606A message can be a request or response, depending on the `isRequest` template argument value. Requests and responses have different types; functions may be overloaded based on the type if desired.
19607The `Body` template argument type determines the model used to read or write the content body of the message.
19608Newly constructed messages objects have version set to HTTP/1.1. Newly constructed response objects also have result code set to [link beast.ref.boost__beast__http__status `status::ok`].
19609
19610[heading Template Parameters]
19611[table [[Type][Description]]
19612  [
19613    [`isRequest`
19614    ]
19615    [
19616`true` if this represents a request, or `false` if this represents a response. Some class data members are conditionally present depending on this value.
19617    ]
19618  ]
19619  [
19620    [`Body`
19621    ]
19622    [
19623A type meeting the requirements of Body.
19624    ]
19625  ]
19626  [
19627    [`Fields`
19628    ]
19629    [
19630The type of container used to hold the field value pairs.
19631    ]
19632  ]
19633]
19634
19635[section:header_type http::message::header_type]
19636[indexterm2 header_type..http::message]
19637
19638
19639The base class used to hold the header portion of the message.
19640[heading Synopsis]
19641```
19642using header_type = header< isRequest, Fields >;
19643```
19644
19645[heading Types]
19646[table [[Name][Description]]
19647  [
19648    [[*[link beast.ref.boost__beast__http__header.fields_type fields_type]]
19649    ]
19650    [
19651
19652The type representing the fields.
19653    ]
19654  ]
19655  [
19656    [[*[link beast.ref.boost__beast__http__header.is_request is_request]]
19657    ]
19658    [
19659
19660Indicates if the header is a request or response.
19661    ]
19662  ]
19663]
19664[heading Member Functions]
19665[table [[Name][Description]]
19666  [
19667    [[*[link beast.ref.boost__beast__http__header.header header]]
19668    ]
19669    [
19670
19671Constructor.
19672    ]
19673  ]
19674  [
19675    [[*[link beast.ref.boost__beast__http__header.method method]]
19676    ]
19677    [
19678
19679Return the request-method verb.
19680
19681Set the request-method.
19682    ]
19683  ]
19684  [
19685    [[*[link beast.ref.boost__beast__http__header.method_string method_string]]
19686    ]
19687    [
19688
19689Return the request-method as a string.
19690
19691Set the request-method.
19692    ]
19693  ]
19694  [
19695    [[*[link beast.ref.boost__beast__http__header.operator_eq_ operator=]]
19696    ]
19697    [
19698
19699Assignment.
19700    ]
19701  ]
19702  [
19703    [[*[link beast.ref.boost__beast__http__header.reason reason]]
19704    ]
19705    [
19706
19707Return the response reason-phrase.
19708
19709Set the response reason-phrase (deprecated)
19710    ]
19711  ]
19712  [
19713    [[*[link beast.ref.boost__beast__http__header.result result]]
19714    ]
19715    [
19716
19717The response status-code result.
19718
19719Set the response status-code.
19720
19721Set the response status-code as an integer.
19722    ]
19723  ]
19724  [
19725    [[*[link beast.ref.boost__beast__http__header.result_int result_int]]
19726    ]
19727    [
19728
19729The response status-code expressed as an integer.
19730    ]
19731  ]
19732  [
19733    [[*[link beast.ref.boost__beast__http__header.target target]]
19734    ]
19735    [
19736
19737Returns the request-target string.
19738
19739Set the request-target string.
19740    ]
19741  ]
19742  [
19743    [[*[link beast.ref.boost__beast__http__header.version version]]
19744    ]
19745    [
19746
19747Return the HTTP-version.
19748
19749Set the HTTP-version.
19750    ]
19751  ]
19752]
19753This container is derived from the `Fields` template type. To understand all of the members of this class it is necessary to view the declaration for the `Fields` type. When using the default fields container, those declarations are in [link beast.ref.boost__beast__http__fields `fields`].
19754Newly constructed header objects have version set to HTTP/1.1. Newly constructed response objects also have result code set to [link beast.ref.boost__beast__http__status `status::ok`].
19755A `header` includes the start-line and header-fields.
19756[heading Description]
19757
19758[endsect]
19759
19760[section:body_type http::message::body_type]
19761[indexterm2 body_type..http::message]
19762
19763
19764The type providing the body traits.
19765[heading Synopsis]
19766```
19767using body_type = Body;
19768```
19769
19770[heading Description]
19771The [link beast.ref.boost__beast__http__message.body `message::body`] member will be of type `body_type::value_type`.
19772
19773[endsect]
19774
19775[section:is_request http::message::is_request]
19776[indexterm2 is_request..http::message]
19777
19778(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
19779
19780Indicates if the header is a request or response.
19781[heading Synopsis]
19782```
19783using is_request = std::integral_constant< bool, isRequest >;
19784```
19785
19786[heading Description]
19787
19788[endsect]
19789
19790[section:fields_type http::message::fields_type]
19791[indexterm2 fields_type..http::message]
19792
19793(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
19794
19795The type representing the fields.
19796[heading Synopsis]
19797```
19798using fields_type = Fields;
19799```
19800
19801[heading Description]
19802
19803[endsect]
19804
19805[section:message http::message::message]
19806[indexterm2 message..http::message]
19807
19808
19809Constructor.
19810```
19811``[link beast.ref.boost__beast__http__message.message.overload1 message]``();
19812  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload1 `more...`]]``
19813
19814``[link beast.ref.boost__beast__http__message.message.overload2 message]``(
19815    message&&);
19816  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload2 `more...`]]``
19817
19818``[link beast.ref.boost__beast__http__message.message.overload3 message]``(
19819    message const&);
19820  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload3 `more...`]]``
19821
19822template<
19823    class... BodyArgs>
19824explicit
19825``[link beast.ref.boost__beast__http__message.message.overload4 message]``(
19826    header_type&& h,
19827    BodyArgs&&... body_args);
19828  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload4 `more...`]]``
19829
19830template<
19831    class... BodyArgs>
19832explicit
19833``[link beast.ref.boost__beast__http__message.message.overload5 message]``(
19834    header_type const& h,
19835    BodyArgs&&... body_args);
19836  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload5 `more...`]]``
19837
19838``[link beast.ref.boost__beast__http__message.message.overload6 message]``(
19839    verb method,
19840    string_view target,
19841    unsigned version);
19842  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload6 `more...`]]``
19843
19844template<
19845    class BodyArg>
19846``[link beast.ref.boost__beast__http__message.message.overload7 message]``(
19847    verb method,
19848    string_view target,
19849    unsigned version,
19850    BodyArg&& body_arg);
19851  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload7 `more...`]]``
19852
19853template<
19854    class BodyArg,
19855    class FieldsArg>
19856``[link beast.ref.boost__beast__http__message.message.overload8 message]``(
19857    verb method,
19858    string_view target,
19859    unsigned version,
19860    BodyArg&& body_arg,
19861    FieldsArg&& fields_arg);
19862  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload8 `more...`]]``
19863
19864``[link beast.ref.boost__beast__http__message.message.overload9 message]``(
19865    status result,
19866    unsigned version);
19867  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload9 `more...`]]``
19868
19869template<
19870    class BodyArg>
19871``[link beast.ref.boost__beast__http__message.message.overload10 message]``(
19872    status result,
19873    unsigned version,
19874    BodyArg&& body_arg);
19875  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload10 `more...`]]``
19876
19877template<
19878    class BodyArg,
19879    class FieldsArg>
19880``[link beast.ref.boost__beast__http__message.message.overload11 message]``(
19881    status result,
19882    unsigned version,
19883    BodyArg&& body_arg,
19884    FieldsArg&& fields_arg);
19885  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload11 `more...`]]``
19886
19887explicit
19888``[link beast.ref.boost__beast__http__message.message.overload12 message]``(
19889    std::piecewise_construct_t);
19890  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload12 `more...`]]``
19891```
19892
19893
19894Construct a message.
19895```
19896template<
19897    class... BodyArgs>
19898``[link beast.ref.boost__beast__http__message.message.overload13 message]``(
19899    std::piecewise_construct_t,
19900    std::tuple< BodyArgs... > body_args);
19901  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload13 `more...`]]``
19902
19903template<
19904    class... BodyArgs,
19905    class... FieldsArgs>
19906``[link beast.ref.boost__beast__http__message.message.overload14 message]``(
19907    std::piecewise_construct_t,
19908    std::tuple< BodyArgs... > body_args,
19909    std::tuple< FieldsArgs... > fields_args);
19910  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.message.overload14 `more...`]]``
19911```
19912
19913[section:overload1 http::message::message (1 of 14 overloads)]
19914
19915Constructor.
19916[heading Synopsis]
19917```
19918message();
19919```
19920
19921[heading Description]
19922
19923[endsect]
19924
19925[section:overload2 http::message::message (2 of 14 overloads)]
19926
19927Constructor.
19928[heading Synopsis]
19929```
19930message(
19931    message&&);
19932```
19933
19934[heading Description]
19935
19936[endsect]
19937
19938[section:overload3 http::message::message (3 of 14 overloads)]
19939
19940Constructor.
19941[heading Synopsis]
19942```
19943message(
19944    message const&);
19945```
19946
19947[heading Description]
19948
19949[endsect]
19950
19951[section:overload4 http::message::message (4 of 14 overloads)]
19952
19953Constructor.
19954[heading Synopsis]
19955```
19956template<
19957    class... BodyArgs>
19958message(
19959    header_type&& h,
19960    BodyArgs&&... body_args);
19961```
19962
19963[heading Description]
19964
19965[heading Parameters]
19966[table [[Name][Description]]
19967  [
19968    [`h`
19969    ]
19970    [
19971The header to move construct from.
19972    ]
19973  ]
19974  [
19975    [`body_args`
19976    ]
19977    [
19978Optional arguments forwarded to the `body` constructor.
19979    ]
19980  ]
19981]
19982
19983[endsect]
19984
19985[section:overload5 http::message::message (5 of 14 overloads)]
19986
19987Constructor.
19988[heading Synopsis]
19989```
19990template<
19991    class... BodyArgs>
19992message(
19993    header_type const& h,
19994    BodyArgs&&... body_args);
19995```
19996
19997[heading Description]
19998
19999[heading Parameters]
20000[table [[Name][Description]]
20001  [
20002    [`h`
20003    ]
20004    [
20005The header to copy construct from.
20006    ]
20007  ]
20008  [
20009    [`body_args`
20010    ]
20011    [
20012Optional arguments forwarded to the `body` constructor.
20013    ]
20014  ]
20015]
20016
20017[endsect]
20018
20019[section:overload6 http::message::message (6 of 14 overloads)]
20020
20021Constructor.
20022[heading Synopsis]
20023```
20024message(
20025    verb method,
20026    string_view target,
20027    unsigned version);
20028```
20029
20030[heading Description]
20031
20032[heading Parameters]
20033[table [[Name][Description]]
20034  [
20035    [`method`
20036    ]
20037    [
20038The request-method to use.
20039    ]
20040  ]
20041  [
20042    [`target`
20043    ]
20044    [
20045The request-target.
20046    ]
20047  ]
20048  [
20049    [`version`
20050    ]
20051    [
20052The HTTP-version.
20053    ]
20054  ]
20055]
20056[heading Remarks]
20057This function is only available when `isRequest == true`.
20058
20059[endsect]
20060
20061[section:overload7 http::message::message (7 of 14 overloads)]
20062
20063Constructor.
20064[heading Synopsis]
20065```
20066template<
20067    class BodyArg>
20068message(
20069    verb method,
20070    string_view target,
20071    unsigned version,
20072    BodyArg&& body_arg);
20073```
20074
20075[heading Description]
20076
20077[heading Parameters]
20078[table [[Name][Description]]
20079  [
20080    [`method`
20081    ]
20082    [
20083The request-method to use.
20084    ]
20085  ]
20086  [
20087    [`target`
20088    ]
20089    [
20090The request-target.
20091    ]
20092  ]
20093  [
20094    [`version`
20095    ]
20096    [
20097The HTTP-version.
20098    ]
20099  ]
20100  [
20101    [`body_arg`
20102    ]
20103    [
20104An argument forwarded to the `body` constructor.
20105    ]
20106  ]
20107]
20108[heading Remarks]
20109This function is only available when `isRequest == true`.
20110
20111[endsect]
20112
20113[section:overload8 http::message::message (8 of 14 overloads)]
20114
20115Constructor.
20116[heading Synopsis]
20117```
20118template<
20119    class BodyArg,
20120    class FieldsArg>
20121message(
20122    verb method,
20123    string_view target,
20124    unsigned version,
20125    BodyArg&& body_arg,
20126    FieldsArg&& fields_arg);
20127```
20128
20129[heading Description]
20130
20131[heading Parameters]
20132[table [[Name][Description]]
20133  [
20134    [`method`
20135    ]
20136    [
20137The request-method to use.
20138    ]
20139  ]
20140  [
20141    [`target`
20142    ]
20143    [
20144The request-target.
20145    ]
20146  ]
20147  [
20148    [`version`
20149    ]
20150    [
20151The HTTP-version.
20152    ]
20153  ]
20154  [
20155    [`body_arg`
20156    ]
20157    [
20158An argument forwarded to the `body` constructor.
20159    ]
20160  ]
20161  [
20162    [`fields_arg`
20163    ]
20164    [
20165An argument forwarded to the `Fields` constructor.
20166    ]
20167  ]
20168]
20169[heading Remarks]
20170This function is only available when `isRequest == true`.
20171
20172[endsect]
20173
20174[section:overload9 http::message::message (9 of 14 overloads)]
20175
20176Constructor.
20177[heading Synopsis]
20178```
20179message(
20180    status result,
20181    unsigned version);
20182```
20183
20184[heading Description]
20185
20186[heading Parameters]
20187[table [[Name][Description]]
20188  [
20189    [`result`
20190    ]
20191    [
20192The status-code for the response.
20193    ]
20194  ]
20195  [
20196    [`version`
20197    ]
20198    [
20199The HTTP-version.
20200    ]
20201  ]
20202]
20203[heading Remarks]
20204This member is only available when `isRequest == false`.
20205
20206[endsect]
20207
20208[section:overload10 http::message::message (10 of 14 overloads)]
20209
20210Constructor.
20211[heading Synopsis]
20212```
20213template<
20214    class BodyArg>
20215message(
20216    status result,
20217    unsigned version,
20218    BodyArg&& body_arg);
20219```
20220
20221[heading Description]
20222
20223[heading Parameters]
20224[table [[Name][Description]]
20225  [
20226    [`result`
20227    ]
20228    [
20229The status-code for the response.
20230    ]
20231  ]
20232  [
20233    [`version`
20234    ]
20235    [
20236The HTTP-version.
20237    ]
20238  ]
20239  [
20240    [`body_arg`
20241    ]
20242    [
20243An argument forwarded to the `body` constructor.
20244    ]
20245  ]
20246]
20247[heading Remarks]
20248This member is only available when `isRequest == false`.
20249
20250[endsect]
20251
20252[section:overload11 http::message::message (11 of 14 overloads)]
20253
20254Constructor.
20255[heading Synopsis]
20256```
20257template<
20258    class BodyArg,
20259    class FieldsArg>
20260message(
20261    status result,
20262    unsigned version,
20263    BodyArg&& body_arg,
20264    FieldsArg&& fields_arg);
20265```
20266
20267[heading Description]
20268
20269[heading Parameters]
20270[table [[Name][Description]]
20271  [
20272    [`result`
20273    ]
20274    [
20275The status-code for the response.
20276    ]
20277  ]
20278  [
20279    [`version`
20280    ]
20281    [
20282The HTTP-version.
20283    ]
20284  ]
20285  [
20286    [`body_arg`
20287    ]
20288    [
20289An argument forwarded to the `body` constructor.
20290    ]
20291  ]
20292  [
20293    [`fields_arg`
20294    ]
20295    [
20296An argument forwarded to the `Fields` base class constructor.
20297    ]
20298  ]
20299]
20300[heading Remarks]
20301This member is only available when `isRequest == false`.
20302
20303[endsect]
20304
20305[section:overload12 http::message::message (12 of 14 overloads)]
20306
20307Constructor.
20308[heading Synopsis]
20309```
20310message(
20311    std::piecewise_construct_t);
20312```
20313
20314[heading Description]
20315The header and body are default-constructed.
20316
20317[endsect]
20318
20319[section:overload13 http::message::message (13 of 14 overloads)]
20320
20321Construct a message.
20322[heading Synopsis]
20323```
20324template<
20325    class... BodyArgs>
20326message(
20327    std::piecewise_construct_t,
20328    std::tuple< BodyArgs... > body_args);
20329```
20330
20331[heading Description]
20332
20333[heading Parameters]
20334[table [[Name][Description]]
20335  [
20336    [`body_args`
20337    ]
20338    [
20339A tuple forwarded as a parameter pack to the body constructor.
20340    ]
20341  ]
20342]
20343
20344[endsect]
20345
20346[section:overload14 http::message::message (14 of 14 overloads)]
20347
20348Construct a message.
20349[heading Synopsis]
20350```
20351template<
20352    class... BodyArgs,
20353    class... FieldsArgs>
20354message(
20355    std::piecewise_construct_t,
20356    std::tuple< BodyArgs... > body_args,
20357    std::tuple< FieldsArgs... > fields_args);
20358```
20359
20360[heading Description]
20361
20362[heading Parameters]
20363[table [[Name][Description]]
20364  [
20365    [`body_args`
20366    ]
20367    [
20368A tuple forwarded as a parameter pack to the body constructor.
20369    ]
20370  ]
20371  [
20372    [`fields_args`
20373    ]
20374    [
20375A tuple forwarded as a parameter pack to the `Fields` constructor.
20376    ]
20377  ]
20378]
20379
20380[endsect]
20381
20382
20383[endsect]
20384
20385[section:operator_eq_ http::message::operator=]
20386[indexterm2 operator=..http::message]
20387
20388
20389Assignment.
20390```
20391message&
20392``[link beast.ref.boost__beast__http__message.operator_eq_.overload1 operator=]``(
20393    message&&);
20394  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.operator_eq_.overload1 `more...`]]``
20395
20396message&
20397``[link beast.ref.boost__beast__http__message.operator_eq_.overload2 operator=]``(
20398    message const&);
20399  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.operator_eq_.overload2 `more...`]]``
20400```
20401
20402[section:overload1 http::message::operator= (1 of 2 overloads)]
20403
20404Assignment.
20405[heading Synopsis]
20406```
20407message&
20408operator=(
20409    message&&);
20410```
20411
20412[heading Description]
20413
20414[endsect]
20415
20416[section:overload2 http::message::operator= (2 of 2 overloads)]
20417
20418Assignment.
20419[heading Synopsis]
20420```
20421message&
20422operator=(
20423    message const&);
20424```
20425
20426[heading Description]
20427
20428[endsect]
20429
20430
20431[endsect]
20432
20433[section:base http::message::base]
20434[indexterm2 base..http::message]
20435
20436
20437Returns the header portion of the message.
20438```
20439header_type const&
20440``[link beast.ref.boost__beast__http__message.base.overload1 base]``() const;
20441  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.base.overload1 `more...`]]``
20442
20443header_type&
20444``[link beast.ref.boost__beast__http__message.base.overload2 base]``();
20445  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.base.overload2 `more...`]]``
20446```
20447
20448[section:overload1 http::message::base (1 of 2 overloads)]
20449
20450Returns the header portion of the message.
20451[heading Synopsis]
20452```
20453header_type const&
20454base() const;
20455```
20456
20457[heading Description]
20458
20459[endsect]
20460
20461[section:overload2 http::message::base (2 of 2 overloads)]
20462
20463Returns the header portion of the message.
20464[heading Synopsis]
20465```
20466header_type&
20467base();
20468```
20469
20470[heading Description]
20471
20472[endsect]
20473
20474
20475[endsect]
20476
20477[section:chunked http::message::chunked]
20478[indexterm2 chunked..http::message]
20479
20480
20481Returns `true` if the chunked Transfer-Encoding is specified.
20482```
20483bool
20484``[link beast.ref.boost__beast__http__message.chunked.overload1 chunked]``() const;
20485  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.chunked.overload1 `more...`]]``
20486```
20487
20488
20489Set or clear the chunked Transfer-Encoding.
20490```
20491void
20492``[link beast.ref.boost__beast__http__message.chunked.overload2 chunked]``(
20493    bool value);
20494  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.chunked.overload2 `more...`]]``
20495```
20496
20497[section:overload1 http::message::chunked (1 of 2 overloads)]
20498
20499Returns `true` if the chunked Transfer-Encoding is specified.
20500[heading Synopsis]
20501```
20502bool
20503chunked() const;
20504```
20505
20506[heading Description]
20507
20508[endsect]
20509
20510[section:overload2 http::message::chunked (2 of 2 overloads)]
20511
20512Set or clear the chunked Transfer-Encoding.
20513[heading Synopsis]
20514```
20515void
20516chunked(
20517    bool value);
20518```
20519
20520[heading Description]
20521This function will set or remove the "chunked" transfer encoding as the last item in the list of encodings in the field.
20522If the result of removing the chunked token results in an empty string, the field is erased.
20523The Content-Length field is erased unconditionally.
20524
20525[endsect]
20526
20527
20528[endsect]
20529
20530[section:has_content_length http::message::has_content_length]
20531[indexterm2 has_content_length..http::message]
20532
20533
20534Returns `true` if the Content-Length field is present.
20535[heading Synopsis]
20536```
20537bool
20538has_content_length() const;
20539```
20540
20541[heading Description]
20542This function inspects the fields and returns `true` if the Content-Length field is present. The properties of the body are not checked, this only looks for the field.
20543
20544[endsect]
20545
20546[section:content_length http::message::content_length]
20547[indexterm2 content_length..http::message]
20548
20549
20550Set or clear the Content-Length field.
20551[heading Synopsis]
20552```
20553void
20554content_length(
20555    boost::optional< std::uint64_t > const& value);
20556```
20557
20558[heading Description]
20559This function adjusts the Content-Length field as follows:
20560
20561* If `value` specifies a value, the Content-Length field is set to the value. Otherwise
20562
20563* The Content-Length field is erased.
20564
20565If "chunked" token appears as the last item in the Transfer-Encoding field it is unconditionally removed.
20566
20567[heading Parameters]
20568[table [[Name][Description]]
20569  [
20570    [`value`
20571    ]
20572    [
20573The value to set for Content-Length.
20574    ]
20575  ]
20576]
20577
20578[endsect]
20579
20580[section:keep_alive http::message::keep_alive]
20581[indexterm2 keep_alive..http::message]
20582
20583
20584Returns `true` if the message semantics indicate keep-alive.
20585```
20586bool
20587``[link beast.ref.boost__beast__http__message.keep_alive.overload1 keep_alive]``() const;
20588  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.keep_alive.overload1 `more...`]]``
20589```
20590
20591
20592Set the keep-alive message semantic option.
20593```
20594void
20595``[link beast.ref.boost__beast__http__message.keep_alive.overload2 keep_alive]``(
20596    bool value);
20597  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.keep_alive.overload2 `more...`]]``
20598```
20599
20600[section:overload1 http::message::keep_alive (1 of 2 overloads)]
20601
20602Returns `true` if the message semantics indicate keep-alive.
20603[heading Synopsis]
20604```
20605bool
20606keep_alive() const;
20607```
20608
20609[heading Description]
20610The value depends on the version in the message, which must be set to the final value before this function is called or else the return value is unreliable.
20611
20612[endsect]
20613
20614[section:overload2 http::message::keep_alive (2 of 2 overloads)]
20615
20616Set the keep-alive message semantic option.
20617[heading Synopsis]
20618```
20619void
20620keep_alive(
20621    bool value);
20622```
20623
20624[heading Description]
20625This function adjusts the Connection field to indicate whether or not the connection should be kept open after the corresponding response. The result depends on the version set on the message, which must be set to the final value before making this call.
20626
20627[heading Parameters]
20628[table [[Name][Description]]
20629  [
20630    [`value`
20631    ]
20632    [
20633`true` if the connection should persist.
20634    ]
20635  ]
20636]
20637
20638[endsect]
20639
20640
20641[endsect]
20642
20643[section:need_eof http::message::need_eof]
20644[indexterm2 need_eof..http::message]
20645
20646
20647Returns `true` if the message semantics require an end of file.
20648[heading Synopsis]
20649```
20650bool
20651need_eof() const;
20652```
20653
20654[heading Description]
20655For HTTP requests, this function returns the logical NOT of a call to [link beast.ref.boost__beast__http__message.keep_alive `keep_alive`].
20656For HTTP responses, this function returns the logical NOT of a call to [link beast.ref.boost__beast__http__message.keep_alive `keep_alive`] if any of the following are true:
20657
20658* [link beast.ref.boost__beast__http__message.has_content_length `has_content_length`] would return `true`
20659
20660* [link beast.ref.boost__beast__http__message.chunked `chunked`] would return `true`
20661
20662* [link beast.ref.boost__beast__http__message.result `result`] returns [link beast.ref.boost__beast__http__status `status::no_content`]
20663
20664* [link beast.ref.boost__beast__http__message.result `result`] returns [link beast.ref.boost__beast__http__status `status::not_modified`]
20665
20666* [link beast.ref.boost__beast__http__message.result `result`] returns any informational status class (100 to 199)
20667
20668Otherwise, the function returns `true`.
20669
20670[heading See Also]
20671[@https://tools.ietf.org/html/rfc7230#section-3.3 https://tools.ietf.org/html/rfc7230#section-3.3]
20672
20673[endsect]
20674
20675[section:payload_size http::message::payload_size]
20676[indexterm2 payload_size..http::message]
20677
20678
20679Returns the payload size of the body in octets if possible.
20680[heading Synopsis]
20681```
20682boost::optional< std::uint64_t >
20683payload_size() const;
20684```
20685
20686[heading Description]
20687This function invokes the ['Body] algorithm to measure the number of octets in the serialized body container. If there is no body, this will return zero. Otherwise, if the body exists but is not known ahead of time, `boost::none` is returned (usually indicating that a chunked Transfer-Encoding will be used).
20688
20689[heading Remarks]
20690The value of the Content-Length field in the message is not inspected.
20691
20692[endsect]
20693
20694[section:prepare_payload http::message::prepare_payload]
20695[indexterm2 prepare_payload..http::message]
20696
20697
20698Prepare the message payload fields for the body.
20699[heading Synopsis]
20700```
20701void
20702prepare_payload();
20703```
20704
20705[heading Description]
20706This function will adjust the Content-Length and Transfer-Encoding field values based on the properties of the body.
20707
20708[heading Example]
20709
20710```
20711request<string_body> req{verb::post, "/"};
20712req.set(field::user_agent, "Beast");
20713req.body() = "Hello, world!";
20714req.prepare_payload();
20715```
20716
20717
20718[endsect]
20719
20720[section:body http::message::body]
20721[indexterm2 body..http::message]
20722
20723
20724Returns the body.
20725```
20726body_type::value_type&
20727``[link beast.ref.boost__beast__http__message.body.overload1 body]``();
20728  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.body.overload1 `more...`]]``
20729
20730body_type::value_type&&
20731``[link beast.ref.boost__beast__http__message.body.overload2 body]``();
20732  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.body.overload2 `more...`]]``
20733
20734body_type::value_type const&
20735``[link beast.ref.boost__beast__http__message.body.overload3 body]``() const;
20736  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.body.overload3 `more...`]]``
20737```
20738
20739[section:overload1 http::message::body (1 of 3 overloads)]
20740
20741Returns the body.
20742[heading Synopsis]
20743```
20744body_type::value_type&
20745body();
20746```
20747
20748[heading Description]
20749
20750[endsect]
20751
20752[section:overload2 http::message::body (2 of 3 overloads)]
20753
20754Returns the body.
20755[heading Synopsis]
20756```
20757body_type::value_type&&
20758body();
20759```
20760
20761[heading Description]
20762
20763[endsect]
20764
20765[section:overload3 http::message::body (3 of 3 overloads)]
20766
20767Returns the body.
20768[heading Synopsis]
20769```
20770body_type::value_type const&
20771body() const;
20772```
20773
20774[heading Description]
20775
20776[endsect]
20777
20778
20779[endsect]
20780
20781[section:version http::message::version]
20782[indexterm2 version..http::message]
20783
20784
20785Return the HTTP-version.
20786```
20787unsigned
20788``[link beast.ref.boost__beast__http__message.version.overload1 version]``() const;
20789  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.version.overload1 `more...`]]``
20790```
20791
20792
20793Set the HTTP-version.
20794```
20795void
20796``[link beast.ref.boost__beast__http__message.version.overload2 version]``(
20797    unsigned value);
20798  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.version.overload2 `more...`]]``
20799```
20800
20801[section:overload1 http::message::version (1 of 2 overloads)]
20802(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
20803
20804Return the HTTP-version.
20805[heading Synopsis]
20806```
20807unsigned
20808version() const;
20809```
20810
20811[heading Description]
20812
20813This holds both the major and minor version numbers, using these formulas:
20814```
20815unsigned major = version / 10;
20816unsigned minor = version % 10;
20817```
20818
20819Newly constructed headers will use HTTP/1.1 by default.
20820
20821[endsect]
20822
20823[section:overload2 http::message::version (2 of 2 overloads)]
20824(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
20825
20826Set the HTTP-version.
20827[heading Synopsis]
20828```
20829void
20830version(
20831    unsigned value);
20832```
20833
20834[heading Description]
20835
20836This holds both the major and minor version numbers, using these formulas:
20837```
20838unsigned major = version / 10;
20839unsigned minor = version % 10;
20840```
20841
20842Newly constructed headers will use HTTP/1.1 by default.
20843
20844[heading Parameters]
20845[table [[Name][Description]]
20846  [
20847    [`value`
20848    ]
20849    [
20850The version number to use
20851    ]
20852  ]
20853]
20854
20855[endsect]
20856
20857
20858[endsect]
20859
20860[section:method http::message::method]
20861[indexterm2 method..http::message]
20862
20863
20864Return the request-method verb.
20865```
20866verb
20867``[link beast.ref.boost__beast__http__message.method.overload1 method]``() const;
20868  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.method.overload1 `more...`]]``
20869```
20870
20871
20872Set the request-method.
20873```
20874void
20875``[link beast.ref.boost__beast__http__message.method.overload2 method]``(
20876    verb v);
20877  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.method.overload2 `more...`]]``
20878```
20879
20880[section:overload1 http::message::method (1 of 2 overloads)]
20881(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
20882
20883Return the request-method verb.
20884[heading Synopsis]
20885```
20886verb
20887method() const;
20888```
20889
20890[heading Description]
20891If the request-method is not one of the recognized verbs, [link beast.ref.boost__beast__http__field `verb::unknown`] is returned. Callers may use [link beast.ref.boost__beast__http__message.method_string `method_string`] to retrieve the exact text.
20892
20893[heading Remarks]
20894This function is only available when `isRequest == true`.
20895[heading See Also]
20896[link beast.ref.boost__beast__http__message.method_string `method_string`]
20897
20898[endsect]
20899
20900[section:overload2 http::message::method (2 of 2 overloads)]
20901(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
20902
20903Set the request-method.
20904[heading Synopsis]
20905```
20906void
20907method(
20908    verb v);
20909```
20910
20911[heading Description]
20912This function will set the method for requests to a known verb.
20913
20914[heading Parameters]
20915[table [[Name][Description]]
20916  [
20917    [`v`
20918    ]
20919    [
20920The request method verb to set. This may not be [link beast.ref.boost__beast__http__field `verb::unknown`].
20921    ]
20922  ]
20923]
20924[heading Exceptions]
20925[table [[Type][Thrown On]]
20926  [
20927    [`std::invalid_argument`
20928    ]
20929    [
20930when v == [link beast.ref.boost__beast__http__field `verb::unknown`].
20931    ]
20932  ]
20933]
20934[heading Remarks]
20935This function is only available when `isRequest == true`.
20936
20937[endsect]
20938
20939
20940[endsect]
20941
20942[section:method_string http::message::method_string]
20943[indexterm2 method_string..http::message]
20944
20945
20946Return the request-method as a string.
20947```
20948string_view
20949``[link beast.ref.boost__beast__http__message.method_string.overload1 method_string]``() const;
20950  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.method_string.overload1 `more...`]]``
20951```
20952
20953
20954Set the request-method.
20955```
20956void
20957``[link beast.ref.boost__beast__http__message.method_string.overload2 method_string]``(
20958    string_view s);
20959  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.method_string.overload2 `more...`]]``
20960```
20961
20962[section:overload1 http::message::method_string (1 of 2 overloads)]
20963(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
20964
20965Return the request-method as a string.
20966[heading Synopsis]
20967```
20968string_view
20969method_string() const;
20970```
20971
20972[heading Description]
20973
20974[heading Remarks]
20975This function is only available when `isRequest == true`.
20976[heading See Also]
20977[link beast.ref.boost__beast__http__message.method `method`]
20978
20979[endsect]
20980
20981[section:overload2 http::message::method_string (2 of 2 overloads)]
20982(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
20983
20984Set the request-method.
20985[heading Synopsis]
20986```
20987void
20988method_string(
20989    string_view s);
20990```
20991
20992[heading Description]
20993This function will set the request-method a known verb if the string matches, otherwise it will store a copy of the passed string.
20994
20995[heading Parameters]
20996[table [[Name][Description]]
20997  [
20998    [`s`
20999    ]
21000    [
21001A string representing the request-method.
21002    ]
21003  ]
21004]
21005[heading Remarks]
21006This function is only available when `isRequest == true`.
21007
21008[endsect]
21009
21010
21011[endsect]
21012
21013[section:target http::message::target]
21014[indexterm2 target..http::message]
21015
21016
21017Returns the request-target string.
21018```
21019string_view
21020``[link beast.ref.boost__beast__http__message.target.overload1 target]``() const;
21021  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.target.overload1 `more...`]]``
21022```
21023
21024
21025Set the request-target string.
21026```
21027void
21028``[link beast.ref.boost__beast__http__message.target.overload2 target]``(
21029    string_view s);
21030  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.target.overload2 `more...`]]``
21031```
21032
21033[section:overload1 http::message::target (1 of 2 overloads)]
21034(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
21035
21036Returns the request-target string.
21037[heading Synopsis]
21038```
21039string_view
21040target() const;
21041```
21042
21043[heading Description]
21044The request target string returned is the same string which was received from the network or stored. In particular, it will contain url-encoded characters and should follow the syntax rules for URIs used with HTTP.
21045
21046[heading Remarks]
21047This function is only available when `isRequest == true`.
21048
21049[endsect]
21050
21051[section:overload2 http::message::target (2 of 2 overloads)]
21052(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
21053
21054Set the request-target string.
21055[heading Synopsis]
21056```
21057void
21058target(
21059    string_view s);
21060```
21061
21062[heading Description]
21063It is the caller's responsibility to ensure that the request target string follows the syntax rules for URIs used with HTTP. In particular, reserved or special characters must be url-encoded. The implementation does not perform syntax checking on the passed string.
21064
21065[heading Parameters]
21066[table [[Name][Description]]
21067  [
21068    [`s`
21069    ]
21070    [
21071A string representing the request-target.
21072    ]
21073  ]
21074]
21075[heading Remarks]
21076This function is only available when `isRequest == true`.
21077
21078[endsect]
21079
21080
21081[endsect]
21082
21083[section:result http::message::result]
21084[indexterm2 result..http::message]
21085
21086
21087The response status-code result.
21088```
21089status
21090``[link beast.ref.boost__beast__http__message.result.overload1 result]``() const;
21091  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.result.overload1 `more...`]]``
21092```
21093
21094
21095Set the response status-code.
21096```
21097void
21098``[link beast.ref.boost__beast__http__message.result.overload2 result]``(
21099    status v);
21100  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.result.overload2 `more...`]]``
21101```
21102
21103
21104Set the response status-code as an integer.
21105```
21106void
21107``[link beast.ref.boost__beast__http__message.result.overload3 result]``(
21108    unsigned v);
21109  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.result.overload3 `more...`]]``
21110```
21111
21112[section:overload1 http::message::result (1 of 3 overloads)]
21113(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
21114
21115The response status-code result.
21116[heading Synopsis]
21117```
21118status
21119result() const;
21120```
21121
21122[heading Description]
21123If the actual status code is not a known code, this function returns [link beast.ref.boost__beast__http__field `status::unknown`]. Use [link beast.ref.boost__beast__http__message.result_int `result_int`] to return the raw status code as a number.
21124
21125[heading Remarks]
21126This member is only available when `isRequest == false`.
21127
21128[endsect]
21129
21130[section:overload2 http::message::result (2 of 3 overloads)]
21131(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
21132
21133Set the response status-code.
21134[heading Synopsis]
21135```
21136void
21137result(
21138    status v);
21139```
21140
21141[heading Description]
21142
21143[heading Parameters]
21144[table [[Name][Description]]
21145  [
21146    [`v`
21147    ]
21148    [
21149The code to set.
21150    ]
21151  ]
21152]
21153[heading Remarks]
21154This member is only available when `isRequest == false`.
21155
21156[endsect]
21157
21158[section:overload3 http::message::result (3 of 3 overloads)]
21159(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
21160
21161Set the response status-code as an integer.
21162[heading Synopsis]
21163```
21164void
21165result(
21166    unsigned v);
21167```
21168
21169[heading Description]
21170This sets the status code to the exact number passed in. If the number does not correspond to one of the known status codes, the function [link beast.ref.boost__beast__http__message.result `result`] will return [link beast.ref.boost__beast__http__field `status::unknown`]. Use [link beast.ref.boost__beast__http__message.result_int `result_int`] to obtain the original raw status-code.
21171
21172[heading Parameters]
21173[table [[Name][Description]]
21174  [
21175    [`v`
21176    ]
21177    [
21178The status-code integer to set.
21179    ]
21180  ]
21181]
21182[heading Exceptions]
21183[table [[Type][Thrown On]]
21184  [
21185    [`std::invalid_argument`
21186    ]
21187    [
21188if `v > 999`.
21189    ]
21190  ]
21191]
21192
21193[endsect]
21194
21195
21196[endsect]
21197
21198[section:result_int http::message::result_int]
21199[indexterm2 result_int..http::message]
21200
21201(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
21202
21203The response status-code expressed as an integer.
21204[heading Synopsis]
21205```
21206unsigned
21207result_int() const;
21208```
21209
21210[heading Description]
21211This returns the raw status code as an integer, even when that code is not in the list of known status codes.
21212
21213[heading Remarks]
21214This member is only available when `isRequest == false`.
21215
21216[endsect]
21217
21218[section:reason http::message::reason]
21219[indexterm2 reason..http::message]
21220
21221
21222Return the response reason-phrase.
21223```
21224string_view
21225``[link beast.ref.boost__beast__http__message.reason.overload1 reason]``() const;
21226  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.reason.overload1 `more...`]]``
21227```
21228
21229
21230Set the response reason-phrase (deprecated)
21231```
21232void
21233``[link beast.ref.boost__beast__http__message.reason.overload2 reason]``(
21234    string_view s);
21235  ``[''''&raquo;''' [link beast.ref.boost__beast__http__message.reason.overload2 `more...`]]``
21236```
21237
21238[section:overload1 http::message::reason (1 of 2 overloads)]
21239(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
21240
21241Return the response reason-phrase.
21242[heading Synopsis]
21243```
21244string_view
21245reason() const;
21246```
21247
21248[heading Description]
21249The reason-phrase is obsolete as of rfc7230.
21250
21251[heading Remarks]
21252This function is only available when `isRequest == false`.
21253
21254[endsect]
21255
21256[section:overload2 http::message::reason (2 of 2 overloads)]
21257(Inherited from [link beast.ref.boost__beast__http__header `http::header`])
21258
21259Set the response reason-phrase (deprecated)
21260[heading Synopsis]
21261```
21262void
21263reason(
21264    string_view s);
21265```
21266
21267[heading Description]
21268This function sets a custom reason-phrase to a copy of the string passed in. Normally it is not necessary to set the reason phrase on an outgoing response object; the implementation will automatically use the standard reason text for the corresponding status code.
21269To clear a previously set custom phrase, pass an empty string. This will restore the default standard reason text based on the status code used when serializing.
21270The reason-phrase is obsolete as of rfc7230.
21271
21272[heading Parameters]
21273[table [[Name][Description]]
21274  [
21275    [`s`
21276    ]
21277    [
21278The string to use for the reason-phrase.
21279    ]
21280  ]
21281]
21282[heading Remarks]
21283This function is only available when `isRequest == false`.
21284
21285[endsect]
21286
21287
21288[endsect]
21289
21290
21291[endsect]
21292
21293[section:boost__beast__http__param_list http::param_list]
21294
21295A list of parameters in an HTTP extension field value.
21296[heading Synopsis]
21297Defined in header [include_file boost/beast/http/rfc7230.hpp]
21298
21299```
21300class param_list
21301```
21302
21303[heading Types]
21304[table [[Name][Description]]
21305  [
21306    [[*[link beast.ref.boost__beast__http__param_list.const_iterator const_iterator]]
21307    ]
21308    [
21309
21310A constant iterator to the list.
21311    ]
21312  ]
21313  [
21314    [[*[link beast.ref.boost__beast__http__param_list.value_type value_type]]
21315    ]
21316    [
21317
21318The type of each element in the list.
21319    ]
21320  ]
21321]
21322[heading Member Functions]
21323[table [[Name][Description]]
21324  [
21325    [[*[link beast.ref.boost__beast__http__param_list.begin begin]]
21326    ]
21327    [
21328
21329Return a const iterator to the beginning of the list.
21330    ]
21331  ]
21332  [
21333    [[*[link beast.ref.boost__beast__http__param_list.cbegin cbegin]]
21334    ]
21335    [
21336
21337Return a const iterator to the beginning of the list.
21338    ]
21339  ]
21340  [
21341    [[*[link beast.ref.boost__beast__http__param_list.cend cend]]
21342    ]
21343    [
21344
21345Return a const iterator to the end of the list.
21346    ]
21347  ]
21348  [
21349    [[*[link beast.ref.boost__beast__http__param_list.end end]]
21350    ]
21351    [
21352
21353Return a const iterator to the end of the list.
21354    ]
21355  ]
21356  [
21357    [[*[link beast.ref.boost__beast__http__param_list.param_list param_list]]
21358    ]
21359    [
21360
21361Default constructor.
21362
21363Construct a list.
21364    ]
21365  ]
21366]
21367[heading Description]
21368This container allows iteration of the parameter list in an HTTP extension. The parameter list is a series of name/value pairs with each pair starting with a semicolon. The value is optional.
21369If a parsing error is encountered while iterating the string, the behavior of the container will be as if a string containing only characters up to but excluding the first invalid character was used to construct the list.
21370
21371[heading BNF]
21372
21373```
21374param-list  = *( OWS ";" OWS param )
21375param       = token OWS [ "=" OWS ( token / quoted-string ) ]
21376```
21377
21378To use this class, construct with the string to be parsed and then use [link beast.ref.boost__beast__http__param_list.begin `begin`] and [link beast.ref.boost__beast__http__param_list.end `end`], or range-for to iterate each item:
21379
21380[heading Example]
21381
21382```
21383for(auto const& param : param_list{";level=9;no_context_takeover;bits=15"})
21384{
21385    std::cout << ";" << param.first;
21386    if(! param.second.empty())
21387        std::cout << "=" << param.second;
21388    std::cout << "\n";
21389}
21390```
21391
21392
21393[section:value_type http::param_list::value_type]
21394[indexterm2 value_type..http::param_list]
21395
21396
21397The type of each element in the list.
21398[heading Synopsis]
21399```
21400using value_type = std::pair< string_view, string_view >;
21401```
21402
21403[heading Description]
21404The first string in the pair is the name of the parameter, and the second string in the pair is its value (which may be empty).
21405
21406[endsect]
21407
21408[section:const_iterator http::param_list::const_iterator]
21409[indexterm2 const_iterator..http::param_list]
21410
21411
21412A constant iterator to the list.
21413[heading Synopsis]
21414```
21415using const_iterator = ``['implementation-defined]``;
21416```
21417
21418[heading Description]
21419
21420[endsect]
21421
21422[section:param_list http::param_list::param_list]
21423[indexterm2 param_list..http::param_list]
21424
21425
21426Default constructor.
21427```
21428``[link beast.ref.boost__beast__http__param_list.param_list.overload1 param_list]``();
21429  ``[''''&raquo;''' [link beast.ref.boost__beast__http__param_list.param_list.overload1 `more...`]]``
21430```
21431
21432
21433Construct a list.
21434```
21435explicit
21436``[link beast.ref.boost__beast__http__param_list.param_list.overload2 param_list]``(
21437    string_view s);
21438  ``[''''&raquo;''' [link beast.ref.boost__beast__http__param_list.param_list.overload2 `more...`]]``
21439```
21440
21441[section:overload1 http::param_list::param_list (1 of 2 overloads)]
21442
21443Default constructor.
21444[heading Synopsis]
21445```
21446param_list();
21447```
21448
21449[heading Description]
21450
21451[endsect]
21452
21453[section:overload2 http::param_list::param_list (2 of 2 overloads)]
21454
21455Construct a list.
21456[heading Synopsis]
21457```
21458param_list(
21459    string_view s);
21460```
21461
21462[heading Description]
21463
21464[heading Parameters]
21465[table [[Name][Description]]
21466  [
21467    [`s`
21468    ]
21469    [
21470A string containing the list contents. The string must remain valid for the lifetime of the container.
21471    ]
21472  ]
21473]
21474
21475[endsect]
21476
21477
21478[endsect]
21479
21480[section:begin http::param_list::begin]
21481[indexterm2 begin..http::param_list]
21482
21483
21484Return a const iterator to the beginning of the list.
21485[heading Synopsis]
21486```
21487const_iterator
21488begin() const;
21489```
21490
21491[heading Description]
21492
21493[endsect]
21494
21495[section:end http::param_list::end]
21496[indexterm2 end..http::param_list]
21497
21498
21499Return a const iterator to the end of the list.
21500[heading Synopsis]
21501```
21502const_iterator
21503end() const;
21504```
21505
21506[heading Description]
21507
21508[endsect]
21509
21510[section:cbegin http::param_list::cbegin]
21511[indexterm2 cbegin..http::param_list]
21512
21513
21514Return a const iterator to the beginning of the list.
21515[heading Synopsis]
21516```
21517const_iterator
21518cbegin() const;
21519```
21520
21521[heading Description]
21522
21523[endsect]
21524
21525[section:cend http::param_list::cend]
21526[indexterm2 cend..http::param_list]
21527
21528
21529Return a const iterator to the end of the list.
21530[heading Synopsis]
21531```
21532const_iterator
21533cend() const;
21534```
21535
21536[heading Description]
21537
21538[endsect]
21539
21540
21541[endsect]
21542
21543[section:boost__beast__http__parser http::parser]
21544
21545An HTTP/1 parser for producing a message.
21546[heading Synopsis]
21547Defined in header [include_file boost/beast/http/parser.hpp]
21548
21549```
21550template<
21551    bool isRequest,
21552    class __Body__,
21553    class __Allocator__ = std::allocator<char>>
21554class parser :
21555    public http::basic_parser< isRequest >
21556```
21557
21558[heading Types]
21559[table [[Name][Description]]
21560  [
21561    [[*[link beast.ref.boost__beast__http__parser.is_request is_request]]
21562    ]
21563    [
21564
21565`true` if this parser parses requests, `false` for responses.
21566    ]
21567  ]
21568  [
21569    [[*[link beast.ref.boost__beast__http__parser.value_type value_type]]
21570    ]
21571    [
21572
21573The type of message returned by the parser.
21574    ]
21575  ]
21576]
21577[heading Member Functions]
21578[table [[Name][Description]]
21579  [
21580    [[*[link beast.ref.boost__beast__http__parser.body_limit body_limit]]
21581    ]
21582    [
21583
21584Set the limit on the payload body.
21585    ]
21586  ]
21587  [
21588    [[*[link beast.ref.boost__beast__http__parser.chunked chunked]]
21589    ]
21590    [
21591
21592Returns `true` if the last value for Transfer-Encoding is "chunked".
21593    ]
21594  ]
21595  [
21596    [[*[link beast.ref.boost__beast__http__parser.content_length content_length]]
21597    ]
21598    [
21599
21600Returns the optional value of Content-Length if known.
21601    ]
21602  ]
21603  [
21604    [[*[link beast.ref.boost__beast__http__parser.content_length_remaining content_length_remaining]]
21605    ]
21606    [
21607
21608Returns the remaining content length if known.
21609    ]
21610  ]
21611  [
21612    [[*[link beast.ref.boost__beast__http__parser.eager eager]]
21613    ]
21614    [
21615
21616Returns `true` if the eager parse option is set.
21617
21618Set the eager parse option.
21619    ]
21620  ]
21621  [
21622    [[*[link beast.ref.boost__beast__http__parser.get get]]
21623    ]
21624    [
21625
21626Returns the parsed message.
21627    ]
21628  ]
21629  [
21630    [[*[link beast.ref.boost__beast__http__parser.got_some got_some]]
21631    ]
21632    [
21633
21634Returns `true` if the parser has received at least one byte of input.
21635    ]
21636  ]
21637  [
21638    [[*[link beast.ref.boost__beast__http__parser.header_limit header_limit]]
21639    ]
21640    [
21641
21642Set a limit on the total size of the header.
21643    ]
21644  ]
21645  [
21646    [[*[link beast.ref.boost__beast__http__parser.is_done is_done]]
21647    ]
21648    [
21649
21650Returns `true` if the message is complete.
21651    ]
21652  ]
21653  [
21654    [[*[link beast.ref.boost__beast__http__parser.is_header_done is_header_done]]
21655    ]
21656    [
21657
21658Returns `true` if a the parser has produced the full header.
21659    ]
21660  ]
21661  [
21662    [[*[link beast.ref.boost__beast__http__parser.keep_alive keep_alive]]
21663    ]
21664    [
21665
21666Returns `true` if the message has keep-alive connection semantics.
21667    ]
21668  ]
21669  [
21670    [[*[link beast.ref.boost__beast__http__parser.need_eof need_eof]]
21671    ]
21672    [
21673
21674Returns `true` if the message semantics require an end of file.
21675    ]
21676  ]
21677  [
21678    [[*[link beast.ref.boost__beast__http__parser.on_chunk_body on_chunk_body]]
21679    ]
21680    [
21681
21682Set a callback to be invoked on chunk body data.
21683    ]
21684  ]
21685  [
21686    [[*[link beast.ref.boost__beast__http__parser.on_chunk_header on_chunk_header]]
21687    ]
21688    [
21689
21690Set a callback to be invoked on each chunk header.
21691    ]
21692  ]
21693  [
21694    [[*[link beast.ref.boost__beast__http__parser.operator_eq_ operator=]]
21695    ]
21696    [
21697
21698Assignment (disallowed)
21699    ]
21700  ]
21701  [
21702    [[*[link beast.ref.boost__beast__http__parser.parser parser]]
21703    ]
21704    [
21705
21706Constructor (disallowed)
21707
21708Constructor.
21709
21710Construct a parser from another parser, changing the Body type.
21711    ]
21712  ]
21713  [
21714    [[*[link beast.ref.boost__beast__http__parser.put put]]
21715    ]
21716    [
21717
21718Write a buffer sequence to the parser.
21719    ]
21720  ]
21721  [
21722    [[*[link beast.ref.boost__beast__http__parser.put_eof put_eof]]
21723    ]
21724    [
21725
21726Inform the parser that the end of stream was reached.
21727    ]
21728  ]
21729  [
21730    [[*[link beast.ref.boost__beast__http__parser.release release]]
21731    ]
21732    [
21733
21734Returns ownership of the parsed message.
21735    ]
21736  ]
21737  [
21738    [[*[link beast.ref.boost__beast__http__parser.skip skip]]
21739    ]
21740    [
21741
21742Returns `true` if the skip parse option is set.
21743
21744Set the skip parse option.
21745    ]
21746  ]
21747  [
21748    [[*[link beast.ref.boost__beast__http__parser.upgrade upgrade]]
21749    ]
21750    [
21751
21752Returns `true` if the message is an upgrade message.
21753    ]
21754  ]
21755  [
21756    [[*[link beast.ref.boost__beast__http__parser._parser ~parser]]
21757    ]
21758    [
21759
21760Destructor.
21761    ]
21762  ]
21763]
21764[heading Description]
21765This class uses the basic HTTP/1 wire format parser to convert a series of octets into a [link beast.ref.boost__beast__http__message `message`] using the [link beast.ref.boost__beast__http__basic_fields `basic_fields`] container to represent the fields.
21766
21767[heading Template Parameters]
21768[table [[Type][Description]]
21769  [
21770    [`isRequest`
21771    ]
21772    [
21773Indicates whether a request or response will be parsed.
21774    ]
21775  ]
21776  [
21777    [`Body`
21778    ]
21779    [
21780The type used to represent the body. This must meet the requirements of ['Body].
21781    ]
21782  ]
21783  [
21784    [`Allocator`
21785    ]
21786    [
21787The type of allocator used with the [link beast.ref.boost__beast__http__basic_fields `basic_fields`] container.
21788    ]
21789  ]
21790]
21791[heading Remarks]
21792A new instance of the parser is required for each message.
21793
21794[section:value_type http::parser::value_type]
21795[indexterm2 value_type..http::parser]
21796
21797
21798The type of message returned by the parser.
21799[heading Synopsis]
21800```
21801using value_type = message< isRequest, Body, basic_fields< Allocator > >;
21802```
21803
21804[heading Types]
21805[table [[Name][Description]]
21806  [
21807    [[*[link beast.ref.boost__beast__http__message.body_type body_type]]
21808    ]
21809    [
21810
21811The type providing the body traits.
21812    ]
21813  ]
21814  [
21815    [[*[link beast.ref.boost__beast__http__message.fields_type fields_type]]
21816    ]
21817    [
21818
21819The type representing the fields.
21820    ]
21821  ]
21822  [
21823    [[*[link beast.ref.boost__beast__http__message.header_type header_type]]
21824    ]
21825    [
21826
21827The base class used to hold the header portion of the message.
21828    ]
21829  ]
21830  [
21831    [[*[link beast.ref.boost__beast__http__message.is_request is_request]]
21832    ]
21833    [
21834
21835Indicates if the header is a request or response.
21836    ]
21837  ]
21838]
21839[heading Member Functions]
21840[table [[Name][Description]]
21841  [
21842    [[*[link beast.ref.boost__beast__http__message.base base]]
21843    ]
21844    [
21845
21846Returns the header portion of the message.
21847    ]
21848  ]
21849  [
21850    [[*[link beast.ref.boost__beast__http__message.body body]]
21851    ]
21852    [
21853
21854Returns the body.
21855    ]
21856  ]
21857  [
21858    [[*[link beast.ref.boost__beast__http__message.chunked chunked]]
21859    ]
21860    [
21861
21862Returns `true` if the chunked Transfer-Encoding is specified.
21863
21864Set or clear the chunked Transfer-Encoding.
21865    ]
21866  ]
21867  [
21868    [[*[link beast.ref.boost__beast__http__message.content_length content_length]]
21869    ]
21870    [
21871
21872Set or clear the Content-Length field.
21873    ]
21874  ]
21875  [
21876    [[*[link beast.ref.boost__beast__http__message.has_content_length has_content_length]]
21877    ]
21878    [
21879
21880Returns `true` if the Content-Length field is present.
21881    ]
21882  ]
21883  [
21884    [[*[link beast.ref.boost__beast__http__message.keep_alive keep_alive]]
21885    ]
21886    [
21887
21888Returns `true` if the message semantics indicate keep-alive.
21889
21890Set the keep-alive message semantic option.
21891    ]
21892  ]
21893  [
21894    [[*[link beast.ref.boost__beast__http__message.message message]]
21895    ]
21896    [
21897
21898Constructor.
21899
21900Construct a message.
21901    ]
21902  ]
21903  [
21904    [[*[link beast.ref.boost__beast__http__message.method method]]
21905    ]
21906    [
21907
21908Return the request-method verb.
21909
21910Set the request-method.
21911    ]
21912  ]
21913  [
21914    [[*[link beast.ref.boost__beast__http__message.method_string method_string]]
21915    ]
21916    [
21917
21918Return the request-method as a string.
21919
21920Set the request-method.
21921    ]
21922  ]
21923  [
21924    [[*[link beast.ref.boost__beast__http__message.need_eof need_eof]]
21925    ]
21926    [
21927
21928Returns `true` if the message semantics require an end of file.
21929    ]
21930  ]
21931  [
21932    [[*[link beast.ref.boost__beast__http__message.operator_eq_ operator=]]
21933    ]
21934    [
21935
21936Assignment.
21937    ]
21938  ]
21939  [
21940    [[*[link beast.ref.boost__beast__http__message.payload_size payload_size]]
21941    ]
21942    [
21943
21944Returns the payload size of the body in octets if possible.
21945    ]
21946  ]
21947  [
21948    [[*[link beast.ref.boost__beast__http__message.prepare_payload prepare_payload]]
21949    ]
21950    [
21951
21952Prepare the message payload fields for the body.
21953    ]
21954  ]
21955  [
21956    [[*[link beast.ref.boost__beast__http__message.reason reason]]
21957    ]
21958    [
21959
21960Return the response reason-phrase.
21961
21962Set the response reason-phrase (deprecated)
21963    ]
21964  ]
21965  [
21966    [[*[link beast.ref.boost__beast__http__message.result result]]
21967    ]
21968    [
21969
21970The response status-code result.
21971
21972Set the response status-code.
21973
21974Set the response status-code as an integer.
21975    ]
21976  ]
21977  [
21978    [[*[link beast.ref.boost__beast__http__message.result_int result_int]]
21979    ]
21980    [
21981
21982The response status-code expressed as an integer.
21983    ]
21984  ]
21985  [
21986    [[*[link beast.ref.boost__beast__http__message.target target]]
21987    ]
21988    [
21989
21990Returns the request-target string.
21991
21992Set the request-target string.
21993    ]
21994  ]
21995  [
21996    [[*[link beast.ref.boost__beast__http__message.version version]]
21997    ]
21998    [
21999
22000Return the HTTP-version.
22001
22002Set the HTTP-version.
22003    ]
22004  ]
22005]
22006This container is derived from the `Fields` template type. To understand all of the members of this class it is necessary to view the declaration for the `Fields` type. When using the default fields container, those declarations are in [link beast.ref.boost__beast__http__fields `fields`].
22007A message can be a request or response, depending on the `isRequest` template argument value. Requests and responses have different types; functions may be overloaded based on the type if desired.
22008The `Body` template argument type determines the model used to read or write the content body of the message.
22009Newly constructed messages objects have version set to HTTP/1.1. Newly constructed response objects also have result code set to [link beast.ref.boost__beast__http__status `status::ok`].
22010
22011[heading Template Parameters]
22012[table [[Type][Description]]
22013  [
22014    [`isRequest`
22015    ]
22016    [
22017`true` if this represents a request, or `false` if this represents a response. Some class data members are conditionally present depending on this value.
22018    ]
22019  ]
22020  [
22021    [`Body`
22022    ]
22023    [
22024A type meeting the requirements of Body.
22025    ]
22026  ]
22027  [
22028    [`Fields`
22029    ]
22030    [
22031The type of container used to hold the field value pairs.
22032    ]
22033  ]
22034]
22035[heading Types]
22036[table [[Name][Description]]
22037  [
22038    [[*[link beast.ref.boost__beast__http__basic_fields.allocator_type allocator_type]]
22039    ]
22040    [
22041
22042The type of allocator used.
22043    ]
22044  ]
22045  [
22046    [[*[link beast.ref.boost__beast__http__basic_fields.const_iterator const_iterator]]
22047    ]
22048    [
22049
22050A constant iterator to the field sequence.
22051    ]
22052  ]
22053  [
22054    [[*[link beast.ref.boost__beast__http__basic_fields.iterator iterator]]
22055    ]
22056    [
22057
22058A constant iterator to the field sequence.
22059    ]
22060  ]
22061  [
22062    [[*[link beast.ref.boost__beast__http__basic_fields.key_compare key_compare]]
22063    ]
22064    [
22065
22066A strictly less predicate for comparing keys, using a case-insensitive comparison.
22067    ]
22068  ]
22069  [
22070    [[*[link beast.ref.boost__beast__http__basic_fields__value_type value_type]]
22071    ]
22072    [
22073
22074The type of element used to represent a field.
22075    ]
22076  ]
22077  [
22078    [[*[link beast.ref.boost__beast__http__basic_fields.writer writer]]
22079    ]
22080    [
22081
22082The algorithm used to serialize the header.
22083    ]
22084  ]
22085]
22086[heading Member Functions]
22087[table [[Name][Description]]
22088  [
22089    [[*[link beast.ref.boost__beast__http__basic_fields.at at]]
22090    ]
22091    [
22092
22093Returns the value for a field, or throws an exception.
22094    ]
22095  ]
22096  [
22097    [[*[link beast.ref.boost__beast__http__basic_fields.basic_fields basic_fields]]
22098    ]
22099    [
22100
22101Constructor.
22102
22103Move constructor.
22104
22105Copy constructor.
22106    ]
22107  ]
22108  [
22109    [[*[link beast.ref.boost__beast__http__basic_fields.begin begin]]
22110    ]
22111    [
22112
22113Return a const iterator to the beginning of the field sequence.
22114    ]
22115  ]
22116  [
22117    [[*[link beast.ref.boost__beast__http__basic_fields.cbegin cbegin]]
22118    ]
22119    [
22120
22121Return a const iterator to the beginning of the field sequence.
22122    ]
22123  ]
22124  [
22125    [[*[link beast.ref.boost__beast__http__basic_fields.cend cend]]
22126    ]
22127    [
22128
22129Return a const iterator to the end of the field sequence.
22130    ]
22131  ]
22132  [
22133    [[*[link beast.ref.boost__beast__http__basic_fields.clear clear]]
22134    ]
22135    [
22136
22137Remove all fields from the container.
22138    ]
22139  ]
22140  [
22141    [[*[link beast.ref.boost__beast__http__basic_fields.count count]]
22142    ]
22143    [
22144
22145Return the number of fields with the specified name.
22146    ]
22147  ]
22148  [
22149    [[*[link beast.ref.boost__beast__http__basic_fields.end end]]
22150    ]
22151    [
22152
22153Return a const iterator to the end of the field sequence.
22154    ]
22155  ]
22156  [
22157    [[*[link beast.ref.boost__beast__http__basic_fields.equal_range equal_range]]
22158    ]
22159    [
22160
22161Returns a range of iterators to the fields with the specified name.
22162    ]
22163  ]
22164  [
22165    [[*[link beast.ref.boost__beast__http__basic_fields.erase erase]]
22166    ]
22167    [
22168
22169Remove a field.
22170
22171Remove all fields with the specified name.
22172    ]
22173  ]
22174  [
22175    [[*[link beast.ref.boost__beast__http__basic_fields.find find]]
22176    ]
22177    [
22178
22179Returns an iterator to the case-insensitive matching field.
22180
22181Returns an iterator to the case-insensitive matching field name.
22182    ]
22183  ]
22184  [
22185    [[*[link beast.ref.boost__beast__http__basic_fields.get_allocator get_allocator]]
22186    ]
22187    [
22188
22189Return a copy of the allocator associated with the container.
22190    ]
22191  ]
22192  [
22193    [[*[link beast.ref.boost__beast__http__basic_fields.insert insert]]
22194    ]
22195    [
22196
22197Insert a field.
22198
22199    ]
22200  ]
22201  [
22202    [[*[link beast.ref.boost__beast__http__basic_fields.key_comp key_comp]]
22203    ]
22204    [
22205
22206Returns a copy of the key comparison function.
22207    ]
22208  ]
22209  [
22210    [[*[link beast.ref.boost__beast__http__basic_fields.operator_eq_ operator=]]
22211    ]
22212    [
22213
22214Move assignment.
22215
22216Copy assignment.
22217    ]
22218  ]
22219  [
22220    [[*[link beast.ref.boost__beast__http__basic_fields.operator_lb__rb_ operator\[\]]]
22221    ]
22222    [
22223
22224Returns the value for a field, or `""` if it does not exist.
22225
22226Returns the value for a case-insensitive matching header, or `""` if it does not exist.
22227    ]
22228  ]
22229  [
22230    [[*[link beast.ref.boost__beast__http__basic_fields.set set]]
22231    ]
22232    [
22233
22234Set a field value, removing any other instances of that field.
22235
22236    ]
22237  ]
22238  [
22239    [[*[link beast.ref.boost__beast__http__basic_fields.swap swap]]
22240    ]
22241    [
22242
22243Return a buffer sequence representing the trailers.
22244    ]
22245  ]
22246  [
22247    [[*[link beast.ref.boost__beast__http__basic_fields._basic_fields ~basic_fields]]
22248    ]
22249    [
22250
22251Destructor.
22252    ]
22253  ]
22254]
22255[heading Protected Member Functions]
22256[table [[Name][Description]]
22257  [
22258    [[*[link beast.ref.boost__beast__http__basic_fields.get_chunked_impl get_chunked_impl]]
22259    ]
22260    [
22261
22262Returns the chunked Transfer-Encoding setting.
22263    ]
22264  ]
22265  [
22266    [[*[link beast.ref.boost__beast__http__basic_fields.get_keep_alive_impl get_keep_alive_impl]]
22267    ]
22268    [
22269
22270Returns the keep-alive setting.
22271    ]
22272  ]
22273  [
22274    [[*[link beast.ref.boost__beast__http__basic_fields.get_method_impl get_method_impl]]
22275    ]
22276    [
22277
22278Returns the request-method string.
22279    ]
22280  ]
22281  [
22282    [[*[link beast.ref.boost__beast__http__basic_fields.get_reason_impl get_reason_impl]]
22283    ]
22284    [
22285
22286Returns the response reason-phrase string.
22287    ]
22288  ]
22289  [
22290    [[*[link beast.ref.boost__beast__http__basic_fields.get_target_impl get_target_impl]]
22291    ]
22292    [
22293
22294Returns the request-target string.
22295    ]
22296  ]
22297  [
22298    [[*[link beast.ref.boost__beast__http__basic_fields.has_content_length_impl has_content_length_impl]]
22299    ]
22300    [
22301
22302Returns `true` if the Content-Length field is present.
22303    ]
22304  ]
22305  [
22306    [[*[link beast.ref.boost__beast__http__basic_fields.set_chunked_impl set_chunked_impl]]
22307    ]
22308    [
22309
22310Adjusts the chunked Transfer-Encoding value.
22311    ]
22312  ]
22313  [
22314    [[*[link beast.ref.boost__beast__http__basic_fields.set_content_length_impl set_content_length_impl]]
22315    ]
22316    [
22317
22318Sets or clears the Content-Length field.
22319    ]
22320  ]
22321  [
22322    [[*[link beast.ref.boost__beast__http__basic_fields.set_keep_alive_impl set_keep_alive_impl]]
22323    ]
22324    [
22325
22326Adjusts the Connection field.
22327    ]
22328  ]
22329  [
22330    [[*[link beast.ref.boost__beast__http__basic_fields.set_method_impl set_method_impl]]
22331    ]
22332    [
22333
22334Set or clear the method string.
22335    ]
22336  ]
22337  [
22338    [[*[link beast.ref.boost__beast__http__basic_fields.set_reason_impl set_reason_impl]]
22339    ]
22340    [
22341
22342Set or clear the reason string.
22343    ]
22344  ]
22345  [
22346    [[*[link beast.ref.boost__beast__http__basic_fields.set_target_impl set_target_impl]]
22347    ]
22348    [
22349
22350Set or clear the target string.
22351    ]
22352  ]
22353]
22354[heading Friends]
22355[table [[Name][Description]]
22356  [
22357    [[*[link beast.ref.boost__beast__http__basic_fields.swap swap]]
22358    ]
22359    [
22360
22361Swap two field containers.
22362    ]
22363  ]
22364]
22365This container is designed to store the field value pairs that make up the fields and trailers in an HTTP message. Objects of this type are iterable, with each element holding the field name and field value.
22366Field names are stored as-is, but comparisons are case-insensitive. The container behaves as a `std::multiset`; there will be a separate value for each occurrence of the same field name. When the container is iterated the fields are presented in the order of insertion, with fields having the same name following each other consecutively.
22367Meets the requirements of ['Fields]
22368
22369[heading Template Parameters]
22370[table [[Type][Description]]
22371  [
22372    [`Allocator`
22373    ]
22374    [
22375The allocator to use.
22376    ]
22377  ]
22378]
22379[heading Description]
22380
22381[endsect]
22382
22383[section:is_request http::parser::is_request]
22384[indexterm2 is_request..http::parser]
22385
22386(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
22387
22388`true` if this parser parses requests, `false` for responses.
22389[heading Synopsis]
22390```
22391using is_request = std::integral_constant< bool, isRequest >;
22392```
22393
22394[heading Description]
22395
22396[endsect]
22397
22398[section:_parser http::parser::~parser]
22399[indexterm2 ~parser..http::parser]
22400
22401
22402Destructor.
22403[heading Synopsis]
22404```
22405~parser();
22406```
22407
22408[heading Description]
22409
22410[endsect]
22411
22412[section:parser http::parser::parser]
22413[indexterm2 parser..http::parser]
22414
22415
22416Constructor (disallowed)
22417```
22418``[link beast.ref.boost__beast__http__parser.parser.overload1 parser]``(
22419    parser const&);
22420  ``[''''&raquo;''' [link beast.ref.boost__beast__http__parser.parser.overload1 `more...`]]``
22421
22422``[link beast.ref.boost__beast__http__parser.parser.overload2 parser]``(
22423    parser&& other);
22424  ``[''''&raquo;''' [link beast.ref.boost__beast__http__parser.parser.overload2 `more...`]]``
22425```
22426
22427
22428Constructor.
22429```
22430``[link beast.ref.boost__beast__http__parser.parser.overload3 parser]``();
22431  ``[''''&raquo;''' [link beast.ref.boost__beast__http__parser.parser.overload3 `more...`]]``
22432
22433template<
22434    class... Args>
22435explicit
22436``[link beast.ref.boost__beast__http__parser.parser.overload4 parser]``(
22437    Args&&... args);
22438  ``[''''&raquo;''' [link beast.ref.boost__beast__http__parser.parser.overload4 `more...`]]``
22439```
22440
22441
22442Construct a parser from another parser, changing the Body type.
22443```
22444template<
22445    class OtherBody,
22446    class... Args>
22447explicit
22448``[link beast.ref.boost__beast__http__parser.parser.overload5 parser]``(
22449    parser< isRequest, OtherBody, Allocator >&& parser,
22450    Args&&... args);
22451  ``[''''&raquo;''' [link beast.ref.boost__beast__http__parser.parser.overload5 `more...`]]``
22452```
22453
22454[section:overload1 http::parser::parser (1 of 5 overloads)]
22455
22456Constructor (disallowed)
22457[heading Synopsis]
22458```
22459parser(
22460    parser const&);
22461```
22462
22463[heading Description]
22464
22465[endsect]
22466
22467[section:overload2 http::parser::parser (2 of 5 overloads)]
22468
22469Constructor (disallowed)
22470[heading Synopsis]
22471```
22472parser(
22473    parser&& other);
22474```
22475
22476[heading Description]
22477
22478[endsect]
22479
22480[section:overload3 http::parser::parser (3 of 5 overloads)]
22481
22482Constructor.
22483[heading Synopsis]
22484```
22485parser();
22486```
22487
22488[heading Description]
22489
22490[endsect]
22491
22492[section:overload4 http::parser::parser (4 of 5 overloads)]
22493
22494Constructor.
22495[heading Synopsis]
22496```
22497template<
22498    class... Args>
22499parser(
22500    Args&&... args);
22501```
22502
22503[heading Description]
22504
22505[heading Parameters]
22506[table [[Name][Description]]
22507  [
22508    [`args`
22509    ]
22510    [
22511Optional arguments forwarded to the [link beast.ref.boost__beast__http__message `
22512                           http::message
22513                        `] constructor.
22514    ]
22515  ]
22516]
22517[heading Remarks]
22518This function participates in overload resolution only if the first argument is not a [link beast.ref.boost__beast__http__parser `parser`].
22519
22520[endsect]
22521
22522[section:overload5 http::parser::parser (5 of 5 overloads)]
22523
22524Construct a parser from another parser, changing the Body type.
22525[heading Synopsis]
22526```
22527template<
22528    class OtherBody,
22529    class... Args>
22530parser(
22531    parser< isRequest, OtherBody, Allocator >&& parser,
22532    Args&&... args);
22533```
22534
22535[heading Description]
22536This constructs a new parser by move constructing the header from another parser with a different body type. The constructed-from parser must not have any parsed body octets or initialized ['BodyReader], otherwise an exception is generated.
22537
22538[heading Example]
22539
22540```
22541// Deferred body type commitment
22542request_parser<empty_body> req0;
22543...
22544request_parser<string_body> req{std::move(req0)};
22545```
22546
22547If an exception is thrown, the state of the constructed-from parser is undefined.
22548
22549[heading Parameters]
22550[table [[Name][Description]]
22551  [
22552    [`parser`
22553    ]
22554    [
22555The other parser to construct from. After this call returns, the constructed-from parser may only be destroyed.
22556    ]
22557  ]
22558  [
22559    [`args`
22560    ]
22561    [
22562Optional arguments forwarded to the message constructor.
22563    ]
22564  ]
22565]
22566[heading Exceptions]
22567[table [[Type][Thrown On]]
22568  [
22569    [`std::invalid_argument`
22570    ]
22571    [
22572Thrown when the constructed-from parser has already initialized a body reader.
22573    ]
22574  ]
22575]
22576[heading Remarks]
22577This function participates in overload resolution only if the other parser uses a different body type.
22578
22579[endsect]
22580
22581
22582[endsect]
22583
22584[section:operator_eq_ http::parser::operator=]
22585[indexterm2 operator=..http::parser]
22586
22587
22588Assignment (disallowed)
22589[heading Synopsis]
22590```
22591parser&
22592operator=(
22593    parser const&);
22594```
22595
22596[heading Description]
22597
22598[endsect]
22599
22600[section:get http::parser::get]
22601[indexterm2 get..http::parser]
22602
22603
22604Returns the parsed message.
22605```
22606value_type const&
22607``[link beast.ref.boost__beast__http__parser.get.overload1 get]``() const;
22608  ``[''''&raquo;''' [link beast.ref.boost__beast__http__parser.get.overload1 `more...`]]``
22609
22610value_type&
22611``[link beast.ref.boost__beast__http__parser.get.overload2 get]``();
22612  ``[''''&raquo;''' [link beast.ref.boost__beast__http__parser.get.overload2 `more...`]]``
22613```
22614
22615[section:overload1 http::parser::get (1 of 2 overloads)]
22616
22617Returns the parsed message.
22618[heading Synopsis]
22619```
22620value_type const&
22621get() const;
22622```
22623
22624[heading Description]
22625Depending on the parser's progress, parts of this object may be incomplete.
22626
22627[endsect]
22628
22629[section:overload2 http::parser::get (2 of 2 overloads)]
22630
22631Returns the parsed message.
22632[heading Synopsis]
22633```
22634value_type&
22635get();
22636```
22637
22638[heading Description]
22639Depending on the parser's progress, parts of this object may be incomplete.
22640
22641[endsect]
22642
22643
22644[endsect]
22645
22646[section:release http::parser::release]
22647[indexterm2 release..http::parser]
22648
22649
22650Returns ownership of the parsed message.
22651[heading Synopsis]
22652```
22653value_type
22654release();
22655```
22656
22657[heading Description]
22658Ownership is transferred to the caller. Depending on the parser's progress, parts of this object may be incomplete.
22659
22660[heading Requires]
22661
22662[link beast.ref.boost__beast__http__parser.value_type `value_type`]is [*MoveConstructible]
22663
22664[endsect]
22665
22666[section:on_chunk_header http::parser::on_chunk_header]
22667[indexterm2 on_chunk_header..http::parser]
22668
22669
22670Set a callback to be invoked on each chunk header.
22671[heading Synopsis]
22672```
22673template<
22674    class Callback>
22675void
22676on_chunk_header(
22677    Callback& cb);
22678```
22679
22680[heading Description]
22681The callback will be invoked once for every chunk in the message payload, as well as once for the last chunk. The invocation happens after the chunk header is available but before any body octets have been parsed.
22682The extensions are provided in raw, validated form, use [link beast.ref.boost__beast__http__basic_chunk_extensions.parse `chunk_extensions::parse`] to parse the extensions into a structured container for easier access. The implementation type-erases the callback without requiring a dynamic allocation. For this reason, the callback object is passed by a non-constant reference.
22683
22684[heading Example]
22685
22686```
22687auto callback =
22688    [](std::uint64_t size, string_view extensions, error_code& ec)
22689    {
22690        //...
22691    };
22692parser.on_chunk_header(callback);
22693```
22694
22695[heading Parameters]
22696[table [[Name][Description]]
22697  [
22698    [`cb`
22699    ]
22700    [
22701
22702The function to set, which must be invocable with this equivalent signature:
22703```
22704void
22705on_chunk_header(
22706    std::uint64_t size,         // Size of the chunk, zero for the last chunk
22707    string_view extensions,     // The chunk-extensions in raw form
22708    error_code& ec);            // May be set by the callback to indicate an error
22709```
22710
22711    ]
22712  ]
22713]
22714
22715[endsect]
22716
22717[section:on_chunk_body http::parser::on_chunk_body]
22718[indexterm2 on_chunk_body..http::parser]
22719
22720
22721Set a callback to be invoked on chunk body data.
22722[heading Synopsis]
22723```
22724template<
22725    class Callback>
22726void
22727on_chunk_body(
22728    Callback& cb);
22729```
22730
22731[heading Description]
22732The provided function object will be invoked one or more times to provide buffers corresponding to the chunk body for the current chunk. The callback receives the number of octets remaining in this chunk body including the octets in the buffer provided.
22733The callback must return the number of octets actually consumed. Any octets not consumed will be presented again in a subsequent invocation of the callback. The implementation type-erases the callback without requiring a dynamic allocation. For this reason, the callback object is passed by a non-constant reference.
22734
22735[heading Example]
22736
22737```
22738auto callback =
22739    [](std::uint64_t remain, string_view body, error_code& ec)
22740    {
22741        //...
22742    };
22743parser.on_chunk_body(callback);
22744```
22745
22746[heading Parameters]
22747[table [[Name][Description]]
22748  [
22749    [`cb`
22750    ]
22751    [
22752
22753The function to set, which must be invocable with this equivalent signature:
22754```
22755std::size_t
22756on_chunk_header(
22757    std::uint64_t remain,       // Octets remaining in this chunk, includes `body`
22758    string_view body,           // A buffer holding some or all of the remainder of the chunk body
22759    error_code& ec);            // May be set by the callback to indicate an error
22760```
22761
22762    ]
22763  ]
22764]
22765
22766[endsect]
22767
22768[section:got_some http::parser::got_some]
22769[indexterm2 got_some..http::parser]
22770
22771(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
22772
22773Returns `true` if the parser has received at least one byte of input.
22774[heading Synopsis]
22775```
22776bool
22777got_some() const;
22778```
22779
22780[heading Description]
22781
22782[endsect]
22783
22784[section:is_done http::parser::is_done]
22785[indexterm2 is_done..http::parser]
22786
22787(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
22788
22789Returns `true` if the message is complete.
22790[heading Synopsis]
22791```
22792bool
22793is_done() const;
22794```
22795
22796[heading Description]
22797The message is complete after the full header is prduced and one of the following is true:
22798
22799* The skip body option was set.
22800
22801* The semantics of the message indicate there is no body.
22802
22803* The semantics of the message indicate a body is expected, and the entire body was parsed.
22804
22805
22806[endsect]
22807
22808[section:is_header_done http::parser::is_header_done]
22809[indexterm2 is_header_done..http::parser]
22810
22811(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
22812
22813Returns `true` if a the parser has produced the full header.
22814[heading Synopsis]
22815```
22816bool
22817is_header_done() const;
22818```
22819
22820[heading Description]
22821
22822[endsect]
22823
22824[section:upgrade http::parser::upgrade]
22825[indexterm2 upgrade..http::parser]
22826
22827(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
22828
22829Returns `true` if the message is an upgrade message.
22830[heading Synopsis]
22831```
22832bool
22833upgrade() const;
22834```
22835
22836[heading Description]
22837
22838[heading Remarks]
22839The return value is undefined unless [link beast.ref.boost__beast__http__parser.is_header_done `is_header_done`] would return `true`.
22840
22841[endsect]
22842
22843[section:chunked http::parser::chunked]
22844[indexterm2 chunked..http::parser]
22845
22846(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
22847
22848Returns `true` if the last value for Transfer-Encoding is "chunked".
22849[heading Synopsis]
22850```
22851bool
22852chunked() const;
22853```
22854
22855[heading Description]
22856
22857[heading Remarks]
22858The return value is undefined unless [link beast.ref.boost__beast__http__parser.is_header_done `is_header_done`] would return `true`.
22859
22860[endsect]
22861
22862[section:keep_alive http::parser::keep_alive]
22863[indexterm2 keep_alive..http::parser]
22864
22865(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
22866
22867Returns `true` if the message has keep-alive connection semantics.
22868[heading Synopsis]
22869```
22870bool
22871keep_alive() const;
22872```
22873
22874[heading Description]
22875This function always returns `false` if [link beast.ref.boost__beast__http__parser.need_eof `need_eof`] would return `false`.
22876
22877[heading Remarks]
22878The return value is undefined unless [link beast.ref.boost__beast__http__parser.is_header_done `is_header_done`] would return `true`.
22879
22880[endsect]
22881
22882[section:content_length http::parser::content_length]
22883[indexterm2 content_length..http::parser]
22884
22885(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
22886
22887Returns the optional value of Content-Length if known.
22888[heading Synopsis]
22889```
22890boost::optional< std::uint64_t >
22891content_length() const;
22892```
22893
22894[heading Description]
22895
22896[heading Remarks]
22897The return value is undefined unless [link beast.ref.boost__beast__http__parser.is_header_done `is_header_done`] would return `true`.
22898
22899[endsect]
22900
22901[section:content_length_remaining http::parser::content_length_remaining]
22902[indexterm2 content_length_remaining..http::parser]
22903
22904(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
22905
22906Returns the remaining content length if known.
22907[heading Synopsis]
22908```
22909boost::optional< std::uint64_t >
22910content_length_remaining() const;
22911```
22912
22913[heading Description]
22914If the message header specifies a Content-Length, the return value will be the number of bytes remaining in the payload body have not yet been parsed.
22915
22916[heading Remarks]
22917The return value is undefined unless [link beast.ref.boost__beast__http__parser.is_header_done `is_header_done`] would return `true`.
22918
22919[endsect]
22920
22921[section:need_eof http::parser::need_eof]
22922[indexterm2 need_eof..http::parser]
22923
22924(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
22925
22926Returns `true` if the message semantics require an end of file.
22927[heading Synopsis]
22928```
22929bool
22930need_eof() const;
22931```
22932
22933[heading Description]
22934Depending on the contents of the header, the parser may require and end of file notification to know where the end of the body lies. If this function returns `true` it will be necessary to call [link beast.ref.boost__beast__http__parser.put_eof `put_eof`] when there will never be additional data from the input.
22935
22936[endsect]
22937
22938[section:body_limit http::parser::body_limit]
22939[indexterm2 body_limit..http::parser]
22940
22941(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
22942
22943Set the limit on the payload body.
22944[heading Synopsis]
22945```
22946void
22947body_limit(
22948    boost::optional< std::uint64_t > v);
22949```
22950
22951[heading Description]
22952This function sets the maximum allowed size of the payload body, before any encodings except chunked have been removed. Depending on the message semantics, one of these cases will apply:
22953
22954* The Content-Length is specified and exceeds the limit. In this case the result [link beast.ref.boost__beast__http__error `error::body_limit`] is returned immediately after the header is parsed.
22955
22956* The Content-Length is unspecified and the chunked encoding is not specified as the last encoding. In this case the end of message is determined by the end of file indicator on the associated stream or input source. If a sufficient number of body payload octets are presented to the parser to exceed the configured limit, the parse fails with the result [link beast.ref.boost__beast__http__error `error::body_limit`]
22957
22958* The Transfer-Encoding specifies the chunked encoding as the last encoding. In this case, when the number of payload body octets produced by removing the chunked encoding exceeds the configured limit, the parse fails with the result [link beast.ref.boost__beast__http__error `error::body_limit`].
22959
22960Setting the limit after any body octets have been parsed results in undefined behavior.
22961The default limit is 1MB for requests and 8MB for responses.
22962
22963[heading Parameters]
22964[table [[Name][Description]]
22965  [
22966    [`v`
22967    ]
22968    [
22969An optional integral value representing the body limit. If this is equal to `boost::none`, then the body limit is disabled.
22970    ]
22971  ]
22972]
22973
22974[endsect]
22975
22976[section:header_limit http::parser::header_limit]
22977[indexterm2 header_limit..http::parser]
22978
22979(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
22980
22981Set a limit on the total size of the header.
22982[heading Synopsis]
22983```
22984void
22985header_limit(
22986    std::uint32_t v);
22987```
22988
22989[heading Description]
22990This function sets the maximum allowed size of the header including all field name, value, and delimiter characters and also including the CRLF sequences in the serialized input. If the end of the header is not found within the limit of the header size, the error [link beast.ref.boost__beast__http__error `error::header_limit`] is returned by [link beast.ref.boost__beast__http__parser.put `put`].
22991Setting the limit after any header octets have been parsed results in undefined behavior.
22992
22993[endsect]
22994
22995[section:eager http::parser::eager]
22996[indexterm2 eager..http::parser]
22997
22998
22999Returns `true` if the eager parse option is set.
23000```
23001bool
23002``[link beast.ref.boost__beast__http__parser.eager.overload1 eager]``() const;
23003  ``[''''&raquo;''' [link beast.ref.boost__beast__http__parser.eager.overload1 `more...`]]``
23004```
23005
23006
23007Set the eager parse option.
23008```
23009void
23010``[link beast.ref.boost__beast__http__parser.eager.overload2 eager]``(
23011    bool v);
23012  ``[''''&raquo;''' [link beast.ref.boost__beast__http__parser.eager.overload2 `more...`]]``
23013```
23014
23015[section:overload1 http::parser::eager (1 of 2 overloads)]
23016(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
23017
23018Returns `true` if the eager parse option is set.
23019[heading Synopsis]
23020```
23021bool
23022eager() const;
23023```
23024
23025[heading Description]
23026
23027[endsect]
23028
23029[section:overload2 http::parser::eager (2 of 2 overloads)]
23030(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
23031
23032Set the eager parse option.
23033[heading Synopsis]
23034```
23035void
23036eager(
23037    bool v);
23038```
23039
23040[heading Description]
23041Normally the parser returns after successfully parsing a structured element (header, chunk header, or chunk body) even if there are octets remaining in the input. This is necessary when attempting to parse the header first, or when the caller wants to inspect information which may be invalidated by subsequent parsing, such as a chunk extension. The `eager` option controls whether the parser keeps going after parsing structured element if there are octets remaining in the buffer and no error occurs. This option is automatically set or cleared during certain stream operations to improve performance with no change in functionality.
23042The default setting is `false`.
23043
23044[heading Parameters]
23045[table [[Name][Description]]
23046  [
23047    [`v`
23048    ]
23049    [
23050`true` to set the eager parse option or `false` to disable it.
23051    ]
23052  ]
23053]
23054
23055[endsect]
23056
23057
23058[endsect]
23059
23060[section:skip http::parser::skip]
23061[indexterm2 skip..http::parser]
23062
23063
23064Returns `true` if the skip parse option is set.
23065```
23066bool
23067``[link beast.ref.boost__beast__http__parser.skip.overload1 skip]``() const;
23068  ``[''''&raquo;''' [link beast.ref.boost__beast__http__parser.skip.overload1 `more...`]]``
23069```
23070
23071
23072Set the skip parse option.
23073```
23074void
23075``[link beast.ref.boost__beast__http__parser.skip.overload2 skip]``(
23076    bool v);
23077  ``[''''&raquo;''' [link beast.ref.boost__beast__http__parser.skip.overload2 `more...`]]``
23078```
23079
23080[section:overload1 http::parser::skip (1 of 2 overloads)]
23081(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
23082
23083Returns `true` if the skip parse option is set.
23084[heading Synopsis]
23085```
23086bool
23087skip() const;
23088```
23089
23090[heading Description]
23091
23092[endsect]
23093
23094[section:overload2 http::parser::skip (2 of 2 overloads)]
23095(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
23096
23097Set the skip parse option.
23098[heading Synopsis]
23099```
23100void
23101skip(
23102    bool v);
23103```
23104
23105[heading Description]
23106This option controls whether or not the parser expects to see an HTTP body, regardless of the presence or absence of certain fields such as Content-Length or a chunked Transfer-Encoding. Depending on the request, some responses do not carry a body. For example, a 200 response to a CONNECT request from a tunneling proxy, or a response to a HEAD request. In these cases, callers may use this function inform the parser that no body is expected. The parser will consider the message complete after the header has been received.
23107
23108[heading Parameters]
23109[table [[Name][Description]]
23110  [
23111    [`v`
23112    ]
23113    [
23114`true` to set the skip body option or `false` to disable it.
23115    ]
23116  ]
23117]
23118[heading Remarks]
23119This function must called before any bytes are processed.
23120
23121[endsect]
23122
23123
23124[endsect]
23125
23126[section:put http::parser::put]
23127[indexterm2 put..http::parser]
23128
23129(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
23130
23131Write a buffer sequence to the parser.
23132[heading Synopsis]
23133```
23134template<
23135    class __ConstBufferSequence__>
23136std::size_t
23137put(
23138    ConstBufferSequence const& buffers,
23139    error_code& ec);
23140```
23141
23142[heading Description]
23143This function attempts to incrementally parse the HTTP message data stored in the caller provided buffers. Upon success, a positive return value indicates that the parser made forward progress, consuming that number of bytes.
23144In some cases there may be an insufficient number of octets in the input buffer in order to make forward progress. This is indicated by the code [link beast.ref.boost__beast__http__error `error::need_more`]. When this happens, the caller should place additional bytes into the buffer sequence and call [link beast.ref.boost__beast__http__parser.put `put`] again.
23145The error code [link beast.ref.boost__beast__http__error `error::need_more`] is special. When this error is returned, a subsequent call to [link beast.ref.boost__beast__http__parser.put `put`] may succeed if the buffers have been updated. Otherwise, upon error the parser may not be restarted.
23146
23147[heading Parameters]
23148[table [[Name][Description]]
23149  [
23150    [`buffers`
23151    ]
23152    [
23153An object meeting the requirements of ['ConstBufferSequence] that represents the next chunk of message data. If the length of this buffer sequence is one, the implementation will not allocate additional memory. The class [link beast.ref.boost__beast__basic_flat_buffer `beast::basic_flat_buffer`] is provided as one way to meet this requirement
23154    ]
23155  ]
23156  [
23157    [`ec`
23158    ]
23159    [
23160Set to the error, if any occurred.
23161    ]
23162  ]
23163]
23164[heading Return Value]
23165The number of octets consumed in the buffer sequence. The caller should remove these octets even if the error is set.
23166
23167[endsect]
23168
23169[section:put_eof http::parser::put_eof]
23170[indexterm2 put_eof..http::parser]
23171
23172(Inherited from [link beast.ref.boost__beast__http__basic_parser `http::basic_parser`])
23173
23174Inform the parser that the end of stream was reached.
23175[heading Synopsis]
23176```
23177void
23178put_eof(
23179    error_code& ec);
23180```
23181
23182[heading Description]
23183In certain cases, HTTP needs to know where the end of the stream is. For example, sometimes servers send responses without Content-Length and expect the client to consume input (for the body) until EOF. Callbacks and errors will still be processed as usual.
23184This is typically called when a read from the underlying stream object sets the error code to `net::error::eof`.
23185
23186[heading Remarks]
23187Only valid after parsing a complete header.
23188[heading Parameters]
23189[table [[Name][Description]]
23190  [
23191    [`ec`
23192    ]
23193    [
23194Set to the error, if any occurred.
23195    ]
23196  ]
23197]
23198
23199[endsect]
23200
23201
23202[endsect]
23203
23204[section:boost__beast__websocket__permessage_deflate websocket::permessage_deflate]
23205
23206permessage-deflate extension options.
23207[heading Synopsis]
23208Defined in header [include_file boost/beast/websocket/option.hpp]
23209
23210```
23211struct permessage_deflate
23212```
23213
23214[heading Data Members]
23215[table [[Name][Description]]
23216  [
23217    [[*[link beast.ref.boost__beast__websocket__permessage_deflate.client_enable client_enable]]
23218    ]
23219    [
23220
23221`true` to offer the extension in the client role
23222    ]
23223  ]
23224  [
23225    [[*[link beast.ref.boost__beast__websocket__permessage_deflate.client_max_window_bits client_max_window_bits]]
23226    ]
23227    [
23228
23229Maximum client window bits to offer.
23230    ]
23231  ]
23232  [
23233    [[*[link beast.ref.boost__beast__websocket__permessage_deflate.client_no_context_takeover client_no_context_takeover]]
23234    ]
23235    [
23236
23237`true` if client_no_context_takeover desired
23238    ]
23239  ]
23240  [
23241    [[*[link beast.ref.boost__beast__websocket__permessage_deflate.compLevel compLevel]]
23242    ]
23243    [
23244
23245Deflate compression level 0..9.
23246    ]
23247  ]
23248  [
23249    [[*[link beast.ref.boost__beast__websocket__permessage_deflate.memLevel memLevel]]
23250    ]
23251    [
23252
23253Deflate memory level, 1..9.
23254    ]
23255  ]
23256  [
23257    [[*[link beast.ref.boost__beast__websocket__permessage_deflate.server_enable server_enable]]
23258    ]
23259    [
23260
23261`true` to offer the extension in the server role
23262    ]
23263  ]
23264  [
23265    [[*[link beast.ref.boost__beast__websocket__permessage_deflate.server_max_window_bits server_max_window_bits]]
23266    ]
23267    [
23268
23269Maximum server window bits to offer.
23270    ]
23271  ]
23272  [
23273    [[*[link beast.ref.boost__beast__websocket__permessage_deflate.server_no_context_takeover server_no_context_takeover]]
23274    ]
23275    [
23276
23277`true` if server_no_context_takeover desired
23278    ]
23279  ]
23280]
23281[heading Description]
23282These settings control the permessage-deflate extension, which allows messages to be compressed.
23283
23284[heading Remarks]
23285Objects of this type are used with [link beast.ref.boost__beast__websocket__stream.set_option `beast::websocket::stream::set_option`].
23286
23287[section:server_enable websocket::permessage_deflate::server_enable]
23288[indexterm2 server_enable..websocket::permessage_deflate]
23289
23290
23291`true` to offer the extension in the server role
23292[heading Synopsis]
23293```
23294bool server_enable = false;
23295```
23296
23297[heading Description]
23298
23299[endsect]
23300
23301[section:client_enable websocket::permessage_deflate::client_enable]
23302[indexterm2 client_enable..websocket::permessage_deflate]
23303
23304
23305`true` to offer the extension in the client role
23306[heading Synopsis]
23307```
23308bool client_enable = false;
23309```
23310
23311[heading Description]
23312
23313[endsect]
23314
23315[section:server_max_window_bits websocket::permessage_deflate::server_max_window_bits]
23316[indexterm2 server_max_window_bits..websocket::permessage_deflate]
23317
23318
23319Maximum server window bits to offer.
23320[heading Synopsis]
23321```
23322int server_max_window_bits = 15;
23323```
23324
23325[heading Description]
23326
23327[heading Remarks]
23328Due to a bug in ZLib, this value must be greater than 8.
23329
23330[endsect]
23331
23332[section:client_max_window_bits websocket::permessage_deflate::client_max_window_bits]
23333[indexterm2 client_max_window_bits..websocket::permessage_deflate]
23334
23335
23336Maximum client window bits to offer.
23337[heading Synopsis]
23338```
23339int client_max_window_bits = 15;
23340```
23341
23342[heading Description]
23343
23344[heading Remarks]
23345Due to a bug in ZLib, this value must be greater than 8.
23346
23347[endsect]
23348
23349[section:server_no_context_takeover websocket::permessage_deflate::server_no_context_takeover]
23350[indexterm2 server_no_context_takeover..websocket::permessage_deflate]
23351
23352
23353`true` if server_no_context_takeover desired
23354[heading Synopsis]
23355```
23356bool server_no_context_takeover = false;
23357```
23358
23359[heading Description]
23360
23361[endsect]
23362
23363[section:client_no_context_takeover websocket::permessage_deflate::client_no_context_takeover]
23364[indexterm2 client_no_context_takeover..websocket::permessage_deflate]
23365
23366
23367`true` if client_no_context_takeover desired
23368[heading Synopsis]
23369```
23370bool client_no_context_takeover = false;
23371```
23372
23373[heading Description]
23374
23375[endsect]
23376
23377[section:compLevel websocket::permessage_deflate::compLevel]
23378[indexterm2 compLevel..websocket::permessage_deflate]
23379
23380
23381Deflate compression level 0..9.
23382[heading Synopsis]
23383```
23384int compLevel = 8;
23385```
23386
23387[heading Description]
23388
23389[endsect]
23390
23391[section:memLevel websocket::permessage_deflate::memLevel]
23392[indexterm2 memLevel..websocket::permessage_deflate]
23393
23394
23395Deflate memory level, 1..9.
23396[heading Synopsis]
23397```
23398int memLevel = 4;
23399```
23400
23401[heading Description]
23402
23403[endsect]
23404
23405
23406[endsect]
23407
23408[section:boost__beast__rate_policy_access rate_policy_access]
23409
23410Helper class to assist implementing a ['RatePolicy].
23411[heading Synopsis]
23412Defined in header [include_file boost/beast/core/rate_policy.hpp]
23413
23414```
23415class rate_policy_access
23416```
23417
23418[heading Description]
23419This class is used by the implementation to gain access to the private members of a user-defined object meeting the requirements of ['RatePolicy]. To use it, simply declare it as a friend in your class:
23420
23421[heading Example]
23422
23423```
23424class custom_rate_policy
23425{
23426    friend class beast::rate_policy_access;
23427    ...
23428```
23429
23430* ['RatePolicy]
23431
23432[heading See Also]
23433[link beast.ref.boost__beast__basic_stream `beast::basic_stream`]
23434
23435
23436[endsect]
23437
23438[section:boost__beast__http__basic_file_body__reader http::basic_file_body::reader]
23439
23440Algorithm for storing buffers when parsing.
23441[heading Synopsis]
23442Defined in header [include_file boost/beast/http/basic_file_body.hpp]
23443
23444```
23445class reader
23446```
23447
23448[heading Member Functions]
23449[table [[Name][Description]]
23450  [
23451    [[*[link beast.ref.boost__beast__http__basic_file_body__reader.finish finish]]
23452    ]
23453    [
23454
23455    ]
23456  ]
23457  [
23458    [[*[link beast.ref.boost__beast__http__basic_file_body__reader.init init]]
23459    ]
23460    [
23461
23462    ]
23463  ]
23464  [
23465    [[*[link beast.ref.boost__beast__http__basic_file_body__reader.put put]]
23466    ]
23467    [
23468
23469    ]
23470  ]
23471  [
23472    [[*[link beast.ref.boost__beast__http__basic_file_body__reader.reader reader]]
23473    ]
23474    [
23475
23476    ]
23477  ]
23478]
23479[heading Description]
23480Objects of this type are created during parsing to store incoming buffers representing the body.
23481
23482[section:reader http::basic_file_body::reader::reader]
23483[indexterm2 reader..http::basic_file_body::reader]
23484
23485
23486[heading Synopsis]
23487```
23488template<
23489    bool isRequest,
23490    class __Fields__>
23491reader(
23492    header< isRequest, Fields >& h,
23493    value_type& b);
23494```
23495
23496[heading Description]
23497
23498[endsect]
23499
23500[section:init http::basic_file_body::reader::init]
23501[indexterm2 init..http::basic_file_body::reader]
23502
23503
23504[heading Synopsis]
23505```
23506void
23507init(
23508    boost::optional< std::uint64_t > const&content_length,
23509    error_code& ec);
23510```
23511
23512[heading Description]
23513
23514[endsect]
23515
23516[section:put http::basic_file_body::reader::put]
23517[indexterm2 put..http::basic_file_body::reader]
23518
23519
23520[heading Synopsis]
23521```
23522template<
23523    class __ConstBufferSequence__>
23524std::size_t
23525put(
23526    ConstBufferSequence const& buffers,
23527    error_code& ec);
23528```
23529
23530[heading Description]
23531
23532[endsect]
23533
23534[section:finish http::basic_file_body::reader::finish]
23535[indexterm2 finish..http::basic_file_body::reader]
23536
23537
23538[heading Synopsis]
23539```
23540void
23541finish(
23542    error_code& ec);
23543```
23544
23545[heading Description]
23546
23547[endsect]
23548
23549
23550[endsect]
23551
23552[section:boost__beast__basic_stream__rebind_executor basic_stream::rebind_executor]
23553
23554Rebinds the stream type to another executor.
23555[heading Synopsis]
23556Defined in header [include_file boost/beast/core/basic_stream.hpp]
23557
23558```
23559template<
23560    class __Executor1__>
23561struct rebind_executor
23562```
23563
23564[heading Types]
23565[table [[Name][Description]]
23566  [
23567    [[*[link beast.ref.boost__beast__basic_stream__rebind_executor.other other]]
23568    ]
23569    [
23570
23571The stream type when rebound to the specified executor.
23572    ]
23573  ]
23574]
23575[heading Description]
23576
23577[section:other basic_stream::rebind_executor::other]
23578[indexterm2 other..basic_stream::rebind_executor]
23579
23580
23581The stream type when rebound to the specified executor.
23582[heading Synopsis]
23583```
23584using other = basic_stream< Protocol, Executor1, RatePolicy >;
23585```
23586
23587[heading Types]
23588[table [[Name][Description]]
23589  [
23590    [[*[link beast.ref.boost__beast__basic_stream.endpoint_type endpoint_type]]
23591    ]
23592    [
23593
23594The endpoint type.
23595    ]
23596  ]
23597  [
23598    [[*[link beast.ref.boost__beast__basic_stream.executor_type executor_type]]
23599    ]
23600    [
23601
23602The type of the executor associated with the stream.
23603    ]
23604  ]
23605  [
23606    [[*[link beast.ref.boost__beast__basic_stream.protocol_type protocol_type]]
23607    ]
23608    [
23609
23610The protocol type.
23611    ]
23612  ]
23613  [
23614    [[*[link beast.ref.boost__beast__basic_stream__rebind_executor rebind_executor]]
23615    ]
23616    [
23617
23618Rebinds the stream type to another executor.
23619    ]
23620  ]
23621  [
23622    [[*[link beast.ref.boost__beast__basic_stream.socket_type socket_type]]
23623    ]
23624    [
23625
23626The type of the underlying socket.
23627    ]
23628  ]
23629]
23630[heading Member Functions]
23631[table [[Name][Description]]
23632  [
23633    [[*[link beast.ref.boost__beast__basic_stream.async_connect async_connect]]
23634    ]
23635    [
23636
23637Connect the stream to the specified endpoint asynchronously.
23638
23639Establishes a connection by trying each endpoint in a sequence asynchronously.
23640    ]
23641  ]
23642  [
23643    [[*[link beast.ref.boost__beast__basic_stream.async_read_some async_read_some]]
23644    ]
23645    [
23646
23647Read some data asynchronously.
23648    ]
23649  ]
23650  [
23651    [[*[link beast.ref.boost__beast__basic_stream.async_write_some async_write_some]]
23652    ]
23653    [
23654
23655Write some data asynchronously.
23656    ]
23657  ]
23658  [
23659    [[*[link beast.ref.boost__beast__basic_stream.basic_stream basic_stream]]
23660    ]
23661    [
23662
23663Constructor.
23664
23665Move constructor.
23666    ]
23667  ]
23668  [
23669    [[*[link beast.ref.boost__beast__basic_stream.cancel cancel]]
23670    ]
23671    [
23672
23673Cancel all asynchronous operations associated with the socket.
23674    ]
23675  ]
23676  [
23677    [[*[link beast.ref.boost__beast__basic_stream.close close]]
23678    ]
23679    [
23680
23681Close the timed stream.
23682    ]
23683  ]
23684  [
23685    [[*[link beast.ref.boost__beast__basic_stream.connect connect]]
23686    ]
23687    [
23688
23689Connect the stream to the specified endpoint.
23690
23691Establishes a connection by trying each endpoint in a sequence.
23692    ]
23693  ]
23694  [
23695    [[*[link beast.ref.boost__beast__basic_stream.expires_after expires_after]]
23696    ]
23697    [
23698
23699Set the timeout for the next logical operation.
23700    ]
23701  ]
23702  [
23703    [[*[link beast.ref.boost__beast__basic_stream.expires_at expires_at]]
23704    ]
23705    [
23706
23707Set the timeout for the next logical operation.
23708    ]
23709  ]
23710  [
23711    [[*[link beast.ref.boost__beast__basic_stream.expires_never expires_never]]
23712    ]
23713    [
23714
23715Disable the timeout for the next logical operation.
23716    ]
23717  ]
23718  [
23719    [[*[link beast.ref.boost__beast__basic_stream.get_executor get_executor]]
23720    ]
23721    [
23722
23723Get the executor associated with the object.
23724    ]
23725  ]
23726  [
23727    [[*[link beast.ref.boost__beast__basic_stream.operator_eq_ operator=]]
23728    ]
23729    [
23730
23731Move assignment (deleted).
23732    ]
23733  ]
23734  [
23735    [[*[link beast.ref.boost__beast__basic_stream.rate_policy rate_policy]]
23736    ]
23737    [
23738
23739Returns the rate policy associated with the object.
23740    ]
23741  ]
23742  [
23743    [[*[link beast.ref.boost__beast__basic_stream.read_some read_some]]
23744    ]
23745    [
23746
23747Read some data.
23748    ]
23749  ]
23750  [
23751    [[*[link beast.ref.boost__beast__basic_stream.release_socket release_socket]]
23752    ]
23753    [
23754
23755Release ownership of the underlying socket.
23756    ]
23757  ]
23758  [
23759    [[*[link beast.ref.boost__beast__basic_stream.socket socket]]
23760    ]
23761    [
23762
23763Return a reference to the underlying socket.
23764    ]
23765  ]
23766  [
23767    [[*[link beast.ref.boost__beast__basic_stream.write_some write_some]]
23768    ]
23769    [
23770
23771Write some data.
23772    ]
23773  ]
23774  [
23775    [[*[link beast.ref.boost__beast__basic_stream._basic_stream ~basic_stream]]
23776    ]
23777    [
23778
23779Destructor.
23780    ]
23781  ]
23782]
23783This stream wraps a `net::basic_stream_socket` to provide the following features:
23784
23785* An ['Executor] may be associated with the stream, which will be used to invoke any completion handlers which do not already have an associated executor. This achieves support for [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1322r0.html [P1322R0] Networking TS enhancement to enable custom I/O executors].
23786
23787* Timeouts may be specified for each logical asynchronous operation performing any reading, writing, or connecting.
23788
23789* A ['RatePolicy] may be associated with the stream, to implement rate limiting through the policy's interface.
23790
23791Although the stream supports multiple concurrent outstanding asynchronous operations, the stream object is not thread-safe. The caller is responsible for ensuring that the stream is accessed from only one thread at a time. This includes the times when the stream, and its underlying socket, are accessed by the networking implementation. To meet this thread safety requirement, all asynchronous operations must be performed by the stream within the same implicit strand (only one thread `net::io_context::run`) or within the same explicit strand, such as an instance of `net::strand`.
23792Completion handlers with explicit associated executors (such as those arising from use of `net::bind_executor`) will be invoked by the stream using the associated executor. Otherwise, the completion handler will be invoked by the executor associated with the stream upon construction. The type of executor used with this stream must meet the following requirements:
23793
23794* Function objects submitted to the executor shall never run concurrently with each other.
23795
23796The executor type `net::strand` meets these requirements. Use of a strand as the executor in the stream class template offers an additional notational convenience: the strand does not need to be specified in each individual initiating function call.
23797Unlike other stream wrappers, the underlying socket is accessed through the [link beast.ref.boost__beast__basic_stream.socket `socket`] member function instead of `next_layer`. This causes the [link beast.ref.boost__beast__basic_stream `basic_stream`] to be returned in calls to [link beast.ref.boost__beast__get_lowest_layer `get_lowest_layer`].
23798
23799[heading Usage]
23800
23801To use this stream declare an instance of the class. Then, before each logical operation for which a timeout is desired, call [link beast.ref.boost__beast__basic_stream.expires_after `expires_after`] with a duration, or call [link beast.ref.boost__beast__basic_stream.expires_at `expires_at`] with a time point. Alternatively, call [link beast.ref.boost__beast__basic_stream.expires_never `expires_never`] to disable the timeout for subsequent logical operations. A logical operation is any series of one or more direct or indirect calls to the timeout stream's asynchronous read, asynchronous write, or asynchronous connect functions.
23802When a timeout is set and a mixed operation is performed (one that includes both reads and writes, for example) the timeout applies to all of the intermediate asynchronous operations used in the enclosing operation. This allows timeouts to be applied to stream algorithms which were not written specifically to allow for timeouts, when those algorithms are passed a timeout stream with a timeout set.
23803When a timeout occurs the socket will be closed, canceling any pending I/O operations. The completion handlers for these canceled operations will be invoked with the error [link beast.ref.boost__beast__error `beast::error::timeout`].
23804
23805[heading Examples]
23806
23807This function reads an HTTP request with a timeout, then sends the HTTP response with a different timeout.
23808
23809```
23810void process_http_1 (tcp_stream& stream, net::yield_context yield)
23811{
23812    flat_buffer buffer;
23813    http::request<http::empty_body> req;
23814
23815    // Read the request, with a 15 second timeout
23816    stream.expires_after(std::chrono::seconds(15));
23817    http::async_read(stream, buffer, req, yield);
23818
23819    // Calculate the response
23820    http::response<http::string_body> res = make_response(req);
23821
23822    // Send the response, with a 30 second timeout.
23823    stream.expires_after (std::chrono::seconds(30));
23824    http::async_write (stream, res, yield);
23825}
23826```
23827
23828The example above could be expressed using a single timeout with a simple modification. The function that follows first reads an HTTP request then sends the HTTP response, with a single timeout that applies to the entire combined operation of reading and writing:
23829
23830```
23831void process_http_2 (tcp_stream& stream, net::yield_context yield)
23832{
23833    flat_buffer buffer;
23834    http::request<http::empty_body> req;
23835
23836    // Require that the read and write combined take no longer than 30 seconds
23837    stream.expires_after(std::chrono::seconds(30));
23838
23839    http::async_read(stream, buffer, req, yield);
23840
23841    http::response<http::string_body> res = make_response(req);
23842    http::async_write (stream, res, yield);
23843}
23844```
23845
23846Some stream algorithms, such as `ssl::stream::async_handshake` perform both reads and writes. A timeout set before calling the initiating function of such composite stream algorithms will apply to the entire composite operation. For example, a timeout may be set on performing the SSL handshake thusly:
23847
23848```
23849void do_ssl_handshake (net::ssl::stream<tcp_stream>& stream, net::yield_context yield)
23850{
23851    // Require that the SSL handshake take no longer than 10 seconds
23852    stream.expires_after(std::chrono::seconds(10));
23853
23854    stream.async_handshake(net::ssl::stream_base::client, yield);
23855}
23856```
23857
23858
23859[heading Blocking I/O]
23860
23861Synchronous functions behave identically as that of the wrapped `net::basic_stream_socket`. Timeouts are not available when performing blocking calls.
23862
23863[heading Template Parameters]
23864[table [[Type][Description]]
23865  [
23866    [`Protocol`
23867    ]
23868    [
23869A type meeting the requirements of ['Protocol] representing the protocol the protocol to use for the basic stream socket. A common choice is `net::ip::tcp`.
23870    ]
23871  ]
23872  [
23873    [`Executor`
23874    ]
23875    [
23876A type meeting the requirements of ['Executor] to be used for submitting all completion handlers which do not already have an associated executor. If this type is omitted, the default of `net::any_io_executor` will be used.
23877    ]
23878  ]
23879]
23880[heading Thread Safety]
23881
23882['Distinct objects]: Safe.
23883
23884
23885['Shared objects]: Unsafe. The application must also ensure that all asynchronous operations are performed within the same implicit or explicit strand.
23886[heading See Also]
23887
23888* [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1322r0.html [P1322R0] Networking TS enhancement to enable custom I/O executors].
23889
23890[heading Description]
23891
23892[endsect]
23893
23894
23895[endsect]
23896
23897[section:boost__beast__saved_handler saved_handler]
23898
23899An invocable, nullary function object which holds a completion handler.
23900[heading Synopsis]
23901Defined in header [include_file boost/beast/core/saved_handler.hpp]
23902
23903```
23904class saved_handler
23905```
23906
23907[heading Member Functions]
23908[table [[Name][Description]]
23909  [
23910    [[*[link beast.ref.boost__beast__saved_handler.emplace emplace]]
23911    ]
23912    [
23913
23914Store a completion handler in the container.
23915    ]
23916  ]
23917  [
23918    [[*[link beast.ref.boost__beast__saved_handler.has_value has_value]]
23919    ]
23920    [
23921
23922Returns `true` if `*this` contains a completion handler.
23923    ]
23924  ]
23925  [
23926    [[*[link beast.ref.boost__beast__saved_handler.invoke invoke]]
23927    ]
23928    [
23929
23930Unconditionally invoke the stored completion handler.
23931    ]
23932  ]
23933  [
23934    [[*[link beast.ref.boost__beast__saved_handler.maybe_invoke maybe_invoke]]
23935    ]
23936    [
23937
23938Conditionally invoke the stored completion handler.
23939    ]
23940  ]
23941  [
23942    [[*[link beast.ref.boost__beast__saved_handler.operator_eq_ operator=]]
23943    ]
23944    [
23945
23946Copy Assignment (deleted)
23947
23948Move Assignment.
23949    ]
23950  ]
23951  [
23952    [[*[link beast.ref.boost__beast__saved_handler.reset reset]]
23953    ]
23954    [
23955
23956Discard the saved handler, if one exists.
23957    ]
23958  ]
23959  [
23960    [[*[link beast.ref.boost__beast__saved_handler.saved_handler saved_handler]]
23961    ]
23962    [
23963
23964Default Constructor.
23965
23966Copy Constructor (deleted)
23967
23968Move Constructor.
23969    ]
23970  ]
23971  [
23972    [[*[link beast.ref.boost__beast__saved_handler._saved_handler ~saved_handler]]
23973    ]
23974    [
23975
23976Destructor.
23977    ]
23978  ]
23979]
23980[heading Description]
23981This container can hold a type-erased instance of any completion handler, or it can be empty. When the container holds a value, the implementation maintains an instance of `net::executor_work_guard` for the handler's associated executor. Memory is dynamically allocated to store the completion handler, and the allocator may optionally be specified. Otherwise, the implementation uses the handler's associated allocator.
23982
23983[section:saved_handler saved_handler::saved_handler]
23984[indexterm2 saved_handler..saved_handler]
23985
23986
23987Default Constructor.
23988```
23989``[link beast.ref.boost__beast__saved_handler.saved_handler.overload1 saved_handler]``();
23990  ``[''''&raquo;''' [link beast.ref.boost__beast__saved_handler.saved_handler.overload1 `more...`]]``
23991```
23992
23993
23994Copy Constructor (deleted)
23995```
23996``[link beast.ref.boost__beast__saved_handler.saved_handler.overload2 saved_handler]``(
23997    saved_handler const&);
23998  ``[''''&raquo;''' [link beast.ref.boost__beast__saved_handler.saved_handler.overload2 `more...`]]``
23999```
24000
24001
24002Move Constructor.
24003```
24004``[link beast.ref.boost__beast__saved_handler.saved_handler.overload3 saved_handler]``(
24005    saved_handler&& other);
24006  ``[''''&raquo;''' [link beast.ref.boost__beast__saved_handler.saved_handler.overload3 `more...`]]``
24007```
24008
24009[section:overload1 saved_handler::saved_handler (1 of 3 overloads)]
24010
24011Default Constructor.
24012[heading Synopsis]
24013```
24014saved_handler();
24015```
24016
24017[heading Description]
24018
24019[endsect]
24020
24021[section:overload2 saved_handler::saved_handler (2 of 3 overloads)]
24022
24023Copy Constructor (deleted)
24024[heading Synopsis]
24025```
24026saved_handler(
24027    saved_handler const&);
24028```
24029
24030[heading Description]
24031
24032[endsect]
24033
24034[section:overload3 saved_handler::saved_handler (3 of 3 overloads)]
24035
24036Move Constructor.
24037[heading Synopsis]
24038```
24039saved_handler(
24040    saved_handler&& other);
24041```
24042
24043[heading Description]
24044
24045[endsect]
24046
24047
24048[endsect]
24049
24050[section:operator_eq_ saved_handler::operator=]
24051[indexterm2 operator=..saved_handler]
24052
24053
24054Copy Assignment (deleted)
24055```
24056saved_handler&
24057``[link beast.ref.boost__beast__saved_handler.operator_eq_.overload1 operator=]``(
24058    saved_handler const&);
24059  ``[''''&raquo;''' [link beast.ref.boost__beast__saved_handler.operator_eq_.overload1 `more...`]]``
24060```
24061
24062
24063Move Assignment.
24064```
24065saved_handler&
24066``[link beast.ref.boost__beast__saved_handler.operator_eq_.overload2 operator=]``(
24067    saved_handler&& other);
24068  ``[''''&raquo;''' [link beast.ref.boost__beast__saved_handler.operator_eq_.overload2 `more...`]]``
24069```
24070
24071[section:overload1 saved_handler::operator= (1 of 2 overloads)]
24072
24073Copy Assignment (deleted)
24074[heading Synopsis]
24075```
24076saved_handler&
24077operator=(
24078    saved_handler const&);
24079```
24080
24081[heading Description]
24082
24083[endsect]
24084
24085[section:overload2 saved_handler::operator= (2 of 2 overloads)]
24086
24087Move Assignment.
24088[heading Synopsis]
24089```
24090saved_handler&
24091operator=(
24092    saved_handler&& other);
24093```
24094
24095[heading Description]
24096
24097[endsect]
24098
24099
24100[endsect]
24101
24102[section:_saved_handler saved_handler::~saved_handler]
24103[indexterm2 ~saved_handler..saved_handler]
24104
24105
24106Destructor.
24107[heading Synopsis]
24108```
24109~saved_handler();
24110```
24111
24112[heading Description]
24113
24114[endsect]
24115
24116[section:has_value saved_handler::has_value]
24117[indexterm2 has_value..saved_handler]
24118
24119
24120Returns `true` if `*this` contains a completion handler.
24121[heading Synopsis]
24122```
24123bool
24124has_value() const;
24125```
24126
24127[heading Description]
24128
24129[endsect]
24130
24131[section:emplace saved_handler::emplace]
24132[indexterm2 emplace..saved_handler]
24133
24134
24135Store a completion handler in the container.
24136```
24137template<
24138    class __Handler__,
24139    class __Allocator__>
24140void
24141``[link beast.ref.boost__beast__saved_handler.emplace.overload1 emplace]``(
24142    Handler&& handler,
24143    Allocator const& alloc);
24144  ``[''''&raquo;''' [link beast.ref.boost__beast__saved_handler.emplace.overload1 `more...`]]``
24145
24146template<
24147    class __Handler__>
24148void
24149``[link beast.ref.boost__beast__saved_handler.emplace.overload2 emplace]``(
24150    Handler&& handler);
24151  ``[''''&raquo;''' [link beast.ref.boost__beast__saved_handler.emplace.overload2 `more...`]]``
24152```
24153
24154[section:overload1 saved_handler::emplace (1 of 2 overloads)]
24155
24156Store a completion handler in the container.
24157[heading Synopsis]
24158```
24159template<
24160    class __Handler__,
24161    class __Allocator__>
24162void
24163emplace(
24164    Handler&& handler,
24165    Allocator const& alloc);
24166```
24167
24168[heading Description]
24169Requires this->[link beast.ref.boost__beast__saved_handler.has_value `has_value()`] == false.
24170
24171[heading Parameters]
24172[table [[Name][Description]]
24173  [
24174    [`handler`
24175    ]
24176    [
24177The completion handler to store. The implementation takes ownership of the handler by performing a decay-copy.
24178    ]
24179  ]
24180  [
24181    [`alloc`
24182    ]
24183    [
24184The allocator to use.
24185    ]
24186  ]
24187]
24188
24189[endsect]
24190
24191[section:overload2 saved_handler::emplace (2 of 2 overloads)]
24192
24193Store a completion handler in the container.
24194[heading Synopsis]
24195```
24196template<
24197    class __Handler__>
24198void
24199emplace(
24200    Handler&& handler);
24201```
24202
24203[heading Description]
24204Requires this->[link beast.ref.boost__beast__saved_handler.has_value `has_value()`] == false. The implementation will use the handler's associated allocator to obtian storage.
24205
24206[heading Parameters]
24207[table [[Name][Description]]
24208  [
24209    [`handler`
24210    ]
24211    [
24212The completion handler to store. The implementation takes ownership of the handler by performing a decay-copy.
24213    ]
24214  ]
24215]
24216
24217[endsect]
24218
24219
24220[endsect]
24221
24222[section:reset saved_handler::reset]
24223[indexterm2 reset..saved_handler]
24224
24225
24226Discard the saved handler, if one exists.
24227[heading Synopsis]
24228```
24229bool
24230reset();
24231```
24232
24233[heading Description]
24234If `*this` contains an object, it is destroyed.
24235
24236[heading Return Value]
24237`true` if an object was destroyed.
24238
24239[endsect]
24240
24241[section:invoke saved_handler::invoke]
24242[indexterm2 invoke..saved_handler]
24243
24244
24245Unconditionally invoke the stored completion handler.
24246[heading Synopsis]
24247```
24248void
24249invoke();
24250```
24251
24252[heading Description]
24253Requires this->[link beast.ref.boost__beast__saved_handler.has_value `has_value()`] == true. Any dynamic memory used is deallocated before the stored completion handler is invoked. The executor work guard is also reset before the invocation.
24254
24255[endsect]
24256
24257[section:maybe_invoke saved_handler::maybe_invoke]
24258[indexterm2 maybe_invoke..saved_handler]
24259
24260
24261Conditionally invoke the stored completion handler.
24262[heading Synopsis]
24263```
24264bool
24265maybe_invoke();
24266```
24267
24268[heading Description]
24269Invokes the stored completion handler if this->[link beast.ref.boost__beast__saved_handler.has_value `has_value()`] == true, otherwise does nothing. Any dynamic memory used is deallocated before the stored completion handler is invoked. The executor work guard is also reset before the invocation.
24270
24271[heading Return Value]
24272`true` if the invocation took place.
24273
24274[endsect]
24275
24276
24277[endsect]
24278
24279[section:boost__beast__http__serializer http::serializer]
24280
24281Provides buffer oriented HTTP message serialization functionality.
24282[heading Synopsis]
24283Defined in header [include_file boost/beast/http/serializer.hpp]
24284
24285```
24286template<
24287    bool isRequest,
24288    class __Body__,
24289    class __Fields__ = ``[link beast.ref.boost__beast__http__fields fields]``>
24290class serializer
24291```
24292
24293[heading Types]
24294[table [[Name][Description]]
24295  [
24296    [[*[link beast.ref.boost__beast__http__serializer.value_type value_type]]
24297    ]
24298    [
24299
24300The type of message this serializer uses.
24301    ]
24302  ]
24303]
24304[heading Member Functions]
24305[table [[Name][Description]]
24306  [
24307    [[*[link beast.ref.boost__beast__http__serializer.consume consume]]
24308    ]
24309    [
24310
24311Consume buffer octets in the serialization.
24312    ]
24313  ]
24314  [
24315    [[*[link beast.ref.boost__beast__http__serializer.get get]]
24316    ]
24317    [
24318
24319Returns the message being serialized.
24320    ]
24321  ]
24322  [
24323    [[*[link beast.ref.boost__beast__http__serializer.is_done is_done]]
24324    ]
24325    [
24326
24327Return `true` if serialization is complete.
24328    ]
24329  ]
24330  [
24331    [[*[link beast.ref.boost__beast__http__serializer.is_header_done is_header_done]]
24332    ]
24333    [
24334
24335Return `true` if serialization of the header is complete.
24336    ]
24337  ]
24338  [
24339    [[*[link beast.ref.boost__beast__http__serializer.limit limit]]
24340    ]
24341    [
24342
24343Returns the serialized buffer size limit.
24344
24345Set the serialized buffer size limit.
24346    ]
24347  ]
24348  [
24349    [[*[link beast.ref.boost__beast__http__serializer.next next]]
24350    ]
24351    [
24352
24353Returns the next set of buffers in the serialization.
24354    ]
24355  ]
24356  [
24357    [[*[link beast.ref.boost__beast__http__serializer.operator_eq_ operator=]]
24358    ]
24359    [
24360
24361Assignment.
24362    ]
24363  ]
24364  [
24365    [[*[link beast.ref.boost__beast__http__serializer.serializer serializer]]
24366    ]
24367    [
24368
24369Constructor.
24370    ]
24371  ]
24372  [
24373    [[*[link beast.ref.boost__beast__http__serializer.split split]]
24374    ]
24375    [
24376
24377Returns `true` if we will pause after writing the complete header.
24378
24379Set whether the header and body are written separately.
24380    ]
24381  ]
24382  [
24383    [[*[link beast.ref.boost__beast__http__serializer.writer_impl writer_impl]]
24384    ]
24385    [
24386
24387Provides low-level access to the associated ['BodyWriter]
24388    ]
24389  ]
24390]
24391[heading Description]
24392An object of this type is used to serialize a complete HTTP message into a sequence of octets. To use this class, construct an instance with the message to be serialized. The implementation will automatically perform chunk encoding if the contents of the message indicate that chunk encoding is required.
24393Chunked output produced by the serializer never contains chunk extensions or trailers, and the location of chunk boundaries is not specified. If callers require chunk extensions, trailers, or control over the exact contents of each chunk they should use the serializer to write just the message header, and then assume control over serializing the chunked payload by using the chunk buffer sequence types [link beast.ref.boost__beast__http__chunk_body `chunk_body`], [link beast.ref.boost__beast__http__chunk_crlf `chunk_crlf`], [link beast.ref.boost__beast__http__chunk_header `chunk_header`], and [link beast.ref.boost__beast__http__chunk_last `chunk_last`].
24394
24395[heading Template Parameters]
24396[table [[Type][Description]]
24397  [
24398    [`isRequest`
24399    ]
24400    [
24401`true` if the message is a request.
24402    ]
24403  ]
24404  [
24405    [`Body`
24406    ]
24407    [
24408The body type of the message.
24409    ]
24410  ]
24411  [
24412    [`Fields`
24413    ]
24414    [
24415The type of fields in the message.
24416    ]
24417  ]
24418]
24419
24420[section:value_type http::serializer::value_type]
24421[indexterm2 value_type..http::serializer]
24422
24423
24424The type of message this serializer uses.
24425[heading Synopsis]
24426```
24427using value_type = ``['implementation-defined]``;
24428```
24429
24430[heading Description]
24431This may be const or non-const depending on the implementation of the corresponding ['BodyWriter].
24432
24433[endsect]
24434
24435[section:serializer http::serializer::serializer]
24436[indexterm2 serializer..http::serializer]
24437
24438
24439Constructor.
24440```
24441``[link beast.ref.boost__beast__http__serializer.serializer.overload1 serializer]``(
24442    serializer&&);
24443  ``[''''&raquo;''' [link beast.ref.boost__beast__http__serializer.serializer.overload1 `more...`]]``
24444
24445``[link beast.ref.boost__beast__http__serializer.serializer.overload2 serializer]``(
24446    serializer const&);
24447  ``[''''&raquo;''' [link beast.ref.boost__beast__http__serializer.serializer.overload2 `more...`]]``
24448
24449explicit
24450``[link beast.ref.boost__beast__http__serializer.serializer.overload3 serializer]``(
24451    value_type& msg);
24452  ``[''''&raquo;''' [link beast.ref.boost__beast__http__serializer.serializer.overload3 `more...`]]``
24453```
24454
24455[section:overload1 http::serializer::serializer (1 of 3 overloads)]
24456
24457Constructor.
24458[heading Synopsis]
24459```
24460serializer(
24461    serializer&&);
24462```
24463
24464[heading Description]
24465
24466[endsect]
24467
24468[section:overload2 http::serializer::serializer (2 of 3 overloads)]
24469
24470Constructor.
24471[heading Synopsis]
24472```
24473serializer(
24474    serializer const&);
24475```
24476
24477[heading Description]
24478
24479[endsect]
24480
24481[section:overload3 http::serializer::serializer (3 of 3 overloads)]
24482
24483Constructor.
24484[heading Synopsis]
24485```
24486serializer(
24487    value_type& msg);
24488```
24489
24490[heading Description]
24491The implementation guarantees that the message passed on construction will not be accessed until the first call to [link beast.ref.boost__beast__http__serializer.next `next`]. This allows the message to be lazily created. For example, if the header is filled in before serialization.
24492
24493[heading Parameters]
24494[table [[Name][Description]]
24495  [
24496    [`msg`
24497    ]
24498    [
24499A reference to the message to serialize, which must remain valid for the lifetime of the serializer. Depending on the type of Body used, this may or may not be a `const` reference.
24500    ]
24501  ]
24502]
24503[heading Remarks]
24504This function participates in overload resolution only if Body::writer is constructible from a `const` message reference.
24505
24506[endsect]
24507
24508
24509[endsect]
24510
24511[section:operator_eq_ http::serializer::operator=]
24512[indexterm2 operator=..http::serializer]
24513
24514
24515Assignment.
24516[heading Synopsis]
24517```
24518serializer&
24519operator=(
24520    serializer const&);
24521```
24522
24523[heading Description]
24524
24525[endsect]
24526
24527[section:get http::serializer::get]
24528[indexterm2 get..http::serializer]
24529
24530
24531Returns the message being serialized.
24532[heading Synopsis]
24533```
24534value_type&
24535get();
24536```
24537
24538[heading Description]
24539
24540[endsect]
24541
24542[section:limit http::serializer::limit]
24543[indexterm2 limit..http::serializer]
24544
24545
24546Returns the serialized buffer size limit.
24547```
24548std::size_t
24549``[link beast.ref.boost__beast__http__serializer.limit.overload1 limit]``();
24550  ``[''''&raquo;''' [link beast.ref.boost__beast__http__serializer.limit.overload1 `more...`]]``
24551```
24552
24553
24554Set the serialized buffer size limit.
24555```
24556void
24557``[link beast.ref.boost__beast__http__serializer.limit.overload2 limit]``(
24558    std::size_t limit);
24559  ``[''''&raquo;''' [link beast.ref.boost__beast__http__serializer.limit.overload2 `more...`]]``
24560```
24561
24562[section:overload1 http::serializer::limit (1 of 2 overloads)]
24563
24564Returns the serialized buffer size limit.
24565[heading Synopsis]
24566```
24567std::size_t
24568limit();
24569```
24570
24571[heading Description]
24572
24573[endsect]
24574
24575[section:overload2 http::serializer::limit (2 of 2 overloads)]
24576
24577Set the serialized buffer size limit.
24578[heading Synopsis]
24579```
24580void
24581limit(
24582    std::size_t limit);
24583```
24584
24585[heading Description]
24586This function adjusts the limit on the maximum size of the buffers passed to the visitor. The new size limit takes effect in the following call to [link beast.ref.boost__beast__http__serializer.next `next`].
24587The default is no buffer size limit.
24588
24589[heading Parameters]
24590[table [[Name][Description]]
24591  [
24592    [`limit`
24593    ]
24594    [
24595The new buffer size limit. If this number is zero, the size limit is removed.
24596    ]
24597  ]
24598]
24599
24600[endsect]
24601
24602
24603[endsect]
24604
24605[section:split http::serializer::split]
24606[indexterm2 split..http::serializer]
24607
24608
24609Returns `true` if we will pause after writing the complete header.
24610```
24611bool
24612``[link beast.ref.boost__beast__http__serializer.split.overload1 split]``();
24613  ``[''''&raquo;''' [link beast.ref.boost__beast__http__serializer.split.overload1 `more...`]]``
24614```
24615
24616
24617Set whether the header and body are written separately.
24618```
24619void
24620``[link beast.ref.boost__beast__http__serializer.split.overload2 split]``(
24621    bool v);
24622  ``[''''&raquo;''' [link beast.ref.boost__beast__http__serializer.split.overload2 `more...`]]``
24623```
24624
24625[section:overload1 http::serializer::split (1 of 2 overloads)]
24626
24627Returns `true` if we will pause after writing the complete header.
24628[heading Synopsis]
24629```
24630bool
24631split();
24632```
24633
24634[heading Description]
24635
24636[endsect]
24637
24638[section:overload2 http::serializer::split (2 of 2 overloads)]
24639
24640Set whether the header and body are written separately.
24641[heading Synopsis]
24642```
24643void
24644split(
24645    bool v);
24646```
24647
24648[heading Description]
24649When the split feature is enabled, the implementation will write only the octets corresponding to the serialized header first. If the header has already been written, this function will have no effect on output.
24650
24651[endsect]
24652
24653
24654[endsect]
24655
24656[section:is_header_done http::serializer::is_header_done]
24657[indexterm2 is_header_done..http::serializer]
24658
24659
24660Return `true` if serialization of the header is complete.
24661[heading Synopsis]
24662```
24663bool
24664is_header_done();
24665```
24666
24667[heading Description]
24668This function indicates whether or not all buffers containing serialized header octets have been retrieved.
24669
24670[endsect]
24671
24672[section:is_done http::serializer::is_done]
24673[indexterm2 is_done..http::serializer]
24674
24675
24676Return `true` if serialization is complete.
24677[heading Synopsis]
24678```
24679bool
24680is_done();
24681```
24682
24683[heading Description]
24684The operation is complete when all octets corresponding to the serialized representation of the message have been successfully retrieved.
24685
24686[endsect]
24687
24688[section:next http::serializer::next]
24689[indexterm2 next..http::serializer]
24690
24691
24692Returns the next set of buffers in the serialization.
24693[heading Synopsis]
24694```
24695template<
24696    class Visit>
24697void
24698next(
24699    error_code& ec,
24700    Visit&& visit);
24701```
24702
24703[heading Description]
24704This function will attempt to call the `visit` function object with a ['ConstBufferSequence] of unspecified type representing the next set of buffers in the serialization of the message represented by this object.
24705If there are no more buffers in the serialization, the visit function will not be called. In this case, no error will be indicated, and the function [link beast.ref.boost__beast__http__serializer.is_done `is_done`] will return `true`.
24706
24707[heading Parameters]
24708[table [[Name][Description]]
24709  [
24710    [`ec`
24711    ]
24712    [
24713Set to the error, if any occurred.
24714    ]
24715  ]
24716  [
24717    [`visit`
24718    ]
24719    [
24720
24721The function to call. The equivalent function signature of this object must be:
24722```
24723template<class ConstBufferSequence>
24724void visit(error_code&, ConstBufferSequence const&);
24725```
24726
24727The function is not copied, if no error occurs it will be invoked before the call to [link beast.ref.boost__beast__http__serializer.next `next`] returns.
24728    ]
24729  ]
24730]
24731
24732[endsect]
24733
24734[section:consume http::serializer::consume]
24735[indexterm2 consume..http::serializer]
24736
24737
24738Consume buffer octets in the serialization.
24739[heading Synopsis]
24740```
24741void
24742consume(
24743    std::size_t n);
24744```
24745
24746[heading Description]
24747This function should be called after one or more octets contained in the buffers provided in the prior call to [link beast.ref.boost__beast__http__serializer.next `next`] have been used.
24748After a call to [link beast.ref.boost__beast__http__serializer.consume `consume`], callers should check the return value of [link beast.ref.boost__beast__http__serializer.is_done `is_done`] to determine if the entire message has been serialized.
24749
24750[heading Parameters]
24751[table [[Name][Description]]
24752  [
24753    [`n`
24754    ]
24755    [
24756The number of octets to consume. This number must be greater than zero and no greater than the number of octets in the buffers provided in the prior call to [link beast.ref.boost__beast__http__serializer.next `next`].
24757    ]
24758  ]
24759]
24760
24761[endsect]
24762
24763[section:writer_impl http::serializer::writer_impl]
24764[indexterm2 writer_impl..http::serializer]
24765
24766
24767Provides low-level access to the associated ['BodyWriter]
24768[heading Synopsis]
24769```
24770writer&
24771writer_impl();
24772```
24773
24774[heading Description]
24775This function provides access to the instance of the writer associated with the body and created by the serializer upon construction. The behavior of accessing this object is defined by the specification of the particular writer and its associated body.
24776
24777[heading Return Value]
24778A reference to the writer.
24779
24780[endsect]
24781
24782
24783[endsect]
24784
24785[section:boost__beast__simple_rate_policy simple_rate_policy]
24786
24787A rate policy with simple, configurable limits on reads and writes.
24788[heading Synopsis]
24789Defined in header [include_file boost/beast/core/rate_policy.hpp]
24790
24791```
24792class simple_rate_policy
24793```
24794
24795[heading Member Functions]
24796[table [[Name][Description]]
24797  [
24798    [[*[link beast.ref.boost__beast__simple_rate_policy.read_limit read_limit]]
24799    ]
24800    [
24801
24802Set the limit of bytes per second to read.
24803    ]
24804  ]
24805  [
24806    [[*[link beast.ref.boost__beast__simple_rate_policy.write_limit write_limit]]
24807    ]
24808    [
24809
24810Set the limit of bytes per second to write.
24811    ]
24812  ]
24813]
24814[heading Description]
24815This rate policy allows for simple individual limits on the amount of bytes per second allowed for reads and writes.
24816
24817* ['RatePolicy]
24818
24819[heading See Also]
24820[link beast.ref.boost__beast__basic_stream `beast::basic_stream`]
24821
24822[section:read_limit simple_rate_policy::read_limit]
24823[indexterm2 read_limit..simple_rate_policy]
24824
24825
24826Set the limit of bytes per second to read.
24827[heading Synopsis]
24828```
24829void
24830read_limit(
24831    std::size_t bytes_per_second);
24832```
24833
24834[heading Description]
24835
24836[endsect]
24837
24838[section:write_limit simple_rate_policy::write_limit]
24839[indexterm2 write_limit..simple_rate_policy]
24840
24841
24842Set the limit of bytes per second to write.
24843[heading Synopsis]
24844```
24845void
24846write_limit(
24847    std::size_t bytes_per_second);
24848```
24849
24850[heading Description]
24851
24852[endsect]
24853
24854
24855[endsect]
24856
24857[section:boost__beast__span span]
24858
24859A range of bytes expressed as a ContiguousContainer.
24860[heading Synopsis]
24861Defined in header [include_file boost/beast/core/span.hpp]
24862
24863```
24864template<
24865    class T>
24866class span
24867```
24868
24869[heading Types]
24870[table [[Name][Description]]
24871  [
24872    [[*[link beast.ref.boost__beast__span.const_iterator const_iterator]]
24873    ]
24874    [
24875
24876The const iterator used by the container.
24877    ]
24878  ]
24879  [
24880    [[*[link beast.ref.boost__beast__span.const_pointer const_pointer]]
24881    ]
24882    [
24883
24884The const pointer used by the container.
24885    ]
24886  ]
24887  [
24888    [[*[link beast.ref.boost__beast__span.const_reference const_reference]]
24889    ]
24890    [
24891
24892The const reference used by the container.
24893    ]
24894  ]
24895  [
24896    [[*[link beast.ref.boost__beast__span.element_type element_type]]
24897    ]
24898    [
24899
24900The type of value, including cv qualifiers.
24901    ]
24902  ]
24903  [
24904    [[*[link beast.ref.boost__beast__span.index_type index_type]]
24905    ]
24906    [
24907
24908The type of integer used to index the span.
24909    ]
24910  ]
24911  [
24912    [[*[link beast.ref.boost__beast__span.iterator iterator]]
24913    ]
24914    [
24915
24916The iterator used by the container.
24917    ]
24918  ]
24919  [
24920    [[*[link beast.ref.boost__beast__span.pointer pointer]]
24921    ]
24922    [
24923
24924A pointer to a span element.
24925    ]
24926  ]
24927  [
24928    [[*[link beast.ref.boost__beast__span.reference reference]]
24929    ]
24930    [
24931
24932A reference to a span element.
24933    ]
24934  ]
24935  [
24936    [[*[link beast.ref.boost__beast__span.value_type value_type]]
24937    ]
24938    [
24939
24940The type of value of each span element.
24941    ]
24942  ]
24943]
24944[heading Member Functions]
24945[table [[Name][Description]]
24946  [
24947    [[*[link beast.ref.boost__beast__span.begin begin]]
24948    ]
24949    [
24950
24951Returns an iterator to the beginning of the span.
24952    ]
24953  ]
24954  [
24955    [[*[link beast.ref.boost__beast__span.cbegin cbegin]]
24956    ]
24957    [
24958
24959Returns an iterator to the beginning of the span.
24960    ]
24961  ]
24962  [
24963    [[*[link beast.ref.boost__beast__span.cend cend]]
24964    ]
24965    [
24966
24967Returns an iterator to one past the end of the span.
24968    ]
24969  ]
24970  [
24971    [[*[link beast.ref.boost__beast__span.data data]]
24972    ]
24973    [
24974
24975Returns a pointer to the beginning of the span.
24976    ]
24977  ]
24978  [
24979    [[*[link beast.ref.boost__beast__span.empty empty]]
24980    ]
24981    [
24982
24983Returns `true` if the span is empty.
24984    ]
24985  ]
24986  [
24987    [[*[link beast.ref.boost__beast__span.end end]]
24988    ]
24989    [
24990
24991Returns an iterator to one past the end of the span.
24992    ]
24993  ]
24994  [
24995    [[*[link beast.ref.boost__beast__span.operator_eq_ operator=]]
24996    ]
24997    [
24998
24999Assignment.
25000    ]
25001  ]
25002  [
25003    [[*[link beast.ref.boost__beast__span.size size]]
25004    ]
25005    [
25006
25007Returns the number of elements in the span.
25008    ]
25009  ]
25010  [
25011    [[*[link beast.ref.boost__beast__span.span span]]
25012    ]
25013    [
25014
25015Constructor.
25016    ]
25017  ]
25018]
25019[heading Description]
25020This class implements a non-owning reference to a storage area of a certain size and having an underlying integral type with size of 1.
25021
25022[heading Template Parameters]
25023[table [[Type][Description]]
25024  [
25025    [`T`
25026    ]
25027    [
25028The type pointed to by span iterators
25029    ]
25030  ]
25031]
25032
25033[section:element_type span::element_type]
25034[indexterm2 element_type..span]
25035
25036
25037The type of value, including cv qualifiers.
25038[heading Synopsis]
25039```
25040using element_type = T;
25041```
25042
25043[heading Description]
25044
25045[endsect]
25046
25047[section:value_type span::value_type]
25048[indexterm2 value_type..span]
25049
25050
25051The type of value of each span element.
25052[heading Synopsis]
25053```
25054using value_type = typename std::remove_const< T >::type;
25055```
25056
25057[heading Description]
25058
25059[endsect]
25060
25061[section:index_type span::index_type]
25062[indexterm2 index_type..span]
25063
25064
25065The type of integer used to index the span.
25066[heading Synopsis]
25067```
25068using index_type = std::ptrdiff_t;
25069```
25070
25071[heading Description]
25072
25073[endsect]
25074
25075[section:pointer span::pointer]
25076[indexterm2 pointer..span]
25077
25078
25079A pointer to a span element.
25080[heading Synopsis]
25081```
25082using pointer = T*;
25083```
25084
25085[heading Description]
25086
25087[endsect]
25088
25089[section:reference span::reference]
25090[indexterm2 reference..span]
25091
25092
25093A reference to a span element.
25094[heading Synopsis]
25095```
25096using reference = T&;
25097```
25098
25099[heading Description]
25100
25101[endsect]
25102
25103[section:iterator span::iterator]
25104[indexterm2 iterator..span]
25105
25106
25107The iterator used by the container.
25108[heading Synopsis]
25109```
25110using iterator = pointer;
25111```
25112
25113[heading Description]
25114
25115[endsect]
25116
25117[section:const_pointer span::const_pointer]
25118[indexterm2 const_pointer..span]
25119
25120
25121The const pointer used by the container.
25122[heading Synopsis]
25123```
25124using const_pointer = T const*;
25125```
25126
25127[heading Description]
25128
25129[endsect]
25130
25131[section:const_reference span::const_reference]
25132[indexterm2 const_reference..span]
25133
25134
25135The const reference used by the container.
25136[heading Synopsis]
25137```
25138using const_reference = T const&;
25139```
25140
25141[heading Description]
25142
25143[endsect]
25144
25145[section:const_iterator span::const_iterator]
25146[indexterm2 const_iterator..span]
25147
25148
25149The const iterator used by the container.
25150[heading Synopsis]
25151```
25152using const_iterator = const_pointer;
25153```
25154
25155[heading Description]
25156
25157[endsect]
25158
25159[section:span span::span]
25160[indexterm2 span..span]
25161
25162
25163Constructor.
25164```
25165``[link beast.ref.boost__beast__span.span.overload1 span]``();
25166  ``[''''&raquo;''' [link beast.ref.boost__beast__span.span.overload1 `more...`]]``
25167
25168``[link beast.ref.boost__beast__span.span.overload2 span]``(
25169    span const&);
25170  ``[''''&raquo;''' [link beast.ref.boost__beast__span.span.overload2 `more...`]]``
25171
25172``[link beast.ref.boost__beast__span.span.overload3 span]``(
25173    T* data,
25174    std::size_t size);
25175  ``[''''&raquo;''' [link beast.ref.boost__beast__span.span.overload3 `more...`]]``
25176
25177template<
25178    class ContiguousContainer>
25179explicit
25180``[link beast.ref.boost__beast__span.span.overload4 span]``(
25181    ContiguousContainer&& container);
25182  ``[''''&raquo;''' [link beast.ref.boost__beast__span.span.overload4 `more...`]]``
25183```
25184
25185[section:overload1 span::span (1 of 4 overloads)]
25186
25187Constructor.
25188[heading Synopsis]
25189```
25190span();
25191```
25192
25193[heading Description]
25194
25195[endsect]
25196
25197[section:overload2 span::span (2 of 4 overloads)]
25198
25199Constructor.
25200[heading Synopsis]
25201```
25202span(
25203    span const&);
25204```
25205
25206[heading Description]
25207
25208[endsect]
25209
25210[section:overload3 span::span (3 of 4 overloads)]
25211
25212Constructor.
25213[heading Synopsis]
25214```
25215span(
25216    T* data,
25217    std::size_t size);
25218```
25219
25220[heading Description]
25221
25222[heading Parameters]
25223[table [[Name][Description]]
25224  [
25225    [`data`
25226    ]
25227    [
25228A pointer to the beginning of the range of elements
25229    ]
25230  ]
25231  [
25232    [`size`
25233    ]
25234    [
25235The number of elements pointed to by `data`
25236    ]
25237  ]
25238]
25239
25240[endsect]
25241
25242[section:overload4 span::span (4 of 4 overloads)]
25243
25244Constructor.
25245[heading Synopsis]
25246```
25247template<
25248    class ContiguousContainer>
25249span(
25250    ContiguousContainer&& container);
25251```
25252
25253[heading Description]
25254
25255[heading Parameters]
25256[table [[Name][Description]]
25257  [
25258    [`container`
25259    ]
25260    [
25261The container to construct from
25262    ]
25263  ]
25264]
25265
25266[endsect]
25267
25268
25269[endsect]
25270
25271[section:operator_eq_ span::operator=]
25272[indexterm2 operator=..span]
25273
25274
25275Assignment.
25276```
25277span&
25278``[link beast.ref.boost__beast__span.operator_eq_.overload1 operator=]``(
25279    span const&);
25280  ``[''''&raquo;''' [link beast.ref.boost__beast__span.operator_eq_.overload1 `more...`]]``
25281
25282template<
25283    class ContiguousContainer>
25284span&
25285``[link beast.ref.boost__beast__span.operator_eq_.overload2 operator=]``(
25286    ContiguousContainer&& container);
25287  ``[''''&raquo;''' [link beast.ref.boost__beast__span.operator_eq_.overload2 `more...`]]``
25288```
25289
25290[section:overload1 span::operator= (1 of 2 overloads)]
25291
25292Assignment.
25293[heading Synopsis]
25294```
25295span&
25296operator=(
25297    span const&);
25298```
25299
25300[heading Description]
25301
25302[endsect]
25303
25304[section:overload2 span::operator= (2 of 2 overloads)]
25305
25306Assignment.
25307[heading Synopsis]
25308```
25309template<
25310    class ContiguousContainer>
25311span&
25312operator=(
25313    ContiguousContainer&& container);
25314```
25315
25316[heading Description]
25317
25318[heading Parameters]
25319[table [[Name][Description]]
25320  [
25321    [`container`
25322    ]
25323    [
25324The container to assign from
25325    ]
25326  ]
25327]
25328
25329[endsect]
25330
25331
25332[endsect]
25333
25334[section:empty span::empty]
25335[indexterm2 empty..span]
25336
25337
25338Returns `true` if the span is empty.
25339[heading Synopsis]
25340```
25341bool
25342empty() const;
25343```
25344
25345[heading Description]
25346
25347[endsect]
25348
25349[section:data span::data]
25350[indexterm2 data..span]
25351
25352
25353Returns a pointer to the beginning of the span.
25354[heading Synopsis]
25355```
25356T*
25357data() const;
25358```
25359
25360[heading Description]
25361
25362[endsect]
25363
25364[section:size span::size]
25365[indexterm2 size..span]
25366
25367
25368Returns the number of elements in the span.
25369[heading Synopsis]
25370```
25371std::size_t
25372size() const;
25373```
25374
25375[heading Description]
25376
25377[endsect]
25378
25379[section:begin span::begin]
25380[indexterm2 begin..span]
25381
25382
25383Returns an iterator to the beginning of the span.
25384[heading Synopsis]
25385```
25386const_iterator
25387begin() const;
25388```
25389
25390[heading Description]
25391
25392[endsect]
25393
25394[section:cbegin span::cbegin]
25395[indexterm2 cbegin..span]
25396
25397
25398Returns an iterator to the beginning of the span.
25399[heading Synopsis]
25400```
25401const_iterator
25402cbegin() const;
25403```
25404
25405[heading Description]
25406
25407[endsect]
25408
25409[section:end span::end]
25410[indexterm2 end..span]
25411
25412
25413Returns an iterator to one past the end of the span.
25414[heading Synopsis]
25415```
25416const_iterator
25417end() const;
25418```
25419
25420[heading Description]
25421
25422[endsect]
25423
25424[section:cend span::cend]
25425[indexterm2 cend..span]
25426
25427
25428Returns an iterator to one past the end of the span.
25429[heading Synopsis]
25430```
25431const_iterator
25432cend() const;
25433```
25434
25435[heading Description]
25436
25437[endsect]
25438
25439
25440[endsect]
25441
25442[section:boost__beast__http__span_body http::span_body]
25443
25444A ['Body] using [link beast.ref.boost__beast__span `span`].
25445[heading Synopsis]
25446Defined in header [include_file boost/beast/http/span_body.hpp]
25447
25448```
25449template<
25450    class T>
25451struct span_body
25452```
25453
25454[heading Types]
25455[table [[Name][Description]]
25456  [
25457    [[*[link beast.ref.boost__beast__http__span_body.reader reader]]
25458    ]
25459    [
25460
25461The algorithm for parsing the body.
25462    ]
25463  ]
25464  [
25465    [[*[link beast.ref.boost__beast__http__span_body.value_type value_type]]
25466    ]
25467    [
25468
25469The type of container used for the body.
25470    ]
25471  ]
25472  [
25473    [[*[link beast.ref.boost__beast__http__span_body.writer writer]]
25474    ]
25475    [
25476
25477The algorithm for serializing the body.
25478    ]
25479  ]
25480]
25481[heading Static Members]
25482[table [[Name][Description]]
25483  [
25484    [[*[link beast.ref.boost__beast__http__span_body.size size]]
25485    ]
25486    [
25487
25488Returns the payload size of the body.
25489    ]
25490  ]
25491]
25492[heading Description]
25493This body uses [link beast.ref.boost__beast__span `span`] as a memory-based container for holding message payloads. The container represents a non-owning reference to a contiguous area of memory. Messages using this body type may be serialized and parsed.
25494Unlike [link beast.ref.boost__beast__http__buffer_body `buffer_body`], only one buffer may be provided during a parse or serialize operation.
25495
25496[section:value_type http::span_body::value_type]
25497[indexterm2 value_type..http::span_body]
25498
25499
25500The type of container used for the body.
25501[heading Synopsis]
25502```
25503using value_type = span< T >;
25504```
25505
25506[heading Types]
25507[table [[Name][Description]]
25508  [
25509    [[*[link beast.ref.boost__beast__span.const_iterator const_iterator]]
25510    ]
25511    [
25512
25513The const iterator used by the container.
25514    ]
25515  ]
25516  [
25517    [[*[link beast.ref.boost__beast__span.const_pointer const_pointer]]
25518    ]
25519    [
25520
25521The const pointer used by the container.
25522    ]
25523  ]
25524  [
25525    [[*[link beast.ref.boost__beast__span.const_reference const_reference]]
25526    ]
25527    [
25528
25529The const reference used by the container.
25530    ]
25531  ]
25532  [
25533    [[*[link beast.ref.boost__beast__span.element_type element_type]]
25534    ]
25535    [
25536
25537The type of value, including cv qualifiers.
25538    ]
25539  ]
25540  [
25541    [[*[link beast.ref.boost__beast__span.index_type index_type]]
25542    ]
25543    [
25544
25545The type of integer used to index the span.
25546    ]
25547  ]
25548  [
25549    [[*[link beast.ref.boost__beast__span.iterator iterator]]
25550    ]
25551    [
25552
25553The iterator used by the container.
25554    ]
25555  ]
25556  [
25557    [[*[link beast.ref.boost__beast__span.pointer pointer]]
25558    ]
25559    [
25560
25561A pointer to a span element.
25562    ]
25563  ]
25564  [
25565    [[*[link beast.ref.boost__beast__span.reference reference]]
25566    ]
25567    [
25568
25569A reference to a span element.
25570    ]
25571  ]
25572  [
25573    [[*[link beast.ref.boost__beast__span.value_type value_type]]
25574    ]
25575    [
25576
25577The type of value of each span element.
25578    ]
25579  ]
25580]
25581[heading Member Functions]
25582[table [[Name][Description]]
25583  [
25584    [[*[link beast.ref.boost__beast__span.begin begin]]
25585    ]
25586    [
25587
25588Returns an iterator to the beginning of the span.
25589    ]
25590  ]
25591  [
25592    [[*[link beast.ref.boost__beast__span.cbegin cbegin]]
25593    ]
25594    [
25595
25596Returns an iterator to the beginning of the span.
25597    ]
25598  ]
25599  [
25600    [[*[link beast.ref.boost__beast__span.cend cend]]
25601    ]
25602    [
25603
25604Returns an iterator to one past the end of the span.
25605    ]
25606  ]
25607  [
25608    [[*[link beast.ref.boost__beast__span.data data]]
25609    ]
25610    [
25611
25612Returns a pointer to the beginning of the span.
25613    ]
25614  ]
25615  [
25616    [[*[link beast.ref.boost__beast__span.empty empty]]
25617    ]
25618    [
25619
25620Returns `true` if the span is empty.
25621    ]
25622  ]
25623  [
25624    [[*[link beast.ref.boost__beast__span.end end]]
25625    ]
25626    [
25627
25628Returns an iterator to one past the end of the span.
25629    ]
25630  ]
25631  [
25632    [[*[link beast.ref.boost__beast__span.operator_eq_ operator=]]
25633    ]
25634    [
25635
25636Assignment.
25637    ]
25638  ]
25639  [
25640    [[*[link beast.ref.boost__beast__span.size size]]
25641    ]
25642    [
25643
25644Returns the number of elements in the span.
25645    ]
25646  ]
25647  [
25648    [[*[link beast.ref.boost__beast__span.span span]]
25649    ]
25650    [
25651
25652Constructor.
25653    ]
25654  ]
25655]
25656This class implements a non-owning reference to a storage area of a certain size and having an underlying integral type with size of 1.
25657
25658[heading Template Parameters]
25659[table [[Type][Description]]
25660  [
25661    [`T`
25662    ]
25663    [
25664The type pointed to by span iterators
25665    ]
25666  ]
25667]
25668[heading Description]
25669This determines the type of [link beast.ref.boost__beast__http__message.body `message::body`] when this body type is used with a message container.
25670
25671[endsect]
25672
25673[section:reader http::span_body::reader]
25674[indexterm2 reader..http::span_body]
25675
25676
25677The algorithm for parsing the body.
25678[heading Synopsis]
25679```
25680using reader = ``['implementation-defined]``;
25681```
25682
25683[heading Description]
25684Meets the requirements of ['BodyReader].
25685
25686[endsect]
25687
25688[section:writer http::span_body::writer]
25689[indexterm2 writer..http::span_body]
25690
25691
25692The algorithm for serializing the body.
25693[heading Synopsis]
25694```
25695using writer = ``['implementation-defined]``;
25696```
25697
25698[heading Description]
25699Meets the requirements of ['BodyWriter].
25700
25701[endsect]
25702
25703[section:size http::span_body::size]
25704[indexterm2 size..http::span_body]
25705
25706
25707Returns the payload size of the body.
25708[heading Synopsis]
25709```
25710static
25711std::uint64_t
25712size(
25713    value_type const& body);
25714```
25715
25716[heading Description]
25717When this body is used with [link beast.ref.boost__beast__http__message.prepare_payload `message::prepare_payload`], the Content-Length will be set to the payload size, and any chunked Transfer-Encoding will be removed.
25718
25719[endsect]
25720
25721
25722[endsect]
25723
25724[section:boost__beast__ssl_stream ssl_stream]
25725
25726Provides stream-oriented functionality using OpenSSL.
25727[heading Synopsis]
25728Defined in header [include_file boost/beast/ssl/ssl_stream.hpp]
25729
25730```
25731template<
25732    class NextLayer>
25733class ssl_stream :
25734    public stream_base
25735```
25736
25737[heading Types]
25738[table [[Name][Description]]
25739  [
25740    [[*[link beast.ref.boost__beast__ssl_stream.executor_type executor_type]]
25741    ]
25742    [
25743
25744The type of the executor associated with the object.
25745    ]
25746  ]
25747  [
25748    [[*[link beast.ref.boost__beast__ssl_stream.impl_struct impl_struct]]
25749    ]
25750    [
25751
25752Structure for use with deprecated impl_type.
25753    ]
25754  ]
25755  [
25756    [[*[link beast.ref.boost__beast__ssl_stream.native_handle_type native_handle_type]]
25757    ]
25758    [
25759
25760The native handle type of the SSL stream.
25761    ]
25762  ]
25763  [
25764    [[*[link beast.ref.boost__beast__ssl_stream.next_layer_type next_layer_type]]
25765    ]
25766    [
25767
25768The type of the next layer.
25769    ]
25770  ]
25771]
25772[heading Member Functions]
25773[table [[Name][Description]]
25774  [
25775    [[*[link beast.ref.boost__beast__ssl_stream.async_handshake async_handshake]]
25776    ]
25777    [
25778
25779Start an asynchronous SSL handshake.
25780    ]
25781  ]
25782  [
25783    [[*[link beast.ref.boost__beast__ssl_stream.async_read_some async_read_some]]
25784    ]
25785    [
25786
25787Start an asynchronous read.
25788    ]
25789  ]
25790  [
25791    [[*[link beast.ref.boost__beast__ssl_stream.async_shutdown async_shutdown]]
25792    ]
25793    [
25794
25795Asynchronously shut down SSL on the stream.
25796    ]
25797  ]
25798  [
25799    [[*[link beast.ref.boost__beast__ssl_stream.async_write_some async_write_some]]
25800    ]
25801    [
25802
25803Start an asynchronous write.
25804    ]
25805  ]
25806  [
25807    [[*[link beast.ref.boost__beast__ssl_stream.get_executor get_executor]]
25808    ]
25809    [
25810
25811Get the executor associated with the object.
25812    ]
25813  ]
25814  [
25815    [[*[link beast.ref.boost__beast__ssl_stream.handshake handshake]]
25816    ]
25817    [
25818
25819Perform SSL handshaking.
25820    ]
25821  ]
25822  [
25823    [[*[link beast.ref.boost__beast__ssl_stream.native_handle native_handle]]
25824    ]
25825    [
25826
25827Get the underlying implementation in the native type.
25828    ]
25829  ]
25830  [
25831    [[*[link beast.ref.boost__beast__ssl_stream.next_layer next_layer]]
25832    ]
25833    [
25834
25835Get a reference to the next layer.
25836    ]
25837  ]
25838  [
25839    [[*[link beast.ref.boost__beast__ssl_stream.read_some read_some]]
25840    ]
25841    [
25842
25843Read some data from the stream.
25844    ]
25845  ]
25846  [
25847    [[*[link beast.ref.boost__beast__ssl_stream.set_verify_callback set_verify_callback]]
25848    ]
25849    [
25850
25851Set the callback used to verify peer certificates.
25852    ]
25853  ]
25854  [
25855    [[*[link beast.ref.boost__beast__ssl_stream.set_verify_depth set_verify_depth]]
25856    ]
25857    [
25858
25859Set the peer verification depth.
25860    ]
25861  ]
25862  [
25863    [[*[link beast.ref.boost__beast__ssl_stream.set_verify_mode set_verify_mode]]
25864    ]
25865    [
25866
25867Set the peer verification mode.
25868    ]
25869  ]
25870  [
25871    [[*[link beast.ref.boost__beast__ssl_stream.shutdown shutdown]]
25872    ]
25873    [
25874
25875Shut down SSL on the stream.
25876    ]
25877  ]
25878  [
25879    [[*[link beast.ref.boost__beast__ssl_stream.ssl_stream ssl_stream]]
25880    ]
25881    [
25882
25883Construct a stream.
25884    ]
25885  ]
25886  [
25887    [[*[link beast.ref.boost__beast__ssl_stream.write_some write_some]]
25888    ]
25889    [
25890
25891Write some data to the stream.
25892    ]
25893  ]
25894]
25895[heading Description]
25896The stream class template provides asynchronous and blocking stream-oriented functionality using SSL.
25897
25898[heading Thread Safety]
25899
25900['Distinct]['objects:]Safe.
25901
25902
25903['Shared]['objects:]Unsafe. The application must also ensure that all asynchronous operations are performed within the same implicit or explicit strand.
25904[heading Example]
25905
25906To use this template with a [link beast.ref.boost__beast__tcp_stream `tcp_stream`], you would write:
25907```
25908net::io_context ioc;
25909net::ssl::context ctx{net::ssl::context::tlsv12};
25910beast::ssl_stream<beast::tcp_stream> sock{ioc, ctx};
25911```
25912
25913In addition to providing an interface identical to `net::ssl::stream`, the wrapper has the following additional properties:
25914
25915* Satisfies [*MoveConstructible]
25916
25917* Satisfies [*MoveAssignable]
25918
25919* Constructible from a moved socket.
25920
25921* Uses [link beast.ref.boost__beast__flat_stream `flat_stream`] internally, as a performance work-around for a limitation of `net::ssl::stream` when writing buffer sequences having length greater than one.
25922
25923
25924[section:native_handle_type ssl_stream::native_handle_type]
25925[indexterm2 native_handle_type..ssl_stream]
25926
25927
25928The native handle type of the SSL stream.
25929[heading Synopsis]
25930```
25931using native_handle_type = typename ssl_stream_type::native_handle_type;
25932```
25933
25934[heading Description]
25935
25936[endsect]
25937
25938[section:impl_struct ssl_stream::impl_struct]
25939[indexterm2 impl_struct..ssl_stream]
25940
25941
25942Structure for use with deprecated impl_type.
25943[heading Synopsis]
25944```
25945using impl_struct = typename ssl_stream_type::impl_struct;
25946```
25947
25948[heading Description]
25949
25950[endsect]
25951
25952[section:next_layer_type ssl_stream::next_layer_type]
25953[indexterm2 next_layer_type..ssl_stream]
25954
25955
25956The type of the next layer.
25957[heading Synopsis]
25958```
25959using next_layer_type = typename ssl_stream_type::next_layer_type;
25960```
25961
25962[heading Description]
25963
25964[endsect]
25965
25966[section:executor_type ssl_stream::executor_type]
25967[indexterm2 executor_type..ssl_stream]
25968
25969
25970The type of the executor associated with the object.
25971[heading Synopsis]
25972```
25973using executor_type = typename stream_type::executor_type;
25974```
25975
25976[heading Description]
25977
25978[endsect]
25979
25980[section:ssl_stream ssl_stream::ssl_stream]
25981[indexterm2 ssl_stream..ssl_stream]
25982
25983
25984Construct a stream.
25985[heading Synopsis]
25986```
25987template<
25988    class Arg>
25989ssl_stream(
25990    Arg&& arg,
25991    net::ssl::context& ctx);
25992```
25993
25994[heading Description]
25995This constructor creates a stream and initialises the underlying stream object.
25996
25997[heading Parameters]
25998[table [[Name][Description]]
25999  [
26000    [`arg`
26001    ]
26002    [
26003The argument to be passed to initialise the underlying stream.
26004    ]
26005  ]
26006  [
26007    [`ctx`
26008    ]
26009    [
26010The SSL context to be used for the stream.
26011    ]
26012  ]
26013]
26014
26015[endsect]
26016
26017[section:get_executor ssl_stream::get_executor]
26018[indexterm2 get_executor..ssl_stream]
26019
26020
26021Get the executor associated with the object.
26022[heading Synopsis]
26023```
26024executor_type
26025get_executor();
26026```
26027
26028[heading Description]
26029This function may be used to obtain the executor object that the stream uses to dispatch handlers for asynchronous operations.
26030
26031[heading Return Value]
26032A copy of the executor that stream will use to dispatch handlers.
26033
26034[endsect]
26035
26036[section:native_handle ssl_stream::native_handle]
26037[indexterm2 native_handle..ssl_stream]
26038
26039
26040Get the underlying implementation in the native type.
26041[heading Synopsis]
26042```
26043native_handle_type
26044native_handle();
26045```
26046
26047[heading Description]
26048This function may be used to obtain the underlying implementation of the context. This is intended to allow access to context functionality that is not otherwise provided.
26049
26050[heading Example]
26051
26052The [link beast.ref.boost__beast__ssl_stream.native_handle `native_handle()`] function returns a pointer of type `SSL*` that is suitable for passing to functions such as `SSL_get_verify_result` and `SSL_get_peer_certificate:`
26053```
26054boost::beast::ssl_stream<net::ip::tcp::socket> ss{ioc, ctx};
26055
26056// ... establish connection and perform handshake ...
26057
26058if (X509* cert = SSL_get_peer_certificate(ss.native_handle()))
26059{
26060  if (SSL_get_verify_result(ss.native_handle()) == X509_V_OK)
26061  {
26062    // ...
26063  }
26064}
26065```
26066
26067
26068[endsect]
26069
26070[section:next_layer ssl_stream::next_layer]
26071[indexterm2 next_layer..ssl_stream]
26072
26073
26074Get a reference to the next layer.
26075```
26076next_layer_type const&
26077``[link beast.ref.boost__beast__ssl_stream.next_layer.overload1 next_layer]``() const;
26078  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.next_layer.overload1 `more...`]]``
26079
26080next_layer_type&
26081``[link beast.ref.boost__beast__ssl_stream.next_layer.overload2 next_layer]``();
26082  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.next_layer.overload2 `more...`]]``
26083```
26084
26085[section:overload1 ssl_stream::next_layer (1 of 2 overloads)]
26086
26087Get a reference to the next layer.
26088[heading Synopsis]
26089```
26090next_layer_type const&
26091next_layer() const;
26092```
26093
26094[heading Description]
26095This function returns a reference to the next layer in a stack of stream layers.
26096
26097[heading Remarks]
26098The next layer is the wrapped stream and not the [link beast.ref.boost__beast__flat_stream `flat_stream`] used in the implementation.
26099[heading Return Value]
26100A reference to the next layer in the stack of stream layers. Ownership is not transferred to the caller.
26101
26102[endsect]
26103
26104[section:overload2 ssl_stream::next_layer (2 of 2 overloads)]
26105
26106Get a reference to the next layer.
26107[heading Synopsis]
26108```
26109next_layer_type&
26110next_layer();
26111```
26112
26113[heading Description]
26114This function returns a reference to the next layer in a stack of stream layers.
26115
26116[heading Remarks]
26117The next layer is the wrapped stream and not the [link beast.ref.boost__beast__flat_stream `flat_stream`] used in the implementation.
26118[heading Return Value]
26119A reference to the next layer in the stack of stream layers. Ownership is not transferred to the caller.
26120
26121[endsect]
26122
26123
26124[endsect]
26125
26126[section:set_verify_mode ssl_stream::set_verify_mode]
26127[indexterm2 set_verify_mode..ssl_stream]
26128
26129
26130Set the peer verification mode.
26131```
26132void
26133``[link beast.ref.boost__beast__ssl_stream.set_verify_mode.overload1 set_verify_mode]``(
26134    net::ssl::verify_mode v);
26135  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.set_verify_mode.overload1 `more...`]]``
26136
26137void
26138``[link beast.ref.boost__beast__ssl_stream.set_verify_mode.overload2 set_verify_mode]``(
26139    net::ssl::verify_mode v,
26140    boost::system::error_code& ec);
26141  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.set_verify_mode.overload2 `more...`]]``
26142```
26143
26144[section:overload1 ssl_stream::set_verify_mode (1 of 2 overloads)]
26145
26146Set the peer verification mode.
26147[heading Synopsis]
26148```
26149void
26150set_verify_mode(
26151    net::ssl::verify_mode v);
26152```
26153
26154[heading Description]
26155This function may be used to configure the peer verification mode used by the stream. The new mode will override the mode inherited from the context.
26156
26157[heading Parameters]
26158[table [[Name][Description]]
26159  [
26160    [`v`
26161    ]
26162    [
26163A bitmask of peer verification modes.
26164    ]
26165  ]
26166]
26167[heading Exceptions]
26168[table [[Type][Thrown On]]
26169  [
26170    [`boost::system::system_error`
26171    ]
26172    [
26173Thrown on failure.
26174    ]
26175  ]
26176]
26177[heading Remarks]
26178Calls `SSL_set_verify`.
26179
26180[endsect]
26181
26182[section:overload2 ssl_stream::set_verify_mode (2 of 2 overloads)]
26183
26184Set the peer verification mode.
26185[heading Synopsis]
26186```
26187void
26188set_verify_mode(
26189    net::ssl::verify_mode v,
26190    boost::system::error_code& ec);
26191```
26192
26193[heading Description]
26194This function may be used to configure the peer verification mode used by the stream. The new mode will override the mode inherited from the context.
26195
26196[heading Parameters]
26197[table [[Name][Description]]
26198  [
26199    [`v`
26200    ]
26201    [
26202A bitmask of peer verification modes. See `verify_mode` for available values.
26203    ]
26204  ]
26205  [
26206    [`ec`
26207    ]
26208    [
26209Set to indicate what error occurred, if any.
26210    ]
26211  ]
26212]
26213[heading Remarks]
26214Calls `SSL_set_verify`.
26215
26216[endsect]
26217
26218
26219[endsect]
26220
26221[section:set_verify_depth ssl_stream::set_verify_depth]
26222[indexterm2 set_verify_depth..ssl_stream]
26223
26224
26225Set the peer verification depth.
26226```
26227void
26228``[link beast.ref.boost__beast__ssl_stream.set_verify_depth.overload1 set_verify_depth]``(
26229    int depth);
26230  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.set_verify_depth.overload1 `more...`]]``
26231
26232void
26233``[link beast.ref.boost__beast__ssl_stream.set_verify_depth.overload2 set_verify_depth]``(
26234    int depth,
26235    boost::system::error_code& ec);
26236  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.set_verify_depth.overload2 `more...`]]``
26237```
26238
26239[section:overload1 ssl_stream::set_verify_depth (1 of 2 overloads)]
26240
26241Set the peer verification depth.
26242[heading Synopsis]
26243```
26244void
26245set_verify_depth(
26246    int depth);
26247```
26248
26249[heading Description]
26250This function may be used to configure the maximum verification depth allowed by the stream.
26251
26252[heading Parameters]
26253[table [[Name][Description]]
26254  [
26255    [`depth`
26256    ]
26257    [
26258Maximum depth for the certificate chain verification that shall be allowed.
26259    ]
26260  ]
26261]
26262[heading Exceptions]
26263[table [[Type][Thrown On]]
26264  [
26265    [`boost::system::system_error`
26266    ]
26267    [
26268Thrown on failure.
26269    ]
26270  ]
26271]
26272[heading Remarks]
26273Calls `SSL_set_verify_depth`.
26274
26275[endsect]
26276
26277[section:overload2 ssl_stream::set_verify_depth (2 of 2 overloads)]
26278
26279Set the peer verification depth.
26280[heading Synopsis]
26281```
26282void
26283set_verify_depth(
26284    int depth,
26285    boost::system::error_code& ec);
26286```
26287
26288[heading Description]
26289This function may be used to configure the maximum verification depth allowed by the stream.
26290
26291[heading Parameters]
26292[table [[Name][Description]]
26293  [
26294    [`depth`
26295    ]
26296    [
26297Maximum depth for the certificate chain verification that shall be allowed.
26298    ]
26299  ]
26300  [
26301    [`ec`
26302    ]
26303    [
26304Set to indicate what error occurred, if any.
26305    ]
26306  ]
26307]
26308[heading Remarks]
26309Calls `SSL_set_verify_depth`.
26310
26311[endsect]
26312
26313
26314[endsect]
26315
26316[section:set_verify_callback ssl_stream::set_verify_callback]
26317[indexterm2 set_verify_callback..ssl_stream]
26318
26319
26320Set the callback used to verify peer certificates.
26321```
26322template<
26323    class VerifyCallback>
26324void
26325``[link beast.ref.boost__beast__ssl_stream.set_verify_callback.overload1 set_verify_callback]``(
26326    VerifyCallback callback);
26327  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.set_verify_callback.overload1 `more...`]]``
26328
26329template<
26330    class VerifyCallback>
26331void
26332``[link beast.ref.boost__beast__ssl_stream.set_verify_callback.overload2 set_verify_callback]``(
26333    VerifyCallback callback,
26334    boost::system::error_code& ec);
26335  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.set_verify_callback.overload2 `more...`]]``
26336```
26337
26338[section:overload1 ssl_stream::set_verify_callback (1 of 2 overloads)]
26339
26340Set the callback used to verify peer certificates.
26341[heading Synopsis]
26342```
26343template<
26344    class VerifyCallback>
26345void
26346set_verify_callback(
26347    VerifyCallback callback);
26348```
26349
26350[heading Description]
26351This function is used to specify a callback function that will be called by the implementation when it needs to verify a peer certificate.
26352
26353[heading Parameters]
26354[table [[Name][Description]]
26355  [
26356    [`callback`
26357    ]
26358    [
26359
26360The function object to be used for verifying a certificate. The function signature of the handler must be:
26361```
26362 bool verify_callback(
26363  bool preverified, // True if the certificate passed pre-verification.
26364  verify_context& ctx // The peer certificate and other context.
26365);
26366```
26367
26368The return value of the callback is true if the certificate has passed verification, false otherwise.
26369    ]
26370  ]
26371]
26372[heading Exceptions]
26373[table [[Type][Thrown On]]
26374  [
26375    [`boost::system::system_error`
26376    ]
26377    [
26378Thrown on failure.
26379    ]
26380  ]
26381]
26382[heading Remarks]
26383Calls `SSL_set_verify`.
26384
26385[endsect]
26386
26387[section:overload2 ssl_stream::set_verify_callback (2 of 2 overloads)]
26388
26389Set the callback used to verify peer certificates.
26390[heading Synopsis]
26391```
26392template<
26393    class VerifyCallback>
26394void
26395set_verify_callback(
26396    VerifyCallback callback,
26397    boost::system::error_code& ec);
26398```
26399
26400[heading Description]
26401This function is used to specify a callback function that will be called by the implementation when it needs to verify a peer certificate.
26402
26403[heading Parameters]
26404[table [[Name][Description]]
26405  [
26406    [`callback`
26407    ]
26408    [
26409
26410The function object to be used for verifying a certificate. The function signature of the handler must be:
26411```
26412 bool verify_callback(
26413  bool preverified, // True if the certificate passed pre-verification.
26414  net::verify_context& ctx // The peer certificate and other context.
26415);
26416```
26417
26418The return value of the callback is true if the certificate has passed verification, false otherwise.
26419    ]
26420  ]
26421  [
26422    [`ec`
26423    ]
26424    [
26425Set to indicate what error occurred, if any.
26426    ]
26427  ]
26428]
26429[heading Remarks]
26430Calls `SSL_set_verify`.
26431
26432[endsect]
26433
26434
26435[endsect]
26436
26437[section:handshake ssl_stream::handshake]
26438[indexterm2 handshake..ssl_stream]
26439
26440
26441Perform SSL handshaking.
26442```
26443void
26444``[link beast.ref.boost__beast__ssl_stream.handshake.overload1 handshake]``(
26445    handshake_type type);
26446  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.handshake.overload1 `more...`]]``
26447
26448void
26449``[link beast.ref.boost__beast__ssl_stream.handshake.overload2 handshake]``(
26450    handshake_type type,
26451    boost::system::error_code& ec);
26452  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.handshake.overload2 `more...`]]``
26453
26454template<
26455    class __ConstBufferSequence__>
26456void
26457``[link beast.ref.boost__beast__ssl_stream.handshake.overload3 handshake]``(
26458    handshake_type type,
26459    ConstBufferSequence const& buffers);
26460  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.handshake.overload3 `more...`]]``
26461
26462template<
26463    class __ConstBufferSequence__>
26464void
26465``[link beast.ref.boost__beast__ssl_stream.handshake.overload4 handshake]``(
26466    handshake_type type,
26467    ConstBufferSequence const& buffers,
26468    boost::system::error_code& ec);
26469  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.handshake.overload4 `more...`]]``
26470```
26471
26472[section:overload1 ssl_stream::handshake (1 of 4 overloads)]
26473
26474Perform SSL handshaking.
26475[heading Synopsis]
26476```
26477void
26478handshake(
26479    handshake_type type);
26480```
26481
26482[heading Description]
26483This function is used to perform SSL handshaking on the stream. The function call will block until handshaking is complete or an error occurs.
26484
26485[heading Parameters]
26486[table [[Name][Description]]
26487  [
26488    [`type`
26489    ]
26490    [
26491The type of handshaking to be performed, i.e. as a client or as a server.
26492    ]
26493  ]
26494]
26495[heading Exceptions]
26496[table [[Type][Thrown On]]
26497  [
26498    [`boost::system::system_error`
26499    ]
26500    [
26501Thrown on failure.
26502    ]
26503  ]
26504]
26505
26506[endsect]
26507
26508[section:overload2 ssl_stream::handshake (2 of 4 overloads)]
26509
26510Perform SSL handshaking.
26511[heading Synopsis]
26512```
26513void
26514handshake(
26515    handshake_type type,
26516    boost::system::error_code& ec);
26517```
26518
26519[heading Description]
26520This function is used to perform SSL handshaking on the stream. The function call will block until handshaking is complete or an error occurs.
26521
26522[heading Parameters]
26523[table [[Name][Description]]
26524  [
26525    [`type`
26526    ]
26527    [
26528The type of handshaking to be performed, i.e. as a client or as a server.
26529    ]
26530  ]
26531  [
26532    [`ec`
26533    ]
26534    [
26535Set to indicate what error occurred, if any.
26536    ]
26537  ]
26538]
26539
26540[endsect]
26541
26542[section:overload3 ssl_stream::handshake (3 of 4 overloads)]
26543
26544Perform SSL handshaking.
26545[heading Synopsis]
26546```
26547template<
26548    class __ConstBufferSequence__>
26549void
26550handshake(
26551    handshake_type type,
26552    ConstBufferSequence const& buffers);
26553```
26554
26555[heading Description]
26556This function is used to perform SSL handshaking on the stream. The function call will block until handshaking is complete or an error occurs.
26557
26558[heading Parameters]
26559[table [[Name][Description]]
26560  [
26561    [`type`
26562    ]
26563    [
26564The type of handshaking to be performed, i.e. as a client or as a server.
26565    ]
26566  ]
26567  [
26568    [`buffers`
26569    ]
26570    [
26571The buffered data to be reused for the handshake.
26572    ]
26573  ]
26574]
26575[heading Exceptions]
26576[table [[Type][Thrown On]]
26577  [
26578    [`boost::system::system_error`
26579    ]
26580    [
26581Thrown on failure.
26582    ]
26583  ]
26584]
26585
26586[endsect]
26587
26588[section:overload4 ssl_stream::handshake (4 of 4 overloads)]
26589
26590Perform SSL handshaking.
26591[heading Synopsis]
26592```
26593template<
26594    class __ConstBufferSequence__>
26595void
26596handshake(
26597    handshake_type type,
26598    ConstBufferSequence const& buffers,
26599    boost::system::error_code& ec);
26600```
26601
26602[heading Description]
26603This function is used to perform SSL handshaking on the stream. The function call will block until handshaking is complete or an error occurs.
26604
26605[heading Parameters]
26606[table [[Name][Description]]
26607  [
26608    [`type`
26609    ]
26610    [
26611The type of handshaking to be performed, i.e. as a client or as a server.
26612    ]
26613  ]
26614  [
26615    [`buffers`
26616    ]
26617    [
26618The buffered data to be reused for the handshake.
26619    ]
26620  ]
26621  [
26622    [`ec`
26623    ]
26624    [
26625Set to indicate what error occurred, if any.
26626    ]
26627  ]
26628]
26629
26630[endsect]
26631
26632
26633[endsect]
26634
26635[section:async_handshake ssl_stream::async_handshake]
26636[indexterm2 async_handshake..ssl_stream]
26637
26638
26639Start an asynchronous SSL handshake.
26640```
26641template<
26642    class HandshakeHandler>
26643``__deduced__``
26644``[link beast.ref.boost__beast__ssl_stream.async_handshake.overload1 async_handshake]``(
26645    handshake_type type,
26646    BOOST_ASIO_MOVE_ARG(HandshakeHandler) handler);
26647  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.async_handshake.overload1 `more...`]]``
26648
26649template<
26650    class __ConstBufferSequence__,
26651    class BufferedHandshakeHandler>
26652``__deduced__``
26653``[link beast.ref.boost__beast__ssl_stream.async_handshake.overload2 async_handshake]``(
26654    handshake_type type,
26655    ConstBufferSequence const& buffers,
26656    BOOST_ASIO_MOVE_ARG(BufferedHandshakeHandler) handler);
26657  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.async_handshake.overload2 `more...`]]``
26658```
26659
26660[section:overload1 ssl_stream::async_handshake (1 of 2 overloads)]
26661
26662Start an asynchronous SSL handshake.
26663[heading Synopsis]
26664```
26665template<
26666    class HandshakeHandler>
26667``__deduced__``
26668async_handshake(
26669    handshake_type type,
26670    BOOST_ASIO_MOVE_ARG(HandshakeHandler) handler);
26671```
26672
26673[heading Description]
26674This function is used to asynchronously perform an SSL handshake on the stream. This function call always returns immediately.
26675
26676[heading Parameters]
26677[table [[Name][Description]]
26678  [
26679    [`type`
26680    ]
26681    [
26682The type of handshaking to be performed, i.e. as a client or as a server.
26683    ]
26684  ]
26685  [
26686    [`handler`
26687    ]
26688    [
26689
26690The handler to be called when the handshake operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be:
26691```
26692 void handler(
26693  const boost::system::error_code& error // Result of operation.
26694);
26695```
26696
26697    ]
26698  ]
26699]
26700
26701[endsect]
26702
26703[section:overload2 ssl_stream::async_handshake (2 of 2 overloads)]
26704
26705Start an asynchronous SSL handshake.
26706[heading Synopsis]
26707```
26708template<
26709    class __ConstBufferSequence__,
26710    class BufferedHandshakeHandler>
26711``__deduced__``
26712async_handshake(
26713    handshake_type type,
26714    ConstBufferSequence const& buffers,
26715    BOOST_ASIO_MOVE_ARG(BufferedHandshakeHandler) handler);
26716```
26717
26718[heading Description]
26719This function is used to asynchronously perform an SSL handshake on the stream. This function call always returns immediately.
26720
26721[heading Parameters]
26722[table [[Name][Description]]
26723  [
26724    [`type`
26725    ]
26726    [
26727The type of handshaking to be performed, i.e. as a client or as a server.
26728    ]
26729  ]
26730  [
26731    [`buffers`
26732    ]
26733    [
26734The buffered data to be reused for the handshake. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.
26735    ]
26736  ]
26737  [
26738    [`handler`
26739    ]
26740    [
26741
26742The handler to be called when the handshake operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be:
26743```
26744 void handler(
26745  const boost::system::error_code& error, // Result of operation.
26746  std::size_t bytes_transferred // Amount of buffers used in handshake.
26747);
26748```
26749
26750    ]
26751  ]
26752]
26753
26754[endsect]
26755
26756
26757[endsect]
26758
26759[section:shutdown ssl_stream::shutdown]
26760[indexterm2 shutdown..ssl_stream]
26761
26762
26763Shut down SSL on the stream.
26764```
26765void
26766``[link beast.ref.boost__beast__ssl_stream.shutdown.overload1 shutdown]``();
26767  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.shutdown.overload1 `more...`]]``
26768
26769void
26770``[link beast.ref.boost__beast__ssl_stream.shutdown.overload2 shutdown]``(
26771    boost::system::error_code& ec);
26772  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.shutdown.overload2 `more...`]]``
26773```
26774
26775[section:overload1 ssl_stream::shutdown (1 of 2 overloads)]
26776
26777Shut down SSL on the stream.
26778[heading Synopsis]
26779```
26780void
26781shutdown();
26782```
26783
26784[heading Description]
26785This function is used to shut down SSL on the stream. The function call will block until SSL has been shut down or an error occurs.
26786
26787[heading Exceptions]
26788[table [[Type][Thrown On]]
26789  [
26790    [`boost::system::system_error`
26791    ]
26792    [
26793Thrown on failure.
26794    ]
26795  ]
26796]
26797
26798[endsect]
26799
26800[section:overload2 ssl_stream::shutdown (2 of 2 overloads)]
26801
26802Shut down SSL on the stream.
26803[heading Synopsis]
26804```
26805void
26806shutdown(
26807    boost::system::error_code& ec);
26808```
26809
26810[heading Description]
26811This function is used to shut down SSL on the stream. The function call will block until SSL has been shut down or an error occurs.
26812
26813[heading Parameters]
26814[table [[Name][Description]]
26815  [
26816    [`ec`
26817    ]
26818    [
26819Set to indicate what error occurred, if any.
26820    ]
26821  ]
26822]
26823
26824[endsect]
26825
26826
26827[endsect]
26828
26829[section:async_shutdown ssl_stream::async_shutdown]
26830[indexterm2 async_shutdown..ssl_stream]
26831
26832
26833Asynchronously shut down SSL on the stream.
26834[heading Synopsis]
26835```
26836template<
26837    class ShutdownHandler>
26838``__deduced__``
26839async_shutdown(
26840    BOOST_ASIO_MOVE_ARG(ShutdownHandler) handler);
26841```
26842
26843[heading Description]
26844This function is used to asynchronously shut down SSL on the stream. This function call always returns immediately.
26845
26846[heading Parameters]
26847[table [[Name][Description]]
26848  [
26849    [`handler`
26850    ]
26851    [
26852
26853The handler to be called when the handshake operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be:
26854```
26855 void handler(
26856  const boost::system::error_code& error // Result of operation.
26857);
26858```
26859
26860    ]
26861  ]
26862]
26863
26864[endsect]
26865
26866[section:write_some ssl_stream::write_some]
26867[indexterm2 write_some..ssl_stream]
26868
26869
26870Write some data to the stream.
26871```
26872template<
26873    class __ConstBufferSequence__>
26874std::size_t
26875``[link beast.ref.boost__beast__ssl_stream.write_some.overload1 write_some]``(
26876    ConstBufferSequence const& buffers);
26877  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.write_some.overload1 `more...`]]``
26878
26879template<
26880    class __ConstBufferSequence__>
26881std::size_t
26882``[link beast.ref.boost__beast__ssl_stream.write_some.overload2 write_some]``(
26883    ConstBufferSequence const& buffers,
26884    boost::system::error_code& ec);
26885  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.write_some.overload2 `more...`]]``
26886```
26887
26888[section:overload1 ssl_stream::write_some (1 of 2 overloads)]
26889
26890Write some data to the stream.
26891[heading Synopsis]
26892```
26893template<
26894    class __ConstBufferSequence__>
26895std::size_t
26896write_some(
26897    ConstBufferSequence const& buffers);
26898```
26899
26900[heading Description]
26901This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
26902
26903[heading Parameters]
26904[table [[Name][Description]]
26905  [
26906    [`buffers`
26907    ]
26908    [
26909The data to be written.
26910    ]
26911  ]
26912]
26913[heading Return Value]
26914The number of bytes written.
26915[heading Exceptions]
26916[table [[Type][Thrown On]]
26917  [
26918    [`boost::system::system_error`
26919    ]
26920    [
26921Thrown on failure.
26922    ]
26923  ]
26924]
26925[heading Remarks]
26926The `write_some` operation may not transmit all of the data to the peer. Consider using the [link beast.ref.boost__beast__file_mode `net::write`] function if you need to ensure that all data is written before the blocking operation completes.
26927
26928[endsect]
26929
26930[section:overload2 ssl_stream::write_some (2 of 2 overloads)]
26931
26932Write some data to the stream.
26933[heading Synopsis]
26934```
26935template<
26936    class __ConstBufferSequence__>
26937std::size_t
26938write_some(
26939    ConstBufferSequence const& buffers,
26940    boost::system::error_code& ec);
26941```
26942
26943[heading Description]
26944This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
26945
26946[heading Parameters]
26947[table [[Name][Description]]
26948  [
26949    [`buffers`
26950    ]
26951    [
26952The data to be written to the stream.
26953    ]
26954  ]
26955  [
26956    [`ec`
26957    ]
26958    [
26959Set to indicate what error occurred, if any.
26960    ]
26961  ]
26962]
26963[heading Return Value]
26964The number of bytes written. Returns 0 if an error occurred.
26965[heading Remarks]
26966The `write_some` operation may not transmit all of the data to the peer. Consider using the [link beast.ref.boost__beast__file_mode `net::write`] function if you need to ensure that all data is written before the blocking operation completes.
26967
26968[endsect]
26969
26970
26971[endsect]
26972
26973[section:async_write_some ssl_stream::async_write_some]
26974[indexterm2 async_write_some..ssl_stream]
26975
26976
26977Start an asynchronous write.
26978[heading Synopsis]
26979```
26980template<
26981    class __ConstBufferSequence__,
26982    class __WriteHandler__>
26983``__deduced__``
26984async_write_some(
26985    ConstBufferSequence const& buffers,
26986    BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
26987```
26988
26989[heading Description]
26990This function is used to asynchronously write one or more bytes of data to the stream. The function call always returns immediately.
26991
26992[heading Parameters]
26993[table [[Name][Description]]
26994  [
26995    [`buffers`
26996    ]
26997    [
26998The data to be written to the stream. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.
26999    ]
27000  ]
27001  [
27002    [`handler`
27003    ]
27004    [
27005
27006The handler to be called when the write operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be:
27007```
27008 void handler(
27009  const boost::system::error_code& error, // Result of operation.
27010  std::size_t bytes_transferred           // Number of bytes written.
27011);
27012```
27013
27014    ]
27015  ]
27016]
27017[heading Remarks]
27018The `async_write_some` operation may not transmit all of the data to the peer. Consider using the `net::async_write` function if you need to ensure that all data is written before the asynchronous operation completes.
27019
27020[endsect]
27021
27022[section:read_some ssl_stream::read_some]
27023[indexterm2 read_some..ssl_stream]
27024
27025
27026Read some data from the stream.
27027```
27028template<
27029    class __MutableBufferSequence__>
27030std::size_t
27031``[link beast.ref.boost__beast__ssl_stream.read_some.overload1 read_some]``(
27032    MutableBufferSequence const& buffers);
27033  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.read_some.overload1 `more...`]]``
27034
27035template<
27036    class __MutableBufferSequence__>
27037std::size_t
27038``[link beast.ref.boost__beast__ssl_stream.read_some.overload2 read_some]``(
27039    MutableBufferSequence const& buffers,
27040    boost::system::error_code& ec);
27041  ``[''''&raquo;''' [link beast.ref.boost__beast__ssl_stream.read_some.overload2 `more...`]]``
27042```
27043
27044[section:overload1 ssl_stream::read_some (1 of 2 overloads)]
27045
27046Read some data from the stream.
27047[heading Synopsis]
27048```
27049template<
27050    class __MutableBufferSequence__>
27051std::size_t
27052read_some(
27053    MutableBufferSequence const& buffers);
27054```
27055
27056[heading Description]
27057This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
27058
27059[heading Parameters]
27060[table [[Name][Description]]
27061  [
27062    [`buffers`
27063    ]
27064    [
27065The buffers into which the data will be read.
27066    ]
27067  ]
27068]
27069[heading Return Value]
27070The number of bytes read.
27071[heading Exceptions]
27072[table [[Type][Thrown On]]
27073  [
27074    [`boost::system::system_error`
27075    ]
27076    [
27077Thrown on failure.
27078    ]
27079  ]
27080]
27081[heading Remarks]
27082The `read_some` operation may not read all of the requested number of bytes. Consider using the [link beast.ref.boost__beast__file_mode `net::read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
27083
27084[endsect]
27085
27086[section:overload2 ssl_stream::read_some (2 of 2 overloads)]
27087
27088Read some data from the stream.
27089[heading Synopsis]
27090```
27091template<
27092    class __MutableBufferSequence__>
27093std::size_t
27094read_some(
27095    MutableBufferSequence const& buffers,
27096    boost::system::error_code& ec);
27097```
27098
27099[heading Description]
27100This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
27101
27102[heading Parameters]
27103[table [[Name][Description]]
27104  [
27105    [`buffers`
27106    ]
27107    [
27108The buffers into which the data will be read.
27109    ]
27110  ]
27111  [
27112    [`ec`
27113    ]
27114    [
27115Set to indicate what error occurred, if any.
27116    ]
27117  ]
27118]
27119[heading Return Value]
27120The number of bytes read. Returns 0 if an error occurred.
27121[heading Remarks]
27122The `read_some` operation may not read all of the requested number of bytes. Consider using the [link beast.ref.boost__beast__file_mode `net::read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
27123
27124[endsect]
27125
27126
27127[endsect]
27128
27129[section:async_read_some ssl_stream::async_read_some]
27130[indexterm2 async_read_some..ssl_stream]
27131
27132
27133Start an asynchronous read.
27134[heading Synopsis]
27135```
27136template<
27137    class __MutableBufferSequence__,
27138    class __ReadHandler__>
27139``__deduced__``
27140async_read_some(
27141    MutableBufferSequence const& buffers,
27142    BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
27143```
27144
27145[heading Description]
27146This function is used to asynchronously read one or more bytes of data from the stream. The function call always returns immediately.
27147
27148[heading Parameters]
27149[table [[Name][Description]]
27150  [
27151    [`buffers`
27152    ]
27153    [
27154The buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.
27155    ]
27156  ]
27157  [
27158    [`handler`
27159    ]
27160    [
27161
27162The handler to be called when the read operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be:
27163```
27164 void handler(
27165  const boost::system::error_code& error, // Result of operation.
27166  std::size_t bytes_transferred           // Number of bytes read.
27167);
27168```
27169
27170    ]
27171  ]
27172]
27173[heading Remarks]
27174The `async_read_some` operation may not read all of the requested number of bytes. Consider using the `net::async_read` function if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
27175
27176[endsect]
27177
27178
27179[endsect]
27180
27181[section:boost__beast__stable_async_base stable_async_base]
27182
27183Base class to provide completion handler boilerplate for composed operations.
27184[heading Synopsis]
27185Defined in header [include_file boost/beast/core/async_base.hpp]
27186
27187```
27188template<
27189    class __Handler__,
27190    class __Executor1__,
27191    class __Allocator__ = std::allocator<void>>
27192class stable_async_base :
27193    public async_base< Handler, Executor1, Allocator >
27194```
27195
27196[heading Types]
27197[table [[Name][Description]]
27198  [
27199    [[*[link beast.ref.boost__beast__stable_async_base.allocator_type allocator_type]]
27200    ]
27201    [
27202
27203The type of allocator associated with this object.
27204    ]
27205  ]
27206  [
27207    [[*[link beast.ref.boost__beast__stable_async_base.executor_type executor_type]]
27208    ]
27209    [
27210
27211The type of executor associated with this object.
27212    ]
27213  ]
27214]
27215[heading Member Functions]
27216[table [[Name][Description]]
27217  [
27218    [[*[link beast.ref.boost__beast__stable_async_base.complete complete]]
27219    ]
27220    [
27221
27222Invoke the final completion handler, maybe using post.
27223    ]
27224  ]
27225  [
27226    [[*[link beast.ref.boost__beast__stable_async_base.complete_now complete_now]]
27227    ]
27228    [
27229
27230Invoke the final completion handler.
27231    ]
27232  ]
27233  [
27234    [[*[link beast.ref.boost__beast__stable_async_base.get_allocator get_allocator]]
27235    ]
27236    [
27237
27238Returns the allocator associated with this object.
27239    ]
27240  ]
27241  [
27242    [[*[link beast.ref.boost__beast__stable_async_base.get_executor get_executor]]
27243    ]
27244    [
27245
27246Returns the executor associated with this object.
27247    ]
27248  ]
27249  [
27250    [[*[link beast.ref.boost__beast__stable_async_base.handler handler]]
27251    ]
27252    [
27253
27254Returns the handler associated with this object.
27255    ]
27256  ]
27257  [
27258    [[*[link beast.ref.boost__beast__stable_async_base.release_handler release_handler]]
27259    ]
27260    [
27261
27262Returns ownership of the handler associated with this object.
27263    ]
27264  ]
27265  [
27266    [[*[link beast.ref.boost__beast__stable_async_base.stable_async_base stable_async_base]]
27267    ]
27268    [
27269
27270Constructor.
27271
27272Move Constructor.
27273    ]
27274  ]
27275  [
27276    [[*[link beast.ref.boost__beast__stable_async_base._stable_async_base ~stable_async_base]]
27277    ]
27278    [
27279
27280Destructor.
27281    ]
27282  ]
27283]
27284[heading Friends]
27285[table [[Name][Description]]
27286  [
27287    [[*[link beast.ref.boost__beast__stable_async_base.allocate_stable allocate_stable]]
27288    ]
27289    [
27290
27291Allocate a temporary object to hold operation state.
27292    ]
27293  ]
27294]
27295[heading Description]
27296A function object submitted to intermediate initiating functions during a composed operation may derive from this type to inherit all of the boilerplate to forward the executor, allocator, and legacy customization points associated with the completion handler invoked at the end of the composed operation.
27297The composed operation must be typical; that is, associated with one executor of an I/O object, and invoking a caller-provided completion handler when the operation is finished. Classes derived from [link beast.ref.boost__beast__async_base `async_base`] will acquire these properties:
27298
27299* Ownership of the final completion handler provided upon construction.
27300
27301* If the final handler has an associated allocator, this allocator will be propagated to the composed operation subclass. Otherwise, the associated allocator will be the type specified in the allocator template parameter, or the default of `std::allocator<void>` if the parameter is omitted.
27302
27303* If the final handler has an associated executor, then it will be used as the executor associated with the composed operation. Otherwise, the specified `Executor1` will be the type of executor associated with the composed operation.
27304
27305* An instance of `net::executor_work_guard` for the instance of `Executor1` shall be maintained until either the final handler is invoked, or the operation base is destroyed, whichever comes first.
27306
27307* Calls to the legacy customization points `asio_handler_invoke`, `asio_handler_allocate`, `asio_handler_deallocate`, and `asio_handler_is_continuation`, which use argument-dependent lookup, will be forwarded to the legacy customization points associated with the handler.
27308
27309Data members of composed operations implemented as completion handlers do not have stable addresses, as the composed operation object is move constructed upon each call to an initiating function. For most operations this is not a problem. For complex operations requiring stable temporary storage, the class [link beast.ref.boost__beast__stable_async_base `stable_async_base`] is provided which offers additional functionality:
27310
27311* The free function [link beast.ref.boost__beast__allocate_stable `beast::allocate_stable`] may be used to allocate one or more temporary objects associated with the composed operation.
27312
27313* Memory for stable temporary objects is allocated using the allocator associated with the composed operation.
27314
27315* Stable temporary objects are automatically destroyed, and the memory freed using the associated allocator, either before the final completion handler is invoked (a Networking requirement) or when the composed operation is destroyed, whichever occurs first.
27316
27317[heading Example]
27318
27319The following code demonstrates how [link beast.ref.boost__beast__stable_async_base `stable_async_base`] may be be used to assist authoring an asynchronous initiating function, by providing all of the boilerplate to manage the final completion handler in a way that maintains the allocator and executor associations. Furthermore, the operation shown allocates temporary memory using [link beast.ref.boost__beast__allocate_stable `beast::allocate_stable`] for the timer and message, whose addresses must not change between intermediate operations:
27320
27321```
27322// Asynchronously send a message multiple times, once per second
27323template <class AsyncWriteStream, class T, class WriteHandler>
27324auto async_write_messages(
27325    AsyncWriteStream& stream,
27326    T const& message,
27327    std::size_t repeat_count,
27328    WriteHandler&& handler) ->
27329        typename net::async_result<
27330            typename std::decay<WriteHandler>::type,
27331            void(error_code)>::return_type
27332{
27333    using handler_type = typename net::async_completion<WriteHandler, void(error_code)>::completion_handler_type;
27334    using base_type = stable_async_base<handler_type, typename AsyncWriteStream::executor_type>;
27335
27336    struct op : base_type, boost::asio::coroutine
27337    {
27338        // This object must have a stable address
27339        struct temporary_data
27340        {
27341            // Although std::string is in theory movable, most implementations
27342            // use a "small buffer optimization" which means that we might
27343            // be submitting a buffer to the write operation and then
27344            // moving the string, invalidating the buffer. To prevent
27345            // undefined behavior we store the string object itself at
27346            // a stable location.
27347            std::string const message;
27348
27349            net::steady_timer timer;
27350
27351            temporary_data(std::string message_, net::io_context& ctx)
27352                : message(std::move(message_))
27353                , timer(ctx)
27354            {
27355            }
27356        };
27357
27358        AsyncWriteStream& stream_;
27359        std::size_t repeats_;
27360        temporary_data& data_;
27361
27362        op(AsyncWriteStream& stream, std::size_t repeats, std::string message, handler_type& handler)
27363            : base_type(std::move(handler), stream.get_executor())
27364            , stream_(stream)
27365            , repeats_(repeats)
27366            , data_(allocate_stable<temporary_data>(*this, std::move(message), stream.get_executor().context()))
27367        {
27368            (*this)(); // start the operation
27369        }
27370
27371        // Including this file provides the keywords for macro-based coroutines
27372        #include <boost/asio/yield.hpp>
27373
27374        void operator()(error_code ec = {}, std::size_t = 0)
27375        {
27376            reenter(*this)
27377            {
27378                // If repeats starts at 0 then we must complete immediately. But
27379                // we can't call the final handler from inside the initiating
27380                // function, so we post our intermediate handler first. We use
27381                // net::async_write with an empty buffer instead of calling
27382                // net::post to avoid an extra function template instantiation, to
27383                // keep compile times lower and make the resulting executable smaller.
27384                yield net::async_write(stream_, net::const_buffer{}, std::move(*this));
27385                while(! ec && repeats_-- > 0)
27386                {
27387                    // Send the string. We construct a `const_buffer` here to guarantee
27388                    // that we do not create an additional function template instantation
27389                    // of net::async_write, since we already instantiated it above for
27390                    // net::const_buffer.
27391
27392                    yield net::async_write(stream_,
27393                        net::const_buffer(net::buffer(data_.message)), std::move(*this));
27394                    if(ec)
27395                        break;
27396
27397                    // Set the timer and wait
27398                    data_.timer.expires_after(std::chrono::seconds(1));
27399                    yield data_.timer.async_wait(std::move(*this));
27400                }
27401            }
27402
27403            // The base class destroys the temporary data automatically,
27404            // before invoking the final completion handler
27405            this->complete_now(ec);
27406        }
27407
27408        // Including this file undefines the macros for the coroutines
27409        #include <boost/asio/unyield.hpp>
27410    };
27411
27412    net::async_completion<WriteHandler, void(error_code)> completion(handler);
27413    std::ostringstream os;
27414    os << message;
27415    op(stream, repeat_count, os.str(), completion.completion_handler);
27416    return completion.result.get();
27417}
27418```
27419
27420
27421[heading Template Parameters]
27422[table [[Type][Description]]
27423  [
27424    [`Handler`
27425    ]
27426    [
27427The type of the completion handler to store. This type must meet the requirements of ['CompletionHandler].
27428    ]
27429  ]
27430  [
27431    [`Executor1`
27432    ]
27433    [
27434The type of the executor used when the handler has no associated executor. An instance of this type must be provided upon construction. The implementation will maintain an executor work guard and a copy of this instance.
27435    ]
27436  ]
27437  [
27438    [`Allocator`
27439    ]
27440    [
27441The allocator type to use if the handler does not have an associated allocator. If this parameter is omitted, then `std::allocator<void>` will be used. If the specified allocator is not default constructible, an instance of the type must be provided upon construction.
27442    ]
27443  ]
27444]
27445[heading See Also]
27446[link beast.ref.boost__beast__stable_async_base.allocate_stable `allocate_stable`], [link beast.ref.boost__beast__async_base `async_base`]
27447
27448[section:stable_async_base stable_async_base::stable_async_base]
27449[indexterm2 stable_async_base..stable_async_base]
27450
27451
27452Constructor.
27453```
27454template<
27455    class __Handler__>
27456``[link beast.ref.boost__beast__stable_async_base.stable_async_base.overload1 stable_async_base]``(
27457    Handler&& handler,
27458    Executor1 const& ex1,
27459    Allocator const& alloc = Allocator());
27460  ``[''''&raquo;''' [link beast.ref.boost__beast__stable_async_base.stable_async_base.overload1 `more...`]]``
27461```
27462
27463
27464Move Constructor.
27465```
27466``[link beast.ref.boost__beast__stable_async_base.stable_async_base.overload2 stable_async_base]``(
27467    stable_async_base&& other);
27468  ``[''''&raquo;''' [link beast.ref.boost__beast__stable_async_base.stable_async_base.overload2 `more...`]]``
27469```
27470
27471[section:overload1 stable_async_base::stable_async_base (1 of 2 overloads)]
27472
27473Constructor.
27474[heading Synopsis]
27475```
27476template<
27477    class __Handler__>
27478stable_async_base(
27479    Handler&& handler,
27480    Executor1 const& ex1,
27481    Allocator const& alloc = Allocator());
27482```
27483
27484[heading Description]
27485
27486[heading Parameters]
27487[table [[Name][Description]]
27488  [
27489    [`handler`
27490    ]
27491    [
27492The final completion handler. The type of this object must meet the requirements of ['CompletionHandler]. The implementation takes ownership of the handler by performing a decay-copy.
27493    ]
27494  ]
27495  [
27496    [`ex1`
27497    ]
27498    [
27499The executor associated with the implied I/O object target of the operation. The implementation shall maintain an executor work guard for the lifetime of the operation, or until the final completion handler is invoked, whichever is shorter.
27500    ]
27501  ]
27502  [
27503    [`alloc`
27504    ]
27505    [
27506The allocator to be associated with objects derived from this class. If `Allocator` is default-constructible, this parameter is optional and may be omitted.
27507    ]
27508  ]
27509]
27510
27511[endsect]
27512
27513[section:overload2 stable_async_base::stable_async_base (2 of 2 overloads)]
27514
27515Move Constructor.
27516[heading Synopsis]
27517```
27518stable_async_base(
27519    stable_async_base&& other);
27520```
27521
27522[heading Description]
27523
27524[endsect]
27525
27526
27527[endsect]
27528
27529[section:_stable_async_base stable_async_base::~stable_async_base]
27530[indexterm2 ~stable_async_base..stable_async_base]
27531
27532
27533Destructor.
27534[heading Synopsis]
27535```
27536~stable_async_base();
27537```
27538
27539[heading Description]
27540If the completion handler was not invoked, then any state objects allocated with [link beast.ref.boost__beast__stable_async_base.allocate_stable `allocate_stable`] will be destroyed here.
27541
27542[endsect]
27543
27544[section:get_allocator stable_async_base::get_allocator]
27545[indexterm2 get_allocator..stable_async_base]
27546
27547(Inherited from [link beast.ref.boost__beast__async_base `async_base`])
27548
27549Returns the allocator associated with this object.
27550[heading Synopsis]
27551```
27552allocator_type
27553get_allocator() const;
27554```
27555
27556[heading Description]
27557If a class derived from [link beast.ref.boost__beast__async_base `async_base`] is a completion handler, then the object returned from this function will be used as the associated allocator of the derived class.
27558
27559[endsect]
27560
27561[section:get_executor stable_async_base::get_executor]
27562[indexterm2 get_executor..stable_async_base]
27563
27564(Inherited from [link beast.ref.boost__beast__async_base `async_base`])
27565
27566Returns the executor associated with this object.
27567[heading Synopsis]
27568```
27569executor_type
27570get_executor() const;
27571```
27572
27573[heading Description]
27574If a class derived from [link beast.ref.boost__beast__async_base `async_base`] is a completion handler, then the object returned from this function will be used as the associated executor of the derived class.
27575
27576[endsect]
27577
27578[section:handler stable_async_base::handler]
27579[indexterm2 handler..stable_async_base]
27580
27581(Inherited from [link beast.ref.boost__beast__async_base `async_base`])
27582
27583Returns the handler associated with this object.
27584[heading Synopsis]
27585```
27586Handler const&
27587handler() const;
27588```
27589
27590[heading Description]
27591
27592[endsect]
27593
27594[section:release_handler stable_async_base::release_handler]
27595[indexterm2 release_handler..stable_async_base]
27596
27597(Inherited from [link beast.ref.boost__beast__async_base `async_base`])
27598
27599Returns ownership of the handler associated with this object.
27600[heading Synopsis]
27601```
27602Handler
27603release_handler();
27604```
27605
27606[heading Description]
27607This function is used to transfer ownership of the handler to the caller, by move-construction. After the move, the only valid operations on the base object are move construction and destruction.
27608
27609[endsect]
27610
27611[section:complete stable_async_base::complete]
27612[indexterm2 complete..stable_async_base]
27613
27614(Inherited from [link beast.ref.boost__beast__async_base `async_base`])
27615
27616Invoke the final completion handler, maybe using post.
27617[heading Synopsis]
27618```
27619template<
27620    class... Args>
27621void
27622complete(
27623    bool is_continuation,
27624    Args&&... args);
27625```
27626
27627[heading Description]
27628This invokes the final completion handler with the specified arguments forwarded. It is undefined to call either of [link beast.ref.boost__beast__stable_async_base.complete `complete`] or [link beast.ref.boost__beast__stable_async_base.complete_now `complete_now`] more than once.
27629Any temporary objects allocated with [link beast.ref.boost__beast__allocate_stable `beast::allocate_stable`] will be automatically destroyed before the final completion handler is invoked.
27630
27631[heading Parameters]
27632[table [[Name][Description]]
27633  [
27634    [`is_continuation`
27635    ]
27636    [
27637If this value is `false`, then the handler will be submitted to the executor using `net::post`. Otherwise the handler will be invoked as if by calling [link beast.ref.boost__beast__stable_async_base.complete_now `complete_now`].
27638    ]
27639  ]
27640  [
27641    [`args`
27642    ]
27643    [
27644A list of optional parameters to invoke the handler with. The completion handler must be invocable with the parameter list, or else a compilation error will result.
27645    ]
27646  ]
27647]
27648
27649[endsect]
27650
27651[section:complete_now stable_async_base::complete_now]
27652[indexterm2 complete_now..stable_async_base]
27653
27654(Inherited from [link beast.ref.boost__beast__async_base `async_base`])
27655
27656Invoke the final completion handler.
27657[heading Synopsis]
27658```
27659template<
27660    class... Args>
27661void
27662complete_now(
27663    Args&&... args);
27664```
27665
27666[heading Description]
27667This invokes the final completion handler with the specified arguments forwarded. It is undefined to call either of [link beast.ref.boost__beast__stable_async_base.complete `complete`] or [link beast.ref.boost__beast__stable_async_base.complete_now `complete_now`] more than once.
27668Any temporary objects allocated with [link beast.ref.boost__beast__allocate_stable `beast::allocate_stable`] will be automatically destroyed before the final completion handler is invoked.
27669
27670[heading Parameters]
27671[table [[Name][Description]]
27672  [
27673    [`args`
27674    ]
27675    [
27676A list of optional parameters to invoke the handler with. The completion handler must be invocable with the parameter list, or else a compilation error will result.
27677    ]
27678  ]
27679]
27680
27681[endsect]
27682
27683[section:allocate_stable stable_async_base::allocate_stable]
27684[indexterm2 allocate_stable..stable_async_base]
27685
27686
27687Allocate a temporary object to hold operation state.
27688[heading Synopsis]
27689Defined in header [include_file boost/beast/core/async_base.hpp]
27690
27691```
27692template<
27693    class State,
27694    class __Handler__,
27695    class Executor1_,
27696    class Allocator_,
27697    class... Args>
27698friend State&
27699allocate_stable(
27700    stable_async_base< Handler_, Executor1_, Allocator_ >& base,
27701    Args&&... args);
27702```
27703
27704[heading Description]
27705The object will be destroyed just before the completion handler is invoked, or when the operation base is destroyed.
27706
27707
27708[endsect]
27709
27710[section:executor_type stable_async_base::executor_type]
27711[indexterm2 executor_type..stable_async_base]
27712
27713(Inherited from [link beast.ref.boost__beast__async_base `async_base`])
27714
27715The type of executor associated with this object.
27716[heading Synopsis]
27717```
27718using executor_type = ``['implementation-defined]``;
27719```
27720
27721[heading Description]
27722If a class derived from [link beast.ref.boost__beast__async_base `async_base`] is a completion handler, then the associated executor of the derived class will be this type.
27723
27724[endsect]
27725
27726[section:allocator_type stable_async_base::allocator_type]
27727[indexterm2 allocator_type..stable_async_base]
27728
27729(Inherited from [link beast.ref.boost__beast__async_base `async_base`])
27730
27731The type of allocator associated with this object.
27732[heading Synopsis]
27733```
27734using allocator_type = net::associated_allocator_t< Handler, Allocator >;
27735```
27736
27737[heading Description]
27738If a class derived from [link beast.ref.boost__beast__async_base `async_base`] is a completion handler, then the associated allocator of the derived class will be this type.
27739
27740[endsect]
27741
27742
27743[endsect]
27744
27745[section:boost__beast__static_buffer static_buffer]
27746
27747A dynamic buffer providing a fixed size, circular buffer.
27748[heading Synopsis]
27749Defined in header [include_file boost/beast/core/static_buffer.hpp]
27750
27751```
27752template<
27753    std::size_t N>
27754class static_buffer :
27755    public static_buffer_base
27756```
27757
27758[heading Types]
27759[table [[Name][Description]]
27760  [
27761    [[*[link beast.ref.boost__beast__static_buffer.const_buffers_type const_buffers_type]]
27762    ]
27763    [
27764
27765The ConstBufferSequence used to represent the readable bytes.
27766    ]
27767  ]
27768  [
27769    [[*[link beast.ref.boost__beast__static_buffer.mutable_buffers_type mutable_buffers_type]]
27770    ]
27771    [
27772
27773The MutableBufferSequence used to represent the writable bytes.
27774    ]
27775  ]
27776]
27777[heading Member Functions]
27778[table [[Name][Description]]
27779  [
27780    [[*[link beast.ref.boost__beast__static_buffer.base base]]
27781    ]
27782    [
27783
27784Returns the [link beast.ref.boost__beast__static_buffer_base `static_buffer_base`] portion of this object.
27785    ]
27786  ]
27787  [
27788    [[*[link beast.ref.boost__beast__static_buffer.capacity capacity]]
27789    ]
27790    [
27791
27792Return the maximum sum of input and output sizes that can be held without an allocation.
27793    ]
27794  ]
27795  [
27796    [[*[link beast.ref.boost__beast__static_buffer.cdata cdata]]
27797    ]
27798    [
27799
27800Returns a constant buffer sequence representing the readable bytes.
27801    ]
27802  ]
27803  [
27804    [[*[link beast.ref.boost__beast__static_buffer.clear clear]]
27805    ]
27806    [
27807
27808Clear the readable and writable bytes to zero.
27809    ]
27810  ]
27811  [
27812    [[*[link beast.ref.boost__beast__static_buffer.commit commit]]
27813    ]
27814    [
27815
27816Append writable bytes to the readable bytes.
27817    ]
27818  ]
27819  [
27820    [[*[link beast.ref.boost__beast__static_buffer.consume consume]]
27821    ]
27822    [
27823
27824Remove bytes from beginning of the readable bytes.
27825    ]
27826  ]
27827  [
27828    [[*[link beast.ref.boost__beast__static_buffer.data data]]
27829    ]
27830    [
27831
27832Returns a constant buffer sequence representing the readable bytes.
27833
27834Returns a mutable buffer sequence representing the readable bytes.
27835    ]
27836  ]
27837  [
27838    [[*[link beast.ref.boost__beast__static_buffer.max_size max_size]]
27839    ]
27840    [
27841
27842Return the maximum sum of the input and output sequence sizes.
27843    ]
27844  ]
27845  [
27846    [[*[link beast.ref.boost__beast__static_buffer.operator_eq_ operator=]]
27847    ]
27848    [
27849
27850Assignment.
27851    ]
27852  ]
27853  [
27854    [[*[link beast.ref.boost__beast__static_buffer.prepare prepare]]
27855    ]
27856    [
27857
27858Returns a mutable buffer sequence representing writable bytes.
27859    ]
27860  ]
27861  [
27862    [[*[link beast.ref.boost__beast__static_buffer.size size]]
27863    ]
27864    [
27865
27866Returns the number of readable bytes.
27867    ]
27868  ]
27869  [
27870    [[*[link beast.ref.boost__beast__static_buffer.static_buffer static_buffer]]
27871    ]
27872    [
27873
27874Constructor.
27875    ]
27876  ]
27877]
27878[heading Description]
27879A dynamic buffer encapsulates memory storage that may be automatically resized as required, where the memory is divided into two regions: readable bytes followed by writable bytes. These memory regions are internal to the dynamic buffer, but direct access to the elements is provided to permit them to be efficiently used with I/O operations.
27880Objects of this type meet the requirements of ['DynamicBuffer] and have the following additional properties:
27881
27882* A mutable buffer sequence representing the readable bytes is returned by [link beast.ref.boost__beast__static_buffer.data `data`] when `this` is non-const.
27883
27884* Buffer sequences representing the readable and writable bytes, returned by [link beast.ref.boost__beast__static_buffer.data `data`] and [link beast.ref.boost__beast__static_buffer.prepare `prepare`], may have length up to two.
27885
27886* All operations execute in constant time.
27887
27888[heading Template Parameters]
27889[table [[Type][Description]]
27890  [
27891    [`N`
27892    ]
27893    [
27894The number of bytes in the internal buffer.
27895    ]
27896  ]
27897]
27898[heading Remarks]
27899To reduce the number of template instantiations when passing objects of this type in a deduced context, the signature of the receiving function should use [link beast.ref.boost__beast__static_buffer_base `static_buffer_base`] instead.
27900[heading See Also]
27901[link beast.ref.boost__beast__static_buffer_base `static_buffer_base`]
27902
27903[section:static_buffer static_buffer::static_buffer]
27904[indexterm2 static_buffer..static_buffer]
27905
27906
27907Constructor.
27908```
27909``[link beast.ref.boost__beast__static_buffer.static_buffer.overload1 static_buffer]``();
27910  ``[''''&raquo;''' [link beast.ref.boost__beast__static_buffer.static_buffer.overload1 `more...`]]``
27911
27912``[link beast.ref.boost__beast__static_buffer.static_buffer.overload2 static_buffer]``(
27913    static_buffer const&);
27914  ``[''''&raquo;''' [link beast.ref.boost__beast__static_buffer.static_buffer.overload2 `more...`]]``
27915```
27916
27917[section:overload1 static_buffer::static_buffer (1 of 2 overloads)]
27918
27919Constructor.
27920[heading Synopsis]
27921```
27922static_buffer();
27923```
27924
27925[heading Description]
27926
27927[endsect]
27928
27929[section:overload2 static_buffer::static_buffer (2 of 2 overloads)]
27930
27931Constructor.
27932[heading Synopsis]
27933```
27934static_buffer(
27935    static_buffer const&);
27936```
27937
27938[heading Description]
27939
27940[endsect]
27941
27942
27943[endsect]
27944
27945[section:operator_eq_ static_buffer::operator=]
27946[indexterm2 operator=..static_buffer]
27947
27948
27949Assignment.
27950[heading Synopsis]
27951```
27952static_buffer&
27953operator=(
27954    static_buffer const&);
27955```
27956
27957[heading Description]
27958
27959[endsect]
27960
27961[section:base static_buffer::base]
27962[indexterm2 base..static_buffer]
27963
27964
27965Returns the [link beast.ref.boost__beast__static_buffer_base `static_buffer_base`] portion of this object.
27966```
27967static_buffer_base&
27968``[link beast.ref.boost__beast__static_buffer.base.overload1 base]``();
27969  ``[''''&raquo;''' [link beast.ref.boost__beast__static_buffer.base.overload1 `more...`]]``
27970
27971static_buffer_base const&
27972``[link beast.ref.boost__beast__static_buffer.base.overload2 base]``() const;
27973  ``[''''&raquo;''' [link beast.ref.boost__beast__static_buffer.base.overload2 `more...`]]``
27974```
27975
27976[section:overload1 static_buffer::base (1 of 2 overloads)]
27977
27978Returns the [link beast.ref.boost__beast__static_buffer_base `static_buffer_base`] portion of this object.
27979[heading Synopsis]
27980```
27981static_buffer_base&
27982base();
27983```
27984
27985[heading Description]
27986
27987[endsect]
27988
27989[section:overload2 static_buffer::base (2 of 2 overloads)]
27990
27991Returns the [link beast.ref.boost__beast__static_buffer_base `static_buffer_base`] portion of this object.
27992[heading Synopsis]
27993```
27994static_buffer_base const&
27995base() const;
27996```
27997
27998[heading Description]
27999
28000[endsect]
28001
28002
28003[endsect]
28004
28005[section:max_size static_buffer::max_size]
28006[indexterm2 max_size..static_buffer]
28007
28008
28009Return the maximum sum of the input and output sequence sizes.
28010[heading Synopsis]
28011```
28012std::size_t constexpr
28013max_size() const;
28014```
28015
28016[heading Description]
28017
28018[endsect]
28019
28020[section:capacity static_buffer::capacity]
28021[indexterm2 capacity..static_buffer]
28022
28023
28024Return the maximum sum of input and output sizes that can be held without an allocation.
28025[heading Synopsis]
28026```
28027std::size_t constexpr
28028capacity() const;
28029```
28030
28031[heading Description]
28032
28033[endsect]
28034
28035[section:clear static_buffer::clear]
28036[indexterm2 clear..static_buffer]
28037
28038
28039Clear the readable and writable bytes to zero.
28040[heading Synopsis]
28041```
28042void
28043clear();
28044```
28045
28046[heading Description]
28047This function causes the readable and writable bytes to become empty. The capacity is not changed.
28048Buffer sequences previously obtained using [link beast.ref.boost__beast__static_buffer.data `data`] or [link beast.ref.boost__beast__static_buffer.prepare `prepare`] become invalid.
28049
28050[heading Exception Safety]
28051
28052No-throw guarantee.
28053
28054[endsect]
28055
28056[section:size static_buffer::size]
28057[indexterm2 size..static_buffer]
28058
28059
28060Returns the number of readable bytes.
28061[heading Synopsis]
28062```
28063std::size_t
28064size() const;
28065```
28066
28067[heading Description]
28068
28069[endsect]
28070
28071[section:data static_buffer::data]
28072[indexterm2 data..static_buffer]
28073
28074
28075Returns a constant buffer sequence representing the readable bytes.
28076```
28077const_buffers_type
28078``[link beast.ref.boost__beast__static_buffer.data.overload1 data]``() const;
28079  ``[''''&raquo;''' [link beast.ref.boost__beast__static_buffer.data.overload1 `more...`]]``
28080```
28081
28082
28083Returns a mutable buffer sequence representing the readable bytes.
28084```
28085mutable_buffers_type
28086``[link beast.ref.boost__beast__static_buffer.data.overload2 data]``();
28087  ``[''''&raquo;''' [link beast.ref.boost__beast__static_buffer.data.overload2 `more...`]]``
28088```
28089
28090[section:overload1 static_buffer::data (1 of 2 overloads)]
28091
28092Returns a constant buffer sequence representing the readable bytes.
28093[heading Synopsis]
28094```
28095const_buffers_type
28096data() const;
28097```
28098
28099[heading Description]
28100
28101[endsect]
28102
28103[section:overload2 static_buffer::data (2 of 2 overloads)]
28104
28105Returns a mutable buffer sequence representing the readable bytes.
28106[heading Synopsis]
28107```
28108mutable_buffers_type
28109data();
28110```
28111
28112[heading Description]
28113
28114[endsect]
28115
28116
28117[endsect]
28118
28119[section:cdata static_buffer::cdata]
28120[indexterm2 cdata..static_buffer]
28121
28122
28123Returns a constant buffer sequence representing the readable bytes.
28124[heading Synopsis]
28125```
28126const_buffers_type
28127cdata() const;
28128```
28129
28130[heading Description]
28131
28132[endsect]
28133
28134[section:prepare static_buffer::prepare]
28135[indexterm2 prepare..static_buffer]
28136
28137
28138Returns a mutable buffer sequence representing writable bytes.
28139[heading Synopsis]
28140```
28141mutable_buffers_type
28142prepare(
28143    std::size_t n);
28144```
28145
28146[heading Description]
28147Returns a mutable buffer sequence representing the writable bytes containing exactly `n` bytes of storage. Memory may be reallocated as needed.
28148All buffers sequences previously obtained using [link beast.ref.boost__beast__static_buffer.data `data`] or [link beast.ref.boost__beast__static_buffer.prepare `prepare`] are invalidated.
28149
28150[heading Parameters]
28151[table [[Name][Description]]
28152  [
28153    [`n`
28154    ]
28155    [
28156The desired number of bytes in the returned buffer sequence.
28157    ]
28158  ]
28159]
28160[heading Exceptions]
28161[table [[Type][Thrown On]]
28162  [
28163    [`std::length_error`
28164    ]
28165    [
28166if [link beast.ref.boost__beast__static_buffer.size `size()`] + n exceeds [link beast.ref.boost__beast__static_buffer_base.max_size `max_size()`].
28167    ]
28168  ]
28169]
28170[heading Exception Safety]
28171
28172Strong guarantee.
28173
28174[endsect]
28175
28176[section:commit static_buffer::commit]
28177[indexterm2 commit..static_buffer]
28178
28179
28180Append writable bytes to the readable bytes.
28181[heading Synopsis]
28182```
28183void
28184commit(
28185    std::size_t n);
28186```
28187
28188[heading Description]
28189Appends n bytes from the start of the writable bytes to the end of the readable bytes. The remainder of the writable bytes are discarded. If n is greater than the number of writable bytes, all writable bytes are appended to the readable bytes.
28190All buffers sequences previously obtained using [link beast.ref.boost__beast__static_buffer.data `data`] or [link beast.ref.boost__beast__static_buffer.prepare `prepare`] are invalidated.
28191
28192[heading Parameters]
28193[table [[Name][Description]]
28194  [
28195    [`n`
28196    ]
28197    [
28198The number of bytes to append. If this number is greater than the number of writable bytes, all writable bytes are appended.
28199    ]
28200  ]
28201]
28202[heading Exception Safety]
28203
28204No-throw guarantee.
28205
28206[endsect]
28207
28208[section:consume static_buffer::consume]
28209[indexterm2 consume..static_buffer]
28210
28211
28212Remove bytes from beginning of the readable bytes.
28213[heading Synopsis]
28214```
28215void
28216consume(
28217    std::size_t n);
28218```
28219
28220[heading Description]
28221Removes n bytes from the beginning of the readable bytes.
28222All buffers sequences previously obtained using [link beast.ref.boost__beast__static_buffer.data `data`] or [link beast.ref.boost__beast__static_buffer.prepare `prepare`] are invalidated.
28223
28224[heading Parameters]
28225[table [[Name][Description]]
28226  [
28227    [`n`
28228    ]
28229    [
28230The number of bytes to remove. If this number is greater than the number of readable bytes, all readable bytes are removed.
28231    ]
28232  ]
28233]
28234[heading Exception Safety]
28235
28236No-throw guarantee.
28237
28238[endsect]
28239
28240[section:const_buffers_type static_buffer::const_buffers_type]
28241[indexterm2 const_buffers_type..static_buffer]
28242
28243
28244The ConstBufferSequence used to represent the readable bytes.
28245[heading Synopsis]
28246```
28247using const_buffers_type = ``['implementation-defined]``;
28248```
28249
28250[heading Description]
28251
28252[endsect]
28253
28254[section:mutable_buffers_type static_buffer::mutable_buffers_type]
28255[indexterm2 mutable_buffers_type..static_buffer]
28256
28257
28258The MutableBufferSequence used to represent the writable bytes.
28259[heading Synopsis]
28260```
28261using mutable_buffers_type = ``['implementation-defined]``;
28262```
28263
28264[heading Description]
28265
28266[endsect]
28267
28268
28269[endsect]
28270
28271[section:boost__beast__static_buffer_base static_buffer_base]
28272
28273A dynamic buffer providing a fixed size, circular buffer.
28274[heading Synopsis]
28275Defined in header [include_file boost/beast/core/static_buffer.hpp]
28276
28277```
28278class static_buffer_base
28279```
28280
28281[heading Types]
28282[table [[Name][Description]]
28283  [
28284    [[*[link beast.ref.boost__beast__static_buffer_base.const_buffers_type const_buffers_type]]
28285    ]
28286    [
28287
28288The ConstBufferSequence used to represent the readable bytes.
28289    ]
28290  ]
28291  [
28292    [[*[link beast.ref.boost__beast__static_buffer_base.mutable_buffers_type mutable_buffers_type]]
28293    ]
28294    [
28295
28296The MutableBufferSequence used to represent the writable bytes.
28297    ]
28298  ]
28299]
28300[heading Member Functions]
28301[table [[Name][Description]]
28302  [
28303    [[*[link beast.ref.boost__beast__static_buffer_base.capacity capacity]]
28304    ]
28305    [
28306
28307Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
28308    ]
28309  ]
28310  [
28311    [[*[link beast.ref.boost__beast__static_buffer_base.cdata cdata]]
28312    ]
28313    [
28314
28315Returns a constant buffer sequence representing the readable bytes.
28316    ]
28317  ]
28318  [
28319    [[*[link beast.ref.boost__beast__static_buffer_base.clear clear]]
28320    ]
28321    [
28322
28323Clear the readable and writable bytes to zero.
28324    ]
28325  ]
28326  [
28327    [[*[link beast.ref.boost__beast__static_buffer_base.commit commit]]
28328    ]
28329    [
28330
28331Append writable bytes to the readable bytes.
28332    ]
28333  ]
28334  [
28335    [[*[link beast.ref.boost__beast__static_buffer_base.consume consume]]
28336    ]
28337    [
28338
28339Remove bytes from beginning of the readable bytes.
28340    ]
28341  ]
28342  [
28343    [[*[link beast.ref.boost__beast__static_buffer_base.data data]]
28344    ]
28345    [
28346
28347Returns a constant buffer sequence representing the readable bytes.
28348
28349Returns a mutable buffer sequence representing the readable bytes.
28350    ]
28351  ]
28352  [
28353    [[*[link beast.ref.boost__beast__static_buffer_base.max_size max_size]]
28354    ]
28355    [
28356
28357Return the maximum number of bytes, both readable and writable, that can ever be held.
28358    ]
28359  ]
28360  [
28361    [[*[link beast.ref.boost__beast__static_buffer_base.prepare prepare]]
28362    ]
28363    [
28364
28365Returns a mutable buffer sequence representing writable bytes.
28366    ]
28367  ]
28368  [
28369    [[*[link beast.ref.boost__beast__static_buffer_base.size size]]
28370    ]
28371    [
28372
28373Returns the number of readable bytes.
28374    ]
28375  ]
28376  [
28377    [[*[link beast.ref.boost__beast__static_buffer_base.static_buffer_base static_buffer_base]]
28378    ]
28379    [
28380
28381Constructor.
28382    ]
28383  ]
28384]
28385[heading Description]
28386A dynamic buffer encapsulates memory storage that may be automatically resized as required, where the memory is divided into two regions: readable bytes followed by writable bytes. These memory regions are internal to the dynamic buffer, but direct access to the elements is provided to permit them to be efficiently used with I/O operations.
28387Objects of this type meet the requirements of ['DynamicBuffer] and have the following additional properties:
28388
28389* A mutable buffer sequence representing the readable bytes is returned by [link beast.ref.boost__beast__static_buffer_base.data `data`] when `this` is non-const.
28390
28391* Buffer sequences representing the readable and writable bytes, returned by [link beast.ref.boost__beast__static_buffer_base.data `data`] and [link beast.ref.boost__beast__static_buffer_base.prepare `prepare`], may have length up to two.
28392
28393* All operations execute in constant time.
28394
28395* Ownership of the underlying storage belongs to the derived class.
28396
28397[heading Remarks]
28398Variables are usually declared using the template class [link beast.ref.boost__beast__static_buffer `static_buffer`]; however, to reduce the number of template instantiations, objects should be passed [link beast.ref.boost__beast__static_buffer_base `static_buffer_base`]&.
28399[heading See Also]
28400[link beast.ref.boost__beast__static_buffer `static_buffer`]
28401
28402[section:const_buffers_type static_buffer_base::const_buffers_type]
28403[indexterm2 const_buffers_type..static_buffer_base]
28404
28405
28406The ConstBufferSequence used to represent the readable bytes.
28407[heading Synopsis]
28408```
28409using const_buffers_type = ``['implementation-defined]``;
28410```
28411
28412[heading Description]
28413
28414[endsect]
28415
28416[section:mutable_buffers_type static_buffer_base::mutable_buffers_type]
28417[indexterm2 mutable_buffers_type..static_buffer_base]
28418
28419
28420The MutableBufferSequence used to represent the writable bytes.
28421[heading Synopsis]
28422```
28423using mutable_buffers_type = ``['implementation-defined]``;
28424```
28425
28426[heading Description]
28427
28428[endsect]
28429
28430[section:static_buffer_base static_buffer_base::static_buffer_base]
28431[indexterm2 static_buffer_base..static_buffer_base]
28432
28433
28434Constructor.
28435[heading Synopsis]
28436```
28437static_buffer_base(
28438    void* p,
28439    std::size_t size);
28440```
28441
28442[heading Description]
28443This creates a dynamic buffer using the provided storage area.
28444
28445[heading Parameters]
28446[table [[Name][Description]]
28447  [
28448    [`p`
28449    ]
28450    [
28451A pointer to valid storage of at least `n` bytes.
28452    ]
28453  ]
28454  [
28455    [`size`
28456    ]
28457    [
28458The number of valid bytes pointed to by `p`.
28459    ]
28460  ]
28461]
28462
28463[endsect]
28464
28465[section:clear static_buffer_base::clear]
28466[indexterm2 clear..static_buffer_base]
28467
28468
28469Clear the readable and writable bytes to zero.
28470[heading Synopsis]
28471```
28472void
28473clear();
28474```
28475
28476[heading Description]
28477This function causes the readable and writable bytes to become empty. The capacity is not changed.
28478Buffer sequences previously obtained using [link beast.ref.boost__beast__static_buffer_base.data `data`] or [link beast.ref.boost__beast__static_buffer_base.prepare `prepare`] become invalid.
28479
28480[heading Exception Safety]
28481
28482No-throw guarantee.
28483
28484[endsect]
28485
28486[section:size static_buffer_base::size]
28487[indexterm2 size..static_buffer_base]
28488
28489
28490Returns the number of readable bytes.
28491[heading Synopsis]
28492```
28493std::size_t
28494size() const;
28495```
28496
28497[heading Description]
28498
28499[endsect]
28500
28501[section:max_size static_buffer_base::max_size]
28502[indexterm2 max_size..static_buffer_base]
28503
28504
28505Return the maximum number of bytes, both readable and writable, that can ever be held.
28506[heading Synopsis]
28507```
28508std::size_t
28509max_size() const;
28510```
28511
28512[heading Description]
28513
28514[endsect]
28515
28516[section:capacity static_buffer_base::capacity]
28517[indexterm2 capacity..static_buffer_base]
28518
28519
28520Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
28521[heading Synopsis]
28522```
28523std::size_t
28524capacity() const;
28525```
28526
28527[heading Description]
28528
28529[endsect]
28530
28531[section:data static_buffer_base::data]
28532[indexterm2 data..static_buffer_base]
28533
28534
28535Returns a constant buffer sequence representing the readable bytes.
28536```
28537const_buffers_type
28538``[link beast.ref.boost__beast__static_buffer_base.data.overload1 data]``() const;
28539  ``[''''&raquo;''' [link beast.ref.boost__beast__static_buffer_base.data.overload1 `more...`]]``
28540```
28541
28542
28543Returns a mutable buffer sequence representing the readable bytes.
28544```
28545mutable_buffers_type
28546``[link beast.ref.boost__beast__static_buffer_base.data.overload2 data]``();
28547  ``[''''&raquo;''' [link beast.ref.boost__beast__static_buffer_base.data.overload2 `more...`]]``
28548```
28549
28550[section:overload1 static_buffer_base::data (1 of 2 overloads)]
28551
28552Returns a constant buffer sequence representing the readable bytes.
28553[heading Synopsis]
28554```
28555const_buffers_type
28556data() const;
28557```
28558
28559[heading Description]
28560
28561[endsect]
28562
28563[section:overload2 static_buffer_base::data (2 of 2 overloads)]
28564
28565Returns a mutable buffer sequence representing the readable bytes.
28566[heading Synopsis]
28567```
28568mutable_buffers_type
28569data();
28570```
28571
28572[heading Description]
28573
28574[endsect]
28575
28576
28577[endsect]
28578
28579[section:cdata static_buffer_base::cdata]
28580[indexterm2 cdata..static_buffer_base]
28581
28582
28583Returns a constant buffer sequence representing the readable bytes.
28584[heading Synopsis]
28585```
28586const_buffers_type
28587cdata() const;
28588```
28589
28590[heading Description]
28591
28592[endsect]
28593
28594[section:prepare static_buffer_base::prepare]
28595[indexterm2 prepare..static_buffer_base]
28596
28597
28598Returns a mutable buffer sequence representing writable bytes.
28599[heading Synopsis]
28600```
28601mutable_buffers_type
28602prepare(
28603    std::size_t n);
28604```
28605
28606[heading Description]
28607Returns a mutable buffer sequence representing the writable bytes containing exactly `n` bytes of storage. Memory may be reallocated as needed.
28608All buffers sequences previously obtained using [link beast.ref.boost__beast__static_buffer_base.data `data`] or [link beast.ref.boost__beast__static_buffer_base.prepare `prepare`] are invalidated.
28609
28610[heading Parameters]
28611[table [[Name][Description]]
28612  [
28613    [`n`
28614    ]
28615    [
28616The desired number of bytes in the returned buffer sequence.
28617    ]
28618  ]
28619]
28620[heading Exceptions]
28621[table [[Type][Thrown On]]
28622  [
28623    [`std::length_error`
28624    ]
28625    [
28626if [link beast.ref.boost__beast__static_buffer_base.size `size()`] + n exceeds [link beast.ref.boost__beast__static_buffer_base.max_size `max_size()`].
28627    ]
28628  ]
28629]
28630[heading Exception Safety]
28631
28632Strong guarantee.
28633
28634[endsect]
28635
28636[section:commit static_buffer_base::commit]
28637[indexterm2 commit..static_buffer_base]
28638
28639
28640Append writable bytes to the readable bytes.
28641[heading Synopsis]
28642```
28643void
28644commit(
28645    std::size_t n);
28646```
28647
28648[heading Description]
28649Appends n bytes from the start of the writable bytes to the end of the readable bytes. The remainder of the writable bytes are discarded. If n is greater than the number of writable bytes, all writable bytes are appended to the readable bytes.
28650All buffers sequences previously obtained using [link beast.ref.boost__beast__static_buffer_base.data `data`] or [link beast.ref.boost__beast__static_buffer_base.prepare `prepare`] are invalidated.
28651
28652[heading Parameters]
28653[table [[Name][Description]]
28654  [
28655    [`n`
28656    ]
28657    [
28658The number of bytes to append. If this number is greater than the number of writable bytes, all writable bytes are appended.
28659    ]
28660  ]
28661]
28662[heading Exception Safety]
28663
28664No-throw guarantee.
28665
28666[endsect]
28667
28668[section:consume static_buffer_base::consume]
28669[indexterm2 consume..static_buffer_base]
28670
28671
28672Remove bytes from beginning of the readable bytes.
28673[heading Synopsis]
28674```
28675void
28676consume(
28677    std::size_t n);
28678```
28679
28680[heading Description]
28681Removes n bytes from the beginning of the readable bytes.
28682All buffers sequences previously obtained using [link beast.ref.boost__beast__static_buffer_base.data `data`] or [link beast.ref.boost__beast__static_buffer_base.prepare `prepare`] are invalidated.
28683
28684[heading Parameters]
28685[table [[Name][Description]]
28686  [
28687    [`n`
28688    ]
28689    [
28690The number of bytes to remove. If this number is greater than the number of readable bytes, all readable bytes are removed.
28691    ]
28692  ]
28693]
28694[heading Exception Safety]
28695
28696No-throw guarantee.
28697
28698[endsect]
28699
28700
28701[endsect]
28702
28703[section:boost__beast__static_string static_string]
28704
28705A modifiable string with a fixed-size storage area.
28706[heading Synopsis]
28707Defined in header [include_file boost/beast/core/static_string.hpp]
28708
28709```
28710template<
28711    std::size_t N,
28712    class CharT = char,
28713    class Traits = std::char_traits<CharT>>
28714class static_string
28715```
28716
28717[heading Types]
28718[table [[Name][Description]]
28719  [
28720    [[*[link beast.ref.boost__beast__static_string.const_iterator const_iterator]]
28721    ]
28722    [
28723
28724    ]
28725  ]
28726  [
28727    [[*[link beast.ref.boost__beast__static_string.const_pointer const_pointer]]
28728    ]
28729    [
28730
28731    ]
28732  ]
28733  [
28734    [[*[link beast.ref.boost__beast__static_string.const_reference const_reference]]
28735    ]
28736    [
28737
28738    ]
28739  ]
28740  [
28741    [[*[link beast.ref.boost__beast__static_string.const_reverse_iterator const_reverse_iterator]]
28742    ]
28743    [
28744
28745    ]
28746  ]
28747  [
28748    [[*[link beast.ref.boost__beast__static_string.difference_type difference_type]]
28749    ]
28750    [
28751
28752    ]
28753  ]
28754  [
28755    [[*[link beast.ref.boost__beast__static_string.iterator iterator]]
28756    ]
28757    [
28758
28759    ]
28760  ]
28761  [
28762    [[*[link beast.ref.boost__beast__static_string.pointer pointer]]
28763    ]
28764    [
28765
28766    ]
28767  ]
28768  [
28769    [[*[link beast.ref.boost__beast__static_string.reference reference]]
28770    ]
28771    [
28772
28773    ]
28774  ]
28775  [
28776    [[*[link beast.ref.boost__beast__static_string.reverse_iterator reverse_iterator]]
28777    ]
28778    [
28779
28780    ]
28781  ]
28782  [
28783    [[*[link beast.ref.boost__beast__static_string.size_type size_type]]
28784    ]
28785    [
28786
28787    ]
28788  ]
28789  [
28790    [[*[link beast.ref.boost__beast__static_string.string_view_type string_view_type]]
28791    ]
28792    [
28793
28794The type of `string_view` returned by the interface.
28795    ]
28796  ]
28797  [
28798    [[*[link beast.ref.boost__beast__static_string.traits_type traits_type]]
28799    ]
28800    [
28801
28802    ]
28803  ]
28804  [
28805    [[*[link beast.ref.boost__beast__static_string.value_type value_type]]
28806    ]
28807    [
28808
28809    ]
28810  ]
28811]
28812[heading Member Functions]
28813[table [[Name][Description]]
28814  [
28815    [[*[link beast.ref.boost__beast__static_string.append append]]
28816    ]
28817    [
28818
28819    ]
28820  ]
28821  [
28822    [[*[link beast.ref.boost__beast__static_string.assign assign]]
28823    ]
28824    [
28825
28826Assign `count` copies of `ch`.
28827
28828Assign from another [link beast.ref.boost__beast__static_string `static_string`]
28829
28830Assign `count` characterss starting at `npos` from `other`.
28831
28832Assign the first `count` characters of `s`, including nulls.
28833
28834Assign a null terminated string.
28835
28836Assign from an iterator range of characters.
28837
28838Assign from initializer list.
28839
28840Assign from `string_view_type`.
28841
28842Assign from any object convertible to `string_view_type`.
28843    ]
28844  ]
28845  [
28846    [[*[link beast.ref.boost__beast__static_string.at at]]
28847    ]
28848    [
28849
28850Access specified character with bounds checking.
28851    ]
28852  ]
28853  [
28854    [[*[link beast.ref.boost__beast__static_string.back back]]
28855    ]
28856    [
28857
28858Accesses the last character.
28859    ]
28860  ]
28861  [
28862    [[*[link beast.ref.boost__beast__static_string.begin begin]]
28863    ]
28864    [
28865
28866Returns an iterator to the beginning.
28867    ]
28868  ]
28869  [
28870    [[*[link beast.ref.boost__beast__static_string.c_str c_str]]
28871    ]
28872    [
28873
28874Returns a non-modifiable standard C character array version of the string.
28875    ]
28876  ]
28877  [
28878    [[*[link beast.ref.boost__beast__static_string.capacity capacity]]
28879    ]
28880    [
28881
28882Returns the number of characters that can be held in currently allocated storage.
28883    ]
28884  ]
28885  [
28886    [[*[link beast.ref.boost__beast__static_string.cbegin cbegin]]
28887    ]
28888    [
28889
28890Returns an iterator to the beginning.
28891    ]
28892  ]
28893  [
28894    [[*[link beast.ref.boost__beast__static_string.cend cend]]
28895    ]
28896    [
28897
28898Returns an iterator to the end.
28899    ]
28900  ]
28901  [
28902    [[*[link beast.ref.boost__beast__static_string.clear clear]]
28903    ]
28904    [
28905
28906Clears the contents.
28907    ]
28908  ]
28909  [
28910    [[*[link beast.ref.boost__beast__static_string.compare compare]]
28911    ]
28912    [
28913
28914    ]
28915  ]
28916  [
28917    [[*[link beast.ref.boost__beast__static_string.copy copy]]
28918    ]
28919    [
28920
28921Copy a substring (pos, pos+count) to character string pointed to by `dest`.
28922    ]
28923  ]
28924  [
28925    [[*[link beast.ref.boost__beast__static_string.crbegin crbegin]]
28926    ]
28927    [
28928
28929Returns a reverse iterator to the beginning.
28930    ]
28931  ]
28932  [
28933    [[*[link beast.ref.boost__beast__static_string.crend crend]]
28934    ]
28935    [
28936
28937Returns a reverse iterator to the end.
28938    ]
28939  ]
28940  [
28941    [[*[link beast.ref.boost__beast__static_string.data data]]
28942    ]
28943    [
28944
28945Returns a pointer to the first character of a string.
28946    ]
28947  ]
28948  [
28949    [[*[link beast.ref.boost__beast__static_string.empty empty]]
28950    ]
28951    [
28952
28953Returns `true` if the string is empty.
28954    ]
28955  ]
28956  [
28957    [[*[link beast.ref.boost__beast__static_string.end end]]
28958    ]
28959    [
28960
28961Returns an iterator to the end.
28962    ]
28963  ]
28964  [
28965    [[*[link beast.ref.boost__beast__static_string.erase erase]]
28966    ]
28967    [
28968
28969    ]
28970  ]
28971  [
28972    [[*[link beast.ref.boost__beast__static_string.front front]]
28973    ]
28974    [
28975
28976Accesses the first character.
28977    ]
28978  ]
28979  [
28980    [[*[link beast.ref.boost__beast__static_string.insert insert]]
28981    ]
28982    [
28983
28984    ]
28985  ]
28986  [
28987    [[*[link beast.ref.boost__beast__static_string.length length]]
28988    ]
28989    [
28990
28991Returns the number of characters, excluding the null terminator.
28992    ]
28993  ]
28994  [
28995    [[*[link beast.ref.boost__beast__static_string.max_size max_size]]
28996    ]
28997    [
28998
28999Returns the maximum number of characters that can be stored, excluding the null terminator.
29000    ]
29001  ]
29002  [
29003    [[*[link beast.ref.boost__beast__static_string.operator_string_view_type operator string_view_type]]
29004    ]
29005    [
29006
29007Convert a static string to a `string_view_type`
29008    ]
29009  ]
29010  [
29011    [[*[link beast.ref.boost__beast__static_string.operator_plus__eq_ operator+=]]
29012    ]
29013    [
29014
29015    ]
29016  ]
29017  [
29018    [[*[link beast.ref.boost__beast__static_string.operator_eq_ operator=]]
29019    ]
29020    [
29021
29022Copy assignment.
29023
29024Assign from null-terminated string.
29025
29026Assign from single character.
29027
29028Assign from initializer list.
29029
29030Assign from `string_view_type`.
29031    ]
29032  ]
29033  [
29034    [[*[link beast.ref.boost__beast__static_string.operator_lb__rb_ operator\[\]]]
29035    ]
29036    [
29037
29038Access specified character.
29039    ]
29040  ]
29041  [
29042    [[*[link beast.ref.boost__beast__static_string.pop_back pop_back]]
29043    ]
29044    [
29045
29046    ]
29047  ]
29048  [
29049    [[*[link beast.ref.boost__beast__static_string.push_back push_back]]
29050    ]
29051    [
29052
29053    ]
29054  ]
29055  [
29056    [[*[link beast.ref.boost__beast__static_string.rbegin rbegin]]
29057    ]
29058    [
29059
29060Returns a reverse iterator to the beginning.
29061    ]
29062  ]
29063  [
29064    [[*[link beast.ref.boost__beast__static_string.rend rend]]
29065    ]
29066    [
29067
29068Returns a reverse iterator to the end.
29069    ]
29070  ]
29071  [
29072    [[*[link beast.ref.boost__beast__static_string.reserve reserve]]
29073    ]
29074    [
29075
29076Reserves storage.
29077    ]
29078  ]
29079  [
29080    [[*[link beast.ref.boost__beast__static_string.resize resize]]
29081    ]
29082    [
29083
29084Changes the number of characters stored.
29085    ]
29086  ]
29087  [
29088    [[*[link beast.ref.boost__beast__static_string.shrink_to_fit shrink_to_fit]]
29089    ]
29090    [
29091
29092Reduces memory usage by freeing unused memory.
29093    ]
29094  ]
29095  [
29096    [[*[link beast.ref.boost__beast__static_string.size size]]
29097    ]
29098    [
29099
29100Returns the number of characters, excluding the null terminator.
29101    ]
29102  ]
29103  [
29104    [[*[link beast.ref.boost__beast__static_string.static_string static_string]]
29105    ]
29106    [
29107
29108Default constructor (empty string).
29109
29110Construct with count copies of character `ch`.
29111
29112Construct with a substring (pos, other.size()) of `other`.
29113
29114Construct with a substring (pos, count) of `other`.
29115
29116Construct with the first `count` characters of `s`, including nulls.
29117
29118Construct from a null terminated string.
29119
29120Construct from a range of characters.
29121
29122Copy constructor.
29123
29124Construct from an initializer list.
29125
29126Construct from a `string_view`
29127
29128Construct from any object convertible to `string_view_type`.
29129    ]
29130  ]
29131  [
29132    [[*[link beast.ref.boost__beast__static_string.substr substr]]
29133    ]
29134    [
29135
29136    ]
29137  ]
29138  [
29139    [[*[link beast.ref.boost__beast__static_string.swap swap]]
29140    ]
29141    [
29142
29143Exchange the contents of this string with another.
29144    ]
29145  ]
29146]
29147[heading Static Members]
29148[table [[Name][Description]]
29149  [
29150    [[*[link beast.ref.boost__beast__static_string.max_size_n max_size_n]]
29151    ]
29152    [
29153
29154Maximum size of the string excluding the null terminator.
29155    ]
29156  ]
29157  [
29158    [[*[link beast.ref.boost__beast__static_string.npos npos]]
29159    ]
29160    [
29161
29162A special index.
29163    ]
29164  ]
29165]
29166[heading Description]
29167These objects behave like `std::string` except that the storage is not dynamically allocated but rather fixed in size.
29168These strings offer performance advantages when a protocol imposes a natural small upper limit on the size of a value.
29169
29170[heading Remarks]
29171The stored string is always null-terminated.
29172[heading See Also]
29173[link beast.ref.boost__beast__to_static_string `to_static_string`]
29174
29175[section:traits_type static_string::traits_type]
29176[indexterm2 traits_type..static_string]
29177
29178
29179[heading Synopsis]
29180```
29181using traits_type = Traits;
29182```
29183
29184[heading Description]
29185
29186[endsect]
29187
29188[section:value_type static_string::value_type]
29189[indexterm2 value_type..static_string]
29190
29191
29192[heading Synopsis]
29193```
29194using value_type = typename Traits::char_type;
29195```
29196
29197[heading Description]
29198
29199[endsect]
29200
29201[section:size_type static_string::size_type]
29202[indexterm2 size_type..static_string]
29203
29204
29205[heading Synopsis]
29206```
29207using size_type = std::size_t;
29208```
29209
29210[heading Description]
29211
29212[endsect]
29213
29214[section:difference_type static_string::difference_type]
29215[indexterm2 difference_type..static_string]
29216
29217
29218[heading Synopsis]
29219```
29220using difference_type = std::ptrdiff_t;
29221```
29222
29223[heading Description]
29224
29225[endsect]
29226
29227[section:pointer static_string::pointer]
29228[indexterm2 pointer..static_string]
29229
29230
29231[heading Synopsis]
29232```
29233using pointer = value_type*;
29234```
29235
29236[heading Description]
29237
29238[endsect]
29239
29240[section:reference static_string::reference]
29241[indexterm2 reference..static_string]
29242
29243
29244[heading Synopsis]
29245```
29246using reference = value_type&;
29247```
29248
29249[heading Description]
29250
29251[endsect]
29252
29253[section:const_pointer static_string::const_pointer]
29254[indexterm2 const_pointer..static_string]
29255
29256
29257[heading Synopsis]
29258```
29259using const_pointer = value_type const*;
29260```
29261
29262[heading Description]
29263
29264[endsect]
29265
29266[section:const_reference static_string::const_reference]
29267[indexterm2 const_reference..static_string]
29268
29269
29270[heading Synopsis]
29271```
29272using const_reference = value_type const&;
29273```
29274
29275[heading Description]
29276
29277[endsect]
29278
29279[section:iterator static_string::iterator]
29280[indexterm2 iterator..static_string]
29281
29282
29283[heading Synopsis]
29284```
29285using iterator = value_type*;
29286```
29287
29288[heading Description]
29289
29290[endsect]
29291
29292[section:const_iterator static_string::const_iterator]
29293[indexterm2 const_iterator..static_string]
29294
29295
29296[heading Synopsis]
29297```
29298using const_iterator = value_type const*;
29299```
29300
29301[heading Description]
29302
29303[endsect]
29304
29305[section:reverse_iterator static_string::reverse_iterator]
29306[indexterm2 reverse_iterator..static_string]
29307
29308
29309[heading Synopsis]
29310```
29311using reverse_iterator = std::reverse_iterator< iterator >;
29312```
29313
29314[heading Description]
29315
29316[endsect]
29317
29318[section:const_reverse_iterator static_string::const_reverse_iterator]
29319[indexterm2 const_reverse_iterator..static_string]
29320
29321
29322[heading Synopsis]
29323```
29324using const_reverse_iterator = std::reverse_iterator< const_iterator >;
29325```
29326
29327[heading Description]
29328
29329[endsect]
29330
29331[section:string_view_type static_string::string_view_type]
29332[indexterm2 string_view_type..static_string]
29333
29334
29335The type of `string_view` returned by the interface.
29336[heading Synopsis]
29337```
29338using string_view_type = basic_string_view< CharT, Traits >;
29339```
29340
29341[heading Description]
29342
29343[endsect]
29344
29345[section:max_size_n static_string::max_size_n]
29346[indexterm2 max_size_n..static_string]
29347
29348
29349Maximum size of the string excluding the null terminator.
29350[heading Synopsis]
29351```
29352static
29353std::size_t constexpr max_size_n = N;
29354```
29355
29356[heading Description]
29357
29358[endsect]
29359
29360[section:npos static_string::npos]
29361[indexterm2 npos..static_string]
29362
29363
29364A special index.
29365[heading Synopsis]
29366```
29367static
29368constexpr size_type npos = ``[link beast.ref.boost__beast__static_string.size_type size_type]``(-1);
29369```
29370
29371[heading Description]
29372
29373[endsect]
29374
29375[section:static_string static_string::static_string]
29376[indexterm2 static_string..static_string]
29377
29378
29379Default constructor (empty string).
29380```
29381``[link beast.ref.boost__beast__static_string.static_string.overload1 static_string]``();
29382  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.static_string.overload1 `more...`]]``
29383```
29384
29385
29386Construct with count copies of character `ch`.
29387```
29388``[link beast.ref.boost__beast__static_string.static_string.overload2 static_string]``(
29389    size_type count,
29390    CharT ch);
29391  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.static_string.overload2 `more...`]]``
29392```
29393
29394
29395Construct with a substring (pos, other.size()) of `other`.
29396```
29397template<
29398    std::size_t M>
29399``[link beast.ref.boost__beast__static_string.static_string.overload3 static_string]``(
29400    static_string< M, CharT, Traits > const& other,
29401    size_type pos);
29402  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.static_string.overload3 `more...`]]``
29403```
29404
29405
29406Construct with a substring (pos, count) of `other`.
29407```
29408template<
29409    std::size_t M>
29410``[link beast.ref.boost__beast__static_string.static_string.overload4 static_string]``(
29411    static_string< M, CharT, Traits > const& other,
29412    size_type pos,
29413    size_type count);
29414  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.static_string.overload4 `more...`]]``
29415```
29416
29417
29418Construct with the first `count` characters of `s`, including nulls.
29419```
29420``[link beast.ref.boost__beast__static_string.static_string.overload5 static_string]``(
29421    CharT const* s,
29422    size_type count);
29423  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.static_string.overload5 `more...`]]``
29424```
29425
29426
29427Construct from a null terminated string.
29428```
29429``[link beast.ref.boost__beast__static_string.static_string.overload6 static_string]``(
29430    CharT const* s);
29431  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.static_string.overload6 `more...`]]``
29432```
29433
29434
29435Construct from a range of characters.
29436```
29437template<
29438    class InputIt>
29439``[link beast.ref.boost__beast__static_string.static_string.overload7 static_string]``(
29440    InputIt first,
29441    InputIt last);
29442  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.static_string.overload7 `more...`]]``
29443```
29444
29445
29446Copy constructor.
29447```
29448``[link beast.ref.boost__beast__static_string.static_string.overload8 static_string]``(
29449    static_string const& other);
29450  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.static_string.overload8 `more...`]]``
29451
29452template<
29453    std::size_t M>
29454``[link beast.ref.boost__beast__static_string.static_string.overload9 static_string]``(
29455    static_string< M, CharT, Traits > const& other);
29456  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.static_string.overload9 `more...`]]``
29457```
29458
29459
29460Construct from an initializer list.
29461```
29462``[link beast.ref.boost__beast__static_string.static_string.overload10 static_string]``(
29463    std::initializer_list< CharT > init);
29464  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.static_string.overload10 `more...`]]``
29465```
29466
29467
29468Construct from a `string_view`
29469```
29470explicit
29471``[link beast.ref.boost__beast__static_string.static_string.overload11 static_string]``(
29472    string_view_type sv);
29473  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.static_string.overload11 `more...`]]``
29474```
29475
29476
29477Construct from any object convertible to `string_view_type`.
29478```
29479template<
29480    class T>
29481``[link beast.ref.boost__beast__static_string.static_string.overload12 static_string]``(
29482    T const& t,
29483    size_type pos,
29484    size_type n);
29485  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.static_string.overload12 `more...`]]``
29486```
29487
29488[section:overload1 static_string::static_string (1 of 12 overloads)]
29489
29490Default constructor (empty string).
29491[heading Synopsis]
29492```
29493static_string();
29494```
29495
29496[heading Description]
29497
29498[endsect]
29499
29500[section:overload2 static_string::static_string (2 of 12 overloads)]
29501
29502Construct with count copies of character `ch`.
29503[heading Synopsis]
29504```
29505static_string(
29506    size_type count,
29507    CharT ch);
29508```
29509
29510[heading Description]
29511The behavior is undefined if `count >= npos`
29512
29513[endsect]
29514
29515[section:overload3 static_string::static_string (3 of 12 overloads)]
29516
29517Construct with a substring (pos, other.size()) of `other`.
29518[heading Synopsis]
29519```
29520template<
29521    std::size_t M>
29522static_string(
29523    static_string< M, CharT, Traits > const& other,
29524    size_type pos);
29525```
29526
29527[heading Description]
29528
29529[endsect]
29530
29531[section:overload4 static_string::static_string (4 of 12 overloads)]
29532
29533Construct with a substring (pos, count) of `other`.
29534[heading Synopsis]
29535```
29536template<
29537    std::size_t M>
29538static_string(
29539    static_string< M, CharT, Traits > const& other,
29540    size_type pos,
29541    size_type count);
29542```
29543
29544[heading Description]
29545
29546[endsect]
29547
29548[section:overload5 static_string::static_string (5 of 12 overloads)]
29549
29550Construct with the first `count` characters of `s`, including nulls.
29551[heading Synopsis]
29552```
29553static_string(
29554    CharT const* s,
29555    size_type count);
29556```
29557
29558[heading Description]
29559
29560[endsect]
29561
29562[section:overload6 static_string::static_string (6 of 12 overloads)]
29563
29564Construct from a null terminated string.
29565[heading Synopsis]
29566```
29567static_string(
29568    CharT const* s);
29569```
29570
29571[heading Description]
29572
29573[endsect]
29574
29575[section:overload7 static_string::static_string (7 of 12 overloads)]
29576
29577Construct from a range of characters.
29578[heading Synopsis]
29579```
29580template<
29581    class InputIt>
29582static_string(
29583    InputIt first,
29584    InputIt last);
29585```
29586
29587[heading Description]
29588
29589[endsect]
29590
29591[section:overload8 static_string::static_string (8 of 12 overloads)]
29592
29593Copy constructor.
29594[heading Synopsis]
29595```
29596static_string(
29597    static_string const& other);
29598```
29599
29600[heading Description]
29601
29602[endsect]
29603
29604[section:overload9 static_string::static_string (9 of 12 overloads)]
29605
29606Copy constructor.
29607[heading Synopsis]
29608```
29609template<
29610    std::size_t M>
29611static_string(
29612    static_string< M, CharT, Traits > const& other);
29613```
29614
29615[heading Description]
29616
29617[endsect]
29618
29619[section:overload10 static_string::static_string (10 of 12 overloads)]
29620
29621Construct from an initializer list.
29622[heading Synopsis]
29623```
29624static_string(
29625    std::initializer_list< CharT > init);
29626```
29627
29628[heading Description]
29629
29630[endsect]
29631
29632[section:overload11 static_string::static_string (11 of 12 overloads)]
29633
29634Construct from a `string_view`
29635[heading Synopsis]
29636```
29637static_string(
29638    string_view_type sv);
29639```
29640
29641[heading Description]
29642
29643[endsect]
29644
29645[section:overload12 static_string::static_string (12 of 12 overloads)]
29646
29647Construct from any object convertible to `string_view_type`.
29648[heading Synopsis]
29649```
29650template<
29651    class T>
29652static_string(
29653    T const& t,
29654    size_type pos,
29655    size_type n);
29656```
29657
29658[heading Description]
29659The range (pos, n) is extracted from the value obtained by converting `t` to `string_view_type`, and used to construct the string.
29660
29661[endsect]
29662
29663
29664[endsect]
29665
29666[section:operator_eq_ static_string::operator=]
29667[indexterm2 operator=..static_string]
29668
29669
29670Copy assignment.
29671```
29672static_string&
29673``[link beast.ref.boost__beast__static_string.operator_eq_.overload1 operator=]``(
29674    static_string const& str);
29675  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_eq_.overload1 `more...`]]``
29676
29677template<
29678    std::size_t M>
29679static_string&
29680``[link beast.ref.boost__beast__static_string.operator_eq_.overload2 operator=]``(
29681    static_string< M, CharT, Traits > const& str);
29682  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_eq_.overload2 `more...`]]``
29683```
29684
29685
29686Assign from null-terminated string.
29687```
29688static_string&
29689``[link beast.ref.boost__beast__static_string.operator_eq_.overload3 operator=]``(
29690    CharT const* s);
29691  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_eq_.overload3 `more...`]]``
29692```
29693
29694
29695Assign from single character.
29696```
29697static_string&
29698``[link beast.ref.boost__beast__static_string.operator_eq_.overload4 operator=]``(
29699    CharT ch);
29700  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_eq_.overload4 `more...`]]``
29701```
29702
29703
29704Assign from initializer list.
29705```
29706static_string&
29707``[link beast.ref.boost__beast__static_string.operator_eq_.overload5 operator=]``(
29708    std::initializer_list< CharT > init);
29709  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_eq_.overload5 `more...`]]``
29710```
29711
29712
29713Assign from `string_view_type`.
29714```
29715static_string&
29716``[link beast.ref.boost__beast__static_string.operator_eq_.overload6 operator=]``(
29717    string_view_type sv);
29718  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_eq_.overload6 `more...`]]``
29719```
29720
29721[section:overload1 static_string::operator= (1 of 6 overloads)]
29722
29723Copy assignment.
29724[heading Synopsis]
29725```
29726static_string&
29727operator=(
29728    static_string const& str);
29729```
29730
29731[heading Description]
29732
29733[endsect]
29734
29735[section:overload2 static_string::operator= (2 of 6 overloads)]
29736
29737Copy assignment.
29738[heading Synopsis]
29739```
29740template<
29741    std::size_t M>
29742static_string&
29743operator=(
29744    static_string< M, CharT, Traits > const& str);
29745```
29746
29747[heading Description]
29748
29749[endsect]
29750
29751[section:overload3 static_string::operator= (3 of 6 overloads)]
29752
29753Assign from null-terminated string.
29754[heading Synopsis]
29755```
29756static_string&
29757operator=(
29758    CharT const* s);
29759```
29760
29761[heading Description]
29762
29763[endsect]
29764
29765[section:overload4 static_string::operator= (4 of 6 overloads)]
29766
29767Assign from single character.
29768[heading Synopsis]
29769```
29770static_string&
29771operator=(
29772    CharT ch);
29773```
29774
29775[heading Description]
29776
29777[endsect]
29778
29779[section:overload5 static_string::operator= (5 of 6 overloads)]
29780
29781Assign from initializer list.
29782[heading Synopsis]
29783```
29784static_string&
29785operator=(
29786    std::initializer_list< CharT > init);
29787```
29788
29789[heading Description]
29790
29791[endsect]
29792
29793[section:overload6 static_string::operator= (6 of 6 overloads)]
29794
29795Assign from `string_view_type`.
29796[heading Synopsis]
29797```
29798static_string&
29799operator=(
29800    string_view_type sv);
29801```
29802
29803[heading Description]
29804
29805[endsect]
29806
29807
29808[endsect]
29809
29810[section:assign static_string::assign]
29811[indexterm2 assign..static_string]
29812
29813
29814Assign `count` copies of `ch`.
29815```
29816static_string&
29817``[link beast.ref.boost__beast__static_string.assign.overload1 assign]``(
29818    size_type count,
29819    CharT ch);
29820  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.assign.overload1 `more...`]]``
29821```
29822
29823
29824Assign from another [link beast.ref.boost__beast__static_string `static_string`]
29825```
29826static_string&
29827``[link beast.ref.boost__beast__static_string.assign.overload2 assign]``(
29828    static_string const& str);
29829  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.assign.overload2 `more...`]]``
29830
29831template<
29832    std::size_t M>
29833static_string&
29834``[link beast.ref.boost__beast__static_string.assign.overload3 assign]``(
29835    static_string< M, CharT, Traits > const& str);
29836  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.assign.overload3 `more...`]]``
29837```
29838
29839
29840Assign `count` characterss starting at `npos` from `other`.
29841```
29842template<
29843    std::size_t M>
29844static_string&
29845``[link beast.ref.boost__beast__static_string.assign.overload4 assign]``(
29846    static_string< M, CharT, Traits > const& str,
29847    size_type pos,
29848    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
29849  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.assign.overload4 `more...`]]``
29850```
29851
29852
29853Assign the first `count` characters of `s`, including nulls.
29854```
29855static_string&
29856``[link beast.ref.boost__beast__static_string.assign.overload5 assign]``(
29857    CharT const* s,
29858    size_type count);
29859  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.assign.overload5 `more...`]]``
29860```
29861
29862
29863Assign a null terminated string.
29864```
29865static_string&
29866``[link beast.ref.boost__beast__static_string.assign.overload6 assign]``(
29867    CharT const* s);
29868  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.assign.overload6 `more...`]]``
29869```
29870
29871
29872Assign from an iterator range of characters.
29873```
29874template<
29875    class InputIt>
29876static_string&
29877``[link beast.ref.boost__beast__static_string.assign.overload7 assign]``(
29878    InputIt first,
29879    InputIt last);
29880  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.assign.overload7 `more...`]]``
29881```
29882
29883
29884Assign from initializer list.
29885```
29886static_string&
29887``[link beast.ref.boost__beast__static_string.assign.overload8 assign]``(
29888    std::initializer_list< CharT > init);
29889  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.assign.overload8 `more...`]]``
29890```
29891
29892
29893Assign from `string_view_type`.
29894```
29895static_string&
29896``[link beast.ref.boost__beast__static_string.assign.overload9 assign]``(
29897    string_view_type str);
29898  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.assign.overload9 `more...`]]``
29899```
29900
29901
29902Assign from any object convertible to `string_view_type`.
29903```
29904template<
29905    class T>
29906static_string&
29907``[link beast.ref.boost__beast__static_string.assign.overload10 assign]``(
29908    T const& t,
29909    size_type pos,
29910    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
29911  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.assign.overload10 `more...`]]``
29912```
29913
29914[section:overload1 static_string::assign (1 of 10 overloads)]
29915
29916Assign `count` copies of `ch`.
29917[heading Synopsis]
29918```
29919static_string&
29920assign(
29921    size_type count,
29922    CharT ch);
29923```
29924
29925[heading Description]
29926
29927[endsect]
29928
29929[section:overload2 static_string::assign (2 of 10 overloads)]
29930
29931Assign from another [link beast.ref.boost__beast__static_string `static_string`]
29932[heading Synopsis]
29933```
29934static_string&
29935assign(
29936    static_string const& str);
29937```
29938
29939[heading Description]
29940
29941[endsect]
29942
29943[section:overload3 static_string::assign (3 of 10 overloads)]
29944
29945Assign from another [link beast.ref.boost__beast__static_string `static_string`]
29946[heading Synopsis]
29947```
29948template<
29949    std::size_t M>
29950static_string&
29951assign(
29952    static_string< M, CharT, Traits > const& str);
29953```
29954
29955[heading Description]
29956
29957[endsect]
29958
29959[section:overload4 static_string::assign (4 of 10 overloads)]
29960
29961Assign `count` characterss starting at `npos` from `other`.
29962[heading Synopsis]
29963```
29964template<
29965    std::size_t M>
29966static_string&
29967assign(
29968    static_string< M, CharT, Traits > const& str,
29969    size_type pos,
29970    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
29971```
29972
29973[heading Description]
29974
29975[endsect]
29976
29977[section:overload5 static_string::assign (5 of 10 overloads)]
29978
29979Assign the first `count` characters of `s`, including nulls.
29980[heading Synopsis]
29981```
29982static_string&
29983assign(
29984    CharT const* s,
29985    size_type count);
29986```
29987
29988[heading Description]
29989
29990[endsect]
29991
29992[section:overload6 static_string::assign (6 of 10 overloads)]
29993
29994Assign a null terminated string.
29995[heading Synopsis]
29996```
29997static_string&
29998assign(
29999    CharT const* s);
30000```
30001
30002[heading Description]
30003
30004[endsect]
30005
30006[section:overload7 static_string::assign (7 of 10 overloads)]
30007
30008Assign from an iterator range of characters.
30009[heading Synopsis]
30010```
30011template<
30012    class InputIt>
30013static_string&
30014assign(
30015    InputIt first,
30016    InputIt last);
30017```
30018
30019[heading Description]
30020
30021[endsect]
30022
30023[section:overload8 static_string::assign (8 of 10 overloads)]
30024
30025Assign from initializer list.
30026[heading Synopsis]
30027```
30028static_string&
30029assign(
30030    std::initializer_list< CharT > init);
30031```
30032
30033[heading Description]
30034
30035[endsect]
30036
30037[section:overload9 static_string::assign (9 of 10 overloads)]
30038
30039Assign from `string_view_type`.
30040[heading Synopsis]
30041```
30042static_string&
30043assign(
30044    string_view_type str);
30045```
30046
30047[heading Description]
30048
30049[endsect]
30050
30051[section:overload10 static_string::assign (10 of 10 overloads)]
30052
30053Assign from any object convertible to `string_view_type`.
30054[heading Synopsis]
30055```
30056template<
30057    class T>
30058static_string&
30059assign(
30060    T const& t,
30061    size_type pos,
30062    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
30063```
30064
30065[heading Description]
30066The range (pos, n) is extracted from the value obtained by converting `t` to `string_view_type`, and used to assign the string.
30067
30068[endsect]
30069
30070
30071[endsect]
30072
30073[section:at static_string::at]
30074[indexterm2 at..static_string]
30075
30076
30077Access specified character with bounds checking.
30078```
30079reference
30080``[link beast.ref.boost__beast__static_string.at.overload1 at]``(
30081    size_type pos);
30082  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.at.overload1 `more...`]]``
30083
30084const_reference
30085``[link beast.ref.boost__beast__static_string.at.overload2 at]``(
30086    size_type pos) const;
30087  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.at.overload2 `more...`]]``
30088```
30089
30090[section:overload1 static_string::at (1 of 2 overloads)]
30091
30092Access specified character with bounds checking.
30093[heading Synopsis]
30094```
30095reference
30096at(
30097    size_type pos);
30098```
30099
30100[heading Description]
30101
30102[endsect]
30103
30104[section:overload2 static_string::at (2 of 2 overloads)]
30105
30106Access specified character with bounds checking.
30107[heading Synopsis]
30108```
30109const_reference
30110at(
30111    size_type pos) const;
30112```
30113
30114[heading Description]
30115
30116[endsect]
30117
30118
30119[endsect]
30120
30121[section:operator_lb__rb_ static_string::operator\[\]]
30122[indexterm2 operator\[\]..static_string]
30123
30124
30125Access specified character.
30126```
30127reference
30128``[link beast.ref.boost__beast__static_string.operator_lb__rb_.overload1 operator\[\]]``(
30129    size_type pos);
30130  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_lb__rb_.overload1 `more...`]]``
30131
30132const_reference
30133``[link beast.ref.boost__beast__static_string.operator_lb__rb_.overload2 operator\[\]]``(
30134    size_type pos) const;
30135  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_lb__rb_.overload2 `more...`]]``
30136```
30137
30138[section:overload1 static_string::operator\[\] (1 of 2 overloads)]
30139
30140Access specified character.
30141[heading Synopsis]
30142```
30143reference
30144operator[](
30145    size_type pos);
30146```
30147
30148[heading Description]
30149
30150[endsect]
30151
30152[section:overload2 static_string::operator\[\] (2 of 2 overloads)]
30153
30154Access specified character.
30155[heading Synopsis]
30156```
30157const_reference
30158operator[](
30159    size_type pos) const;
30160```
30161
30162[heading Description]
30163
30164[endsect]
30165
30166
30167[endsect]
30168
30169[section:front static_string::front]
30170[indexterm2 front..static_string]
30171
30172
30173Accesses the first character.
30174```
30175CharT&
30176``[link beast.ref.boost__beast__static_string.front.overload1 front]``();
30177  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.front.overload1 `more...`]]``
30178
30179CharT const&
30180``[link beast.ref.boost__beast__static_string.front.overload2 front]``() const;
30181  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.front.overload2 `more...`]]``
30182```
30183
30184[section:overload1 static_string::front (1 of 2 overloads)]
30185
30186Accesses the first character.
30187[heading Synopsis]
30188```
30189CharT&
30190front();
30191```
30192
30193[heading Description]
30194
30195[endsect]
30196
30197[section:overload2 static_string::front (2 of 2 overloads)]
30198
30199Accesses the first character.
30200[heading Synopsis]
30201```
30202CharT const&
30203front() const;
30204```
30205
30206[heading Description]
30207
30208[endsect]
30209
30210
30211[endsect]
30212
30213[section:back static_string::back]
30214[indexterm2 back..static_string]
30215
30216
30217Accesses the last character.
30218```
30219CharT&
30220``[link beast.ref.boost__beast__static_string.back.overload1 back]``();
30221  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.back.overload1 `more...`]]``
30222
30223CharT const&
30224``[link beast.ref.boost__beast__static_string.back.overload2 back]``() const;
30225  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.back.overload2 `more...`]]``
30226```
30227
30228[section:overload1 static_string::back (1 of 2 overloads)]
30229
30230Accesses the last character.
30231[heading Synopsis]
30232```
30233CharT&
30234back();
30235```
30236
30237[heading Description]
30238
30239[endsect]
30240
30241[section:overload2 static_string::back (2 of 2 overloads)]
30242
30243Accesses the last character.
30244[heading Synopsis]
30245```
30246CharT const&
30247back() const;
30248```
30249
30250[heading Description]
30251
30252[endsect]
30253
30254
30255[endsect]
30256
30257[section:data static_string::data]
30258[indexterm2 data..static_string]
30259
30260
30261Returns a pointer to the first character of a string.
30262```
30263CharT*
30264``[link beast.ref.boost__beast__static_string.data.overload1 data]``();
30265  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.data.overload1 `more...`]]``
30266
30267CharT const*
30268``[link beast.ref.boost__beast__static_string.data.overload2 data]``() const;
30269  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.data.overload2 `more...`]]``
30270```
30271
30272[section:overload1 static_string::data (1 of 2 overloads)]
30273
30274Returns a pointer to the first character of a string.
30275[heading Synopsis]
30276```
30277CharT*
30278data();
30279```
30280
30281[heading Description]
30282
30283[endsect]
30284
30285[section:overload2 static_string::data (2 of 2 overloads)]
30286
30287Returns a pointer to the first character of a string.
30288[heading Synopsis]
30289```
30290CharT const*
30291data() const;
30292```
30293
30294[heading Description]
30295
30296[endsect]
30297
30298
30299[endsect]
30300
30301[section:c_str static_string::c_str]
30302[indexterm2 c_str..static_string]
30303
30304
30305Returns a non-modifiable standard C character array version of the string.
30306[heading Synopsis]
30307```
30308CharT const*
30309c_str() const;
30310```
30311
30312[heading Description]
30313
30314[endsect]
30315
30316[section:operator_string_view_type static_string::operator string_view_type]
30317[indexterm2 operator string_view_type..static_string]
30318
30319
30320Convert a static string to a `string_view_type`
30321[heading Synopsis]
30322```
30323operator string_view_type() const;
30324```
30325
30326[heading Description]
30327
30328[endsect]
30329
30330[section:begin static_string::begin]
30331[indexterm2 begin..static_string]
30332
30333
30334Returns an iterator to the beginning.
30335```
30336iterator
30337``[link beast.ref.boost__beast__static_string.begin.overload1 begin]``();
30338  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.begin.overload1 `more...`]]``
30339
30340const_iterator
30341``[link beast.ref.boost__beast__static_string.begin.overload2 begin]``() const;
30342  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.begin.overload2 `more...`]]``
30343```
30344
30345[section:overload1 static_string::begin (1 of 2 overloads)]
30346
30347Returns an iterator to the beginning.
30348[heading Synopsis]
30349```
30350iterator
30351begin();
30352```
30353
30354[heading Description]
30355
30356[endsect]
30357
30358[section:overload2 static_string::begin (2 of 2 overloads)]
30359
30360Returns an iterator to the beginning.
30361[heading Synopsis]
30362```
30363const_iterator
30364begin() const;
30365```
30366
30367[heading Description]
30368
30369[endsect]
30370
30371
30372[endsect]
30373
30374[section:cbegin static_string::cbegin]
30375[indexterm2 cbegin..static_string]
30376
30377
30378Returns an iterator to the beginning.
30379[heading Synopsis]
30380```
30381const_iterator
30382cbegin() const;
30383```
30384
30385[heading Description]
30386
30387[endsect]
30388
30389[section:end static_string::end]
30390[indexterm2 end..static_string]
30391
30392
30393Returns an iterator to the end.
30394```
30395iterator
30396``[link beast.ref.boost__beast__static_string.end.overload1 end]``();
30397  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.end.overload1 `more...`]]``
30398
30399const_iterator
30400``[link beast.ref.boost__beast__static_string.end.overload2 end]``() const;
30401  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.end.overload2 `more...`]]``
30402```
30403
30404[section:overload1 static_string::end (1 of 2 overloads)]
30405
30406Returns an iterator to the end.
30407[heading Synopsis]
30408```
30409iterator
30410end();
30411```
30412
30413[heading Description]
30414
30415[endsect]
30416
30417[section:overload2 static_string::end (2 of 2 overloads)]
30418
30419Returns an iterator to the end.
30420[heading Synopsis]
30421```
30422const_iterator
30423end() const;
30424```
30425
30426[heading Description]
30427
30428[endsect]
30429
30430
30431[endsect]
30432
30433[section:cend static_string::cend]
30434[indexterm2 cend..static_string]
30435
30436
30437Returns an iterator to the end.
30438[heading Synopsis]
30439```
30440const_iterator
30441cend() const;
30442```
30443
30444[heading Description]
30445
30446[endsect]
30447
30448[section:rbegin static_string::rbegin]
30449[indexterm2 rbegin..static_string]
30450
30451
30452Returns a reverse iterator to the beginning.
30453```
30454reverse_iterator
30455``[link beast.ref.boost__beast__static_string.rbegin.overload1 rbegin]``();
30456  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.rbegin.overload1 `more...`]]``
30457
30458const_reverse_iterator
30459``[link beast.ref.boost__beast__static_string.rbegin.overload2 rbegin]``() const;
30460  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.rbegin.overload2 `more...`]]``
30461```
30462
30463[section:overload1 static_string::rbegin (1 of 2 overloads)]
30464
30465Returns a reverse iterator to the beginning.
30466[heading Synopsis]
30467```
30468reverse_iterator
30469rbegin();
30470```
30471
30472[heading Description]
30473
30474[endsect]
30475
30476[section:overload2 static_string::rbegin (2 of 2 overloads)]
30477
30478Returns a reverse iterator to the beginning.
30479[heading Synopsis]
30480```
30481const_reverse_iterator
30482rbegin() const;
30483```
30484
30485[heading Description]
30486
30487[endsect]
30488
30489
30490[endsect]
30491
30492[section:crbegin static_string::crbegin]
30493[indexterm2 crbegin..static_string]
30494
30495
30496Returns a reverse iterator to the beginning.
30497[heading Synopsis]
30498```
30499const_reverse_iterator
30500crbegin() const;
30501```
30502
30503[heading Description]
30504
30505[endsect]
30506
30507[section:rend static_string::rend]
30508[indexterm2 rend..static_string]
30509
30510
30511Returns a reverse iterator to the end.
30512```
30513reverse_iterator
30514``[link beast.ref.boost__beast__static_string.rend.overload1 rend]``();
30515  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.rend.overload1 `more...`]]``
30516
30517const_reverse_iterator
30518``[link beast.ref.boost__beast__static_string.rend.overload2 rend]``() const;
30519  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.rend.overload2 `more...`]]``
30520```
30521
30522[section:overload1 static_string::rend (1 of 2 overloads)]
30523
30524Returns a reverse iterator to the end.
30525[heading Synopsis]
30526```
30527reverse_iterator
30528rend();
30529```
30530
30531[heading Description]
30532
30533[endsect]
30534
30535[section:overload2 static_string::rend (2 of 2 overloads)]
30536
30537Returns a reverse iterator to the end.
30538[heading Synopsis]
30539```
30540const_reverse_iterator
30541rend() const;
30542```
30543
30544[heading Description]
30545
30546[endsect]
30547
30548
30549[endsect]
30550
30551[section:crend static_string::crend]
30552[indexterm2 crend..static_string]
30553
30554
30555Returns a reverse iterator to the end.
30556[heading Synopsis]
30557```
30558const_reverse_iterator
30559crend() const;
30560```
30561
30562[heading Description]
30563
30564[endsect]
30565
30566[section:empty static_string::empty]
30567[indexterm2 empty..static_string]
30568
30569
30570Returns `true` if the string is empty.
30571[heading Synopsis]
30572```
30573bool
30574empty() const;
30575```
30576
30577[heading Description]
30578
30579[endsect]
30580
30581[section:size static_string::size]
30582[indexterm2 size..static_string]
30583
30584
30585Returns the number of characters, excluding the null terminator.
30586[heading Synopsis]
30587```
30588size_type
30589size() const;
30590```
30591
30592[heading Description]
30593
30594[endsect]
30595
30596[section:length static_string::length]
30597[indexterm2 length..static_string]
30598
30599
30600Returns the number of characters, excluding the null terminator.
30601[heading Synopsis]
30602```
30603size_type
30604length() const;
30605```
30606
30607[heading Description]
30608
30609[endsect]
30610
30611[section:max_size static_string::max_size]
30612[indexterm2 max_size..static_string]
30613
30614
30615Returns the maximum number of characters that can be stored, excluding the null terminator.
30616[heading Synopsis]
30617```
30618size_type constexpr
30619max_size() const;
30620```
30621
30622[heading Description]
30623
30624[endsect]
30625
30626[section:reserve static_string::reserve]
30627[indexterm2 reserve..static_string]
30628
30629
30630Reserves storage.
30631[heading Synopsis]
30632```
30633void
30634reserve(
30635    std::size_t n);
30636```
30637
30638[heading Description]
30639This actually just throws an exception if `n > N`, otherwise does nothing since the storage is fixed.
30640
30641[endsect]
30642
30643[section:capacity static_string::capacity]
30644[indexterm2 capacity..static_string]
30645
30646
30647Returns the number of characters that can be held in currently allocated storage.
30648[heading Synopsis]
30649```
30650size_type constexpr
30651capacity() const;
30652```
30653
30654[heading Description]
30655
30656[endsect]
30657
30658[section:shrink_to_fit static_string::shrink_to_fit]
30659[indexterm2 shrink_to_fit..static_string]
30660
30661
30662Reduces memory usage by freeing unused memory.
30663[heading Synopsis]
30664```
30665void
30666shrink_to_fit();
30667```
30668
30669[heading Description]
30670This actually does nothing, since the storage is fixed.
30671
30672[endsect]
30673
30674[section:clear static_string::clear]
30675[indexterm2 clear..static_string]
30676
30677
30678Clears the contents.
30679[heading Synopsis]
30680```
30681void
30682clear();
30683```
30684
30685[heading Description]
30686
30687[endsect]
30688
30689[section:insert static_string::insert]
30690[indexterm2 insert..static_string]
30691
30692
30693```
30694static_string&
30695``[link beast.ref.boost__beast__static_string.insert.overload1 insert]``(
30696    size_type index,
30697    size_type count,
30698    CharT ch);
30699  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.insert.overload1 `more...`]]``
30700
30701static_string&
30702``[link beast.ref.boost__beast__static_string.insert.overload2 insert]``(
30703    size_type index,
30704    CharT const* s);
30705  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.insert.overload2 `more...`]]``
30706
30707static_string&
30708``[link beast.ref.boost__beast__static_string.insert.overload3 insert]``(
30709    size_type index,
30710    CharT const* s,
30711    size_type count);
30712  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.insert.overload3 `more...`]]``
30713
30714template<
30715    std::size_t M>
30716static_string&
30717``[link beast.ref.boost__beast__static_string.insert.overload4 insert]``(
30718    size_type index,
30719    static_string< M, CharT, Traits > const& str);
30720  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.insert.overload4 `more...`]]``
30721
30722template<
30723    std::size_t M>
30724static_string&
30725``[link beast.ref.boost__beast__static_string.insert.overload5 insert]``(
30726    size_type index,
30727    static_string< M, CharT, Traits > const& str,
30728    size_type index_str,
30729    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
30730  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.insert.overload5 `more...`]]``
30731
30732iterator
30733``[link beast.ref.boost__beast__static_string.insert.overload6 insert]``(
30734    const_iterator pos,
30735    CharT ch);
30736  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.insert.overload6 `more...`]]``
30737
30738iterator
30739``[link beast.ref.boost__beast__static_string.insert.overload7 insert]``(
30740    const_iterator pos,
30741    size_type count,
30742    CharT ch);
30743  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.insert.overload7 `more...`]]``
30744
30745template<
30746    class InputIt>
30747iterator
30748``[link beast.ref.boost__beast__static_string.insert.overload8 insert]``(
30749    const_iterator pos,
30750    InputIt first,
30751    InputIt last);
30752  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.insert.overload8 `more...`]]``
30753
30754iterator
30755``[link beast.ref.boost__beast__static_string.insert.overload9 insert]``(
30756    const_iterator pos,
30757    std::initializer_list< CharT > init);
30758  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.insert.overload9 `more...`]]``
30759
30760static_string&
30761``[link beast.ref.boost__beast__static_string.insert.overload10 insert]``(
30762    size_type index,
30763    string_view_type str);
30764  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.insert.overload10 `more...`]]``
30765
30766template<
30767    class T>
30768static_string&
30769``[link beast.ref.boost__beast__static_string.insert.overload11 insert]``(
30770    size_type index,
30771    T const& t,
30772    size_type index_str,
30773    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
30774  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.insert.overload11 `more...`]]``
30775```
30776
30777[section:overload1 static_string::insert (1 of 11 overloads)]
30778
30779[heading Synopsis]
30780```
30781static_string&
30782insert(
30783    size_type index,
30784    size_type count,
30785    CharT ch);
30786```
30787
30788[heading Description]
30789
30790[endsect]
30791
30792[section:overload2 static_string::insert (2 of 11 overloads)]
30793
30794[heading Synopsis]
30795```
30796static_string&
30797insert(
30798    size_type index,
30799    CharT const* s);
30800```
30801
30802[heading Description]
30803
30804[endsect]
30805
30806[section:overload3 static_string::insert (3 of 11 overloads)]
30807
30808[heading Synopsis]
30809```
30810static_string&
30811insert(
30812    size_type index,
30813    CharT const* s,
30814    size_type count);
30815```
30816
30817[heading Description]
30818
30819[endsect]
30820
30821[section:overload4 static_string::insert (4 of 11 overloads)]
30822
30823[heading Synopsis]
30824```
30825template<
30826    std::size_t M>
30827static_string&
30828insert(
30829    size_type index,
30830    static_string< M, CharT, Traits > const& str);
30831```
30832
30833[heading Description]
30834
30835[endsect]
30836
30837[section:overload5 static_string::insert (5 of 11 overloads)]
30838
30839[heading Synopsis]
30840```
30841template<
30842    std::size_t M>
30843static_string&
30844insert(
30845    size_type index,
30846    static_string< M, CharT, Traits > const& str,
30847    size_type index_str,
30848    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
30849```
30850
30851[heading Description]
30852
30853[endsect]
30854
30855[section:overload6 static_string::insert (6 of 11 overloads)]
30856
30857[heading Synopsis]
30858```
30859iterator
30860insert(
30861    const_iterator pos,
30862    CharT ch);
30863```
30864
30865[heading Description]
30866
30867[endsect]
30868
30869[section:overload7 static_string::insert (7 of 11 overloads)]
30870
30871[heading Synopsis]
30872```
30873iterator
30874insert(
30875    const_iterator pos,
30876    size_type count,
30877    CharT ch);
30878```
30879
30880[heading Description]
30881
30882[endsect]
30883
30884[section:overload8 static_string::insert (8 of 11 overloads)]
30885
30886[heading Synopsis]
30887```
30888template<
30889    class InputIt>
30890iterator
30891insert(
30892    const_iterator pos,
30893    InputIt first,
30894    InputIt last);
30895```
30896
30897[heading Description]
30898
30899[endsect]
30900
30901[section:overload9 static_string::insert (9 of 11 overloads)]
30902
30903[heading Synopsis]
30904```
30905iterator
30906insert(
30907    const_iterator pos,
30908    std::initializer_list< CharT > init);
30909```
30910
30911[heading Description]
30912
30913[endsect]
30914
30915[section:overload10 static_string::insert (10 of 11 overloads)]
30916
30917[heading Synopsis]
30918```
30919static_string&
30920insert(
30921    size_type index,
30922    string_view_type str);
30923```
30924
30925[heading Description]
30926
30927[endsect]
30928
30929[section:overload11 static_string::insert (11 of 11 overloads)]
30930
30931[heading Synopsis]
30932```
30933template<
30934    class T>
30935static_string&
30936insert(
30937    size_type index,
30938    T const& t,
30939    size_type index_str,
30940    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
30941```
30942
30943[heading Description]
30944
30945[endsect]
30946
30947
30948[endsect]
30949
30950[section:erase static_string::erase]
30951[indexterm2 erase..static_string]
30952
30953
30954```
30955static_string&
30956``[link beast.ref.boost__beast__static_string.erase.overload1 erase]``(
30957    size_type index = 0,
30958    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
30959  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.erase.overload1 `more...`]]``
30960
30961iterator
30962``[link beast.ref.boost__beast__static_string.erase.overload2 erase]``(
30963    const_iterator pos);
30964  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.erase.overload2 `more...`]]``
30965
30966iterator
30967``[link beast.ref.boost__beast__static_string.erase.overload3 erase]``(
30968    const_iterator first,
30969    const_iterator last);
30970  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.erase.overload3 `more...`]]``
30971```
30972
30973[section:overload1 static_string::erase (1 of 3 overloads)]
30974
30975[heading Synopsis]
30976```
30977static_string&
30978erase(
30979    size_type index = 0,
30980    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
30981```
30982
30983[heading Description]
30984
30985[endsect]
30986
30987[section:overload2 static_string::erase (2 of 3 overloads)]
30988
30989[heading Synopsis]
30990```
30991iterator
30992erase(
30993    const_iterator pos);
30994```
30995
30996[heading Description]
30997
30998[endsect]
30999
31000[section:overload3 static_string::erase (3 of 3 overloads)]
31001
31002[heading Synopsis]
31003```
31004iterator
31005erase(
31006    const_iterator first,
31007    const_iterator last);
31008```
31009
31010[heading Description]
31011
31012[endsect]
31013
31014
31015[endsect]
31016
31017[section:push_back static_string::push_back]
31018[indexterm2 push_back..static_string]
31019
31020
31021[heading Synopsis]
31022```
31023void
31024push_back(
31025    CharT ch);
31026```
31027
31028[heading Description]
31029
31030[endsect]
31031
31032[section:pop_back static_string::pop_back]
31033[indexterm2 pop_back..static_string]
31034
31035
31036[heading Synopsis]
31037```
31038void
31039pop_back();
31040```
31041
31042[heading Description]
31043
31044[endsect]
31045
31046[section:append static_string::append]
31047[indexterm2 append..static_string]
31048
31049
31050```
31051static_string&
31052``[link beast.ref.boost__beast__static_string.append.overload1 append]``(
31053    size_type count,
31054    CharT ch);
31055  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.append.overload1 `more...`]]``
31056
31057template<
31058    std::size_t M>
31059static_string&
31060``[link beast.ref.boost__beast__static_string.append.overload2 append]``(
31061    static_string< M, CharT, Traits > const& str);
31062  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.append.overload2 `more...`]]``
31063
31064template<
31065    std::size_t M>
31066static_string&
31067``[link beast.ref.boost__beast__static_string.append.overload3 append]``(
31068    static_string< M, CharT, Traits > const& str,
31069    size_type pos,
31070    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
31071  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.append.overload3 `more...`]]``
31072
31073static_string&
31074``[link beast.ref.boost__beast__static_string.append.overload4 append]``(
31075    CharT const* s,
31076    size_type count);
31077  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.append.overload4 `more...`]]``
31078
31079static_string&
31080``[link beast.ref.boost__beast__static_string.append.overload5 append]``(
31081    CharT const* s);
31082  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.append.overload5 `more...`]]``
31083
31084template<
31085    class InputIt>
31086static_string&
31087``[link beast.ref.boost__beast__static_string.append.overload6 append]``(
31088    InputIt first,
31089    InputIt last);
31090  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.append.overload6 `more...`]]``
31091
31092static_string&
31093``[link beast.ref.boost__beast__static_string.append.overload7 append]``(
31094    std::initializer_list< CharT > init);
31095  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.append.overload7 `more...`]]``
31096
31097static_string&
31098``[link beast.ref.boost__beast__static_string.append.overload8 append]``(
31099    string_view_type sv);
31100  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.append.overload8 `more...`]]``
31101
31102template<
31103    class T>
31104std::enable_if< std::is_convertible< T const &, string_view_type >::value &&! std::is_convertible< T const &, CharT const * >::value, static_string & >::type
31105``[link beast.ref.boost__beast__static_string.append.overload9 append]``(
31106    T const& t,
31107    size_type pos,
31108    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
31109  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.append.overload9 `more...`]]``
31110```
31111
31112[section:overload1 static_string::append (1 of 9 overloads)]
31113
31114[heading Synopsis]
31115```
31116static_string&
31117append(
31118    size_type count,
31119    CharT ch);
31120```
31121
31122[heading Description]
31123
31124[endsect]
31125
31126[section:overload2 static_string::append (2 of 9 overloads)]
31127
31128[heading Synopsis]
31129```
31130template<
31131    std::size_t M>
31132static_string&
31133append(
31134    static_string< M, CharT, Traits > const& str);
31135```
31136
31137[heading Description]
31138
31139[endsect]
31140
31141[section:overload3 static_string::append (3 of 9 overloads)]
31142
31143[heading Synopsis]
31144```
31145template<
31146    std::size_t M>
31147static_string&
31148append(
31149    static_string< M, CharT, Traits > const& str,
31150    size_type pos,
31151    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
31152```
31153
31154[heading Description]
31155
31156[endsect]
31157
31158[section:overload4 static_string::append (4 of 9 overloads)]
31159
31160[heading Synopsis]
31161```
31162static_string&
31163append(
31164    CharT const* s,
31165    size_type count);
31166```
31167
31168[heading Description]
31169
31170[endsect]
31171
31172[section:overload5 static_string::append (5 of 9 overloads)]
31173
31174[heading Synopsis]
31175```
31176static_string&
31177append(
31178    CharT const* s);
31179```
31180
31181[heading Description]
31182
31183[endsect]
31184
31185[section:overload6 static_string::append (6 of 9 overloads)]
31186
31187[heading Synopsis]
31188```
31189template<
31190    class InputIt>
31191static_string&
31192append(
31193    InputIt first,
31194    InputIt last);
31195```
31196
31197[heading Description]
31198
31199[endsect]
31200
31201[section:overload7 static_string::append (7 of 9 overloads)]
31202
31203[heading Synopsis]
31204```
31205static_string&
31206append(
31207    std::initializer_list< CharT > init);
31208```
31209
31210[heading Description]
31211
31212[endsect]
31213
31214[section:overload8 static_string::append (8 of 9 overloads)]
31215
31216[heading Synopsis]
31217```
31218static_string&
31219append(
31220    string_view_type sv);
31221```
31222
31223[heading Description]
31224
31225[endsect]
31226
31227[section:overload9 static_string::append (9 of 9 overloads)]
31228
31229[heading Synopsis]
31230```
31231template<
31232    class T>
31233std::enable_if< std::is_convertible< T const &, string_view_type >::value &&! std::is_convertible< T const &, CharT const * >::value, static_string & >::type
31234append(
31235    T const& t,
31236    size_type pos,
31237    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``);
31238```
31239
31240[heading Description]
31241
31242[endsect]
31243
31244
31245[endsect]
31246
31247[section:operator_plus__eq_ static_string::operator+=]
31248[indexterm2 operator+=..static_string]
31249
31250
31251```
31252template<
31253    std::size_t M>
31254static_string&
31255``[link beast.ref.boost__beast__static_string.operator_plus__eq_.overload1 operator+=]``(
31256    static_string< M, CharT, Traits > const& str);
31257  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_plus__eq_.overload1 `more...`]]``
31258
31259static_string&
31260``[link beast.ref.boost__beast__static_string.operator_plus__eq_.overload2 operator+=]``(
31261    CharT ch);
31262  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_plus__eq_.overload2 `more...`]]``
31263
31264static_string&
31265``[link beast.ref.boost__beast__static_string.operator_plus__eq_.overload3 operator+=]``(
31266    CharT const* s);
31267  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_plus__eq_.overload3 `more...`]]``
31268
31269static_string&
31270``[link beast.ref.boost__beast__static_string.operator_plus__eq_.overload4 operator+=]``(
31271    std::initializer_list< CharT > init);
31272  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_plus__eq_.overload4 `more...`]]``
31273
31274static_string&
31275``[link beast.ref.boost__beast__static_string.operator_plus__eq_.overload5 operator+=]``(
31276    string_view_type const& str);
31277  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.operator_plus__eq_.overload5 `more...`]]``
31278```
31279
31280[section:overload1 static_string::operator+= (1 of 5 overloads)]
31281
31282[heading Synopsis]
31283```
31284template<
31285    std::size_t M>
31286static_string&
31287operator+=(
31288    static_string< M, CharT, Traits > const& str);
31289```
31290
31291[heading Description]
31292
31293[endsect]
31294
31295[section:overload2 static_string::operator+= (2 of 5 overloads)]
31296
31297[heading Synopsis]
31298```
31299static_string&
31300operator+=(
31301    CharT ch);
31302```
31303
31304[heading Description]
31305
31306[endsect]
31307
31308[section:overload3 static_string::operator+= (3 of 5 overloads)]
31309
31310[heading Synopsis]
31311```
31312static_string&
31313operator+=(
31314    CharT const* s);
31315```
31316
31317[heading Description]
31318
31319[endsect]
31320
31321[section:overload4 static_string::operator+= (4 of 5 overloads)]
31322
31323[heading Synopsis]
31324```
31325static_string&
31326operator+=(
31327    std::initializer_list< CharT > init);
31328```
31329
31330[heading Description]
31331
31332[endsect]
31333
31334[section:overload5 static_string::operator+= (5 of 5 overloads)]
31335
31336[heading Synopsis]
31337```
31338static_string&
31339operator+=(
31340    string_view_type const& str);
31341```
31342
31343[heading Description]
31344
31345[endsect]
31346
31347
31348[endsect]
31349
31350[section:compare static_string::compare]
31351[indexterm2 compare..static_string]
31352
31353
31354```
31355template<
31356    std::size_t M>
31357int
31358``[link beast.ref.boost__beast__static_string.compare.overload1 compare]``(
31359    static_string< M, CharT, Traits > const& str) const;
31360  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.compare.overload1 `more...`]]``
31361
31362template<
31363    std::size_t M>
31364int
31365``[link beast.ref.boost__beast__static_string.compare.overload2 compare]``(
31366    size_type pos1,
31367    size_type count1,
31368    static_string< M, CharT, Traits > const& str) const;
31369  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.compare.overload2 `more...`]]``
31370
31371template<
31372    std::size_t M>
31373int
31374``[link beast.ref.boost__beast__static_string.compare.overload3 compare]``(
31375    size_type pos1,
31376    size_type count1,
31377    static_string< M, CharT, Traits > const& str,
31378    size_type pos2,
31379    size_type count2 = ``[link beast.ref.boost__beast__static_string.npos npos]``) const;
31380  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.compare.overload3 `more...`]]``
31381
31382int
31383``[link beast.ref.boost__beast__static_string.compare.overload4 compare]``(
31384    CharT const* s) const;
31385  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.compare.overload4 `more...`]]``
31386
31387int
31388``[link beast.ref.boost__beast__static_string.compare.overload5 compare]``(
31389    size_type pos1,
31390    size_type count1,
31391    CharT const* s) const;
31392  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.compare.overload5 `more...`]]``
31393
31394int
31395``[link beast.ref.boost__beast__static_string.compare.overload6 compare]``(
31396    size_type pos1,
31397    size_type count1,
31398    CharT const* s,
31399    size_type count2) const;
31400  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.compare.overload6 `more...`]]``
31401
31402int
31403``[link beast.ref.boost__beast__static_string.compare.overload7 compare]``(
31404    string_view_type str) const;
31405  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.compare.overload7 `more...`]]``
31406
31407int
31408``[link beast.ref.boost__beast__static_string.compare.overload8 compare]``(
31409    size_type pos1,
31410    size_type count1,
31411    string_view_type str) const;
31412  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.compare.overload8 `more...`]]``
31413
31414template<
31415    class T>
31416int
31417``[link beast.ref.boost__beast__static_string.compare.overload9 compare]``(
31418    size_type pos1,
31419    size_type count1,
31420    T const& t,
31421    size_type pos2,
31422    size_type count2 = ``[link beast.ref.boost__beast__static_string.npos npos]``) const;
31423  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.compare.overload9 `more...`]]``
31424```
31425
31426[section:overload1 static_string::compare (1 of 9 overloads)]
31427
31428[heading Synopsis]
31429```
31430template<
31431    std::size_t M>
31432int
31433compare(
31434    static_string< M, CharT, Traits > const& str) const;
31435```
31436
31437[heading Description]
31438
31439[endsect]
31440
31441[section:overload2 static_string::compare (2 of 9 overloads)]
31442
31443[heading Synopsis]
31444```
31445template<
31446    std::size_t M>
31447int
31448compare(
31449    size_type pos1,
31450    size_type count1,
31451    static_string< M, CharT, Traits > const& str) const;
31452```
31453
31454[heading Description]
31455
31456[endsect]
31457
31458[section:overload3 static_string::compare (3 of 9 overloads)]
31459
31460[heading Synopsis]
31461```
31462template<
31463    std::size_t M>
31464int
31465compare(
31466    size_type pos1,
31467    size_type count1,
31468    static_string< M, CharT, Traits > const& str,
31469    size_type pos2,
31470    size_type count2 = ``[link beast.ref.boost__beast__static_string.npos npos]``) const;
31471```
31472
31473[heading Description]
31474
31475[endsect]
31476
31477[section:overload4 static_string::compare (4 of 9 overloads)]
31478
31479[heading Synopsis]
31480```
31481int
31482compare(
31483    CharT const* s) const;
31484```
31485
31486[heading Description]
31487
31488[endsect]
31489
31490[section:overload5 static_string::compare (5 of 9 overloads)]
31491
31492[heading Synopsis]
31493```
31494int
31495compare(
31496    size_type pos1,
31497    size_type count1,
31498    CharT const* s) const;
31499```
31500
31501[heading Description]
31502
31503[endsect]
31504
31505[section:overload6 static_string::compare (6 of 9 overloads)]
31506
31507[heading Synopsis]
31508```
31509int
31510compare(
31511    size_type pos1,
31512    size_type count1,
31513    CharT const* s,
31514    size_type count2) const;
31515```
31516
31517[heading Description]
31518
31519[endsect]
31520
31521[section:overload7 static_string::compare (7 of 9 overloads)]
31522
31523[heading Synopsis]
31524```
31525int
31526compare(
31527    string_view_type str) const;
31528```
31529
31530[heading Description]
31531
31532[endsect]
31533
31534[section:overload8 static_string::compare (8 of 9 overloads)]
31535
31536[heading Synopsis]
31537```
31538int
31539compare(
31540    size_type pos1,
31541    size_type count1,
31542    string_view_type str) const;
31543```
31544
31545[heading Description]
31546
31547[endsect]
31548
31549[section:overload9 static_string::compare (9 of 9 overloads)]
31550
31551[heading Synopsis]
31552```
31553template<
31554    class T>
31555int
31556compare(
31557    size_type pos1,
31558    size_type count1,
31559    T const& t,
31560    size_type pos2,
31561    size_type count2 = ``[link beast.ref.boost__beast__static_string.npos npos]``) const;
31562```
31563
31564[heading Description]
31565
31566[endsect]
31567
31568
31569[endsect]
31570
31571[section:substr static_string::substr]
31572[indexterm2 substr..static_string]
31573
31574
31575[heading Synopsis]
31576```
31577string_view_type
31578substr(
31579    size_type pos = 0,
31580    size_type count = ``[link beast.ref.boost__beast__static_string.npos npos]``) const;
31581```
31582
31583[heading Description]
31584
31585[endsect]
31586
31587[section:copy static_string::copy]
31588[indexterm2 copy..static_string]
31589
31590
31591Copy a substring (pos, pos+count) to character string pointed to by `dest`.
31592[heading Synopsis]
31593```
31594size_type
31595copy(
31596    CharT* dest,
31597    size_type count,
31598    size_type pos = 0) const;
31599```
31600
31601[heading Description]
31602
31603[endsect]
31604
31605[section:resize static_string::resize]
31606[indexterm2 resize..static_string]
31607
31608
31609Changes the number of characters stored.
31610```
31611void
31612``[link beast.ref.boost__beast__static_string.resize.overload1 resize]``(
31613    std::size_t n);
31614  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.resize.overload1 `more...`]]``
31615
31616void
31617``[link beast.ref.boost__beast__static_string.resize.overload2 resize]``(
31618    std::size_t n,
31619    CharT c);
31620  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.resize.overload2 `more...`]]``
31621```
31622
31623[section:overload1 static_string::resize (1 of 2 overloads)]
31624
31625Changes the number of characters stored.
31626[heading Synopsis]
31627```
31628void
31629resize(
31630    std::size_t n);
31631```
31632
31633[heading Description]
31634If the resulting string is larger, the new characters are uninitialized.
31635
31636[endsect]
31637
31638[section:overload2 static_string::resize (2 of 2 overloads)]
31639
31640Changes the number of characters stored.
31641[heading Synopsis]
31642```
31643void
31644resize(
31645    std::size_t n,
31646    CharT c);
31647```
31648
31649[heading Description]
31650If the resulting string is larger, the new characters are initialized to the value of `c`.
31651
31652[endsect]
31653
31654
31655[endsect]
31656
31657[section:swap static_string::swap]
31658[indexterm2 swap..static_string]
31659
31660
31661Exchange the contents of this string with another.
31662```
31663void
31664``[link beast.ref.boost__beast__static_string.swap.overload1 swap]``(
31665    static_string& str);
31666  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.swap.overload1 `more...`]]``
31667
31668template<
31669    std::size_t M>
31670void
31671``[link beast.ref.boost__beast__static_string.swap.overload2 swap]``(
31672    static_string< M, CharT, Traits >& str);
31673  ``[''''&raquo;''' [link beast.ref.boost__beast__static_string.swap.overload2 `more...`]]``
31674```
31675
31676[section:overload1 static_string::swap (1 of 2 overloads)]
31677
31678Exchange the contents of this string with another.
31679[heading Synopsis]
31680```
31681void
31682swap(
31683    static_string& str);
31684```
31685
31686[heading Description]
31687
31688[endsect]
31689
31690[section:overload2 static_string::swap (2 of 2 overloads)]
31691
31692Exchange the contents of this string with another.
31693[heading Synopsis]
31694```
31695template<
31696    std::size_t M>
31697void
31698swap(
31699    static_string< M, CharT, Traits >& str);
31700```
31701
31702[heading Description]
31703
31704[endsect]
31705
31706
31707[endsect]
31708
31709
31710[endsect]
31711
31712[section:boost__beast__websocket__stream websocket::stream]
31713
31714Provides message-oriented functionality using WebSocket.
31715[heading Synopsis]
31716Defined in header [include_file boost/beast/websocket/stream.hpp]
31717
31718```
31719template<
31720    class NextLayer,
31721    bool deflateSupported>
31722class stream
31723```
31724
31725[heading Types]
31726[table [[Name][Description]]
31727  [
31728    [[*[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]]
31729    ]
31730    [
31731
31732The type of the executor associated with the object.
31733    ]
31734  ]
31735  [
31736    [[*[link beast.ref.boost__beast__websocket__stream.is_deflate_supported is_deflate_supported]]
31737    ]
31738    [
31739
31740Indicates if the permessage-deflate extension is supported.
31741    ]
31742  ]
31743  [
31744    [[*[link beast.ref.boost__beast__websocket__stream.next_layer_type next_layer_type]]
31745    ]
31746    [
31747
31748The type of the next layer.
31749    ]
31750  ]
31751]
31752[heading Member Functions]
31753[table [[Name][Description]]
31754  [
31755    [[*[link beast.ref.boost__beast__websocket__stream.accept accept]]
31756    ]
31757    [
31758
31759Perform the WebSocket handshake in the server role.
31760
31761Read and respond to a WebSocket HTTP Upgrade request.
31762
31763Respond to a WebSocket HTTP Upgrade request.
31764    ]
31765  ]
31766  [
31767    [[*[link beast.ref.boost__beast__websocket__stream.async_accept async_accept]]
31768    ]
31769    [
31770
31771Perform the WebSocket handshake asynchronously in the server role.
31772    ]
31773  ]
31774  [
31775    [[*[link beast.ref.boost__beast__websocket__stream.async_close async_close]]
31776    ]
31777    [
31778
31779Send a websocket close control frame asynchronously.
31780    ]
31781  ]
31782  [
31783    [[*[link beast.ref.boost__beast__websocket__stream.async_handshake async_handshake]]
31784    ]
31785    [
31786
31787Perform the WebSocket handshake asynchronously in the client role.
31788    ]
31789  ]
31790  [
31791    [[*[link beast.ref.boost__beast__websocket__stream.async_ping async_ping]]
31792    ]
31793    [
31794
31795Send a websocket ping control frame asynchronously.
31796    ]
31797  ]
31798  [
31799    [[*[link beast.ref.boost__beast__websocket__stream.async_pong async_pong]]
31800    ]
31801    [
31802
31803Send a websocket pong control frame asynchronously.
31804    ]
31805  ]
31806  [
31807    [[*[link beast.ref.boost__beast__websocket__stream.async_read async_read]]
31808    ]
31809    [
31810
31811Read a complete message asynchronously.
31812    ]
31813  ]
31814  [
31815    [[*[link beast.ref.boost__beast__websocket__stream.async_read_some async_read_some]]
31816    ]
31817    [
31818
31819Read some message data asynchronously.
31820    ]
31821  ]
31822  [
31823    [[*[link beast.ref.boost__beast__websocket__stream.async_write async_write]]
31824    ]
31825    [
31826
31827Write a complete message asynchronously.
31828    ]
31829  ]
31830  [
31831    [[*[link beast.ref.boost__beast__websocket__stream.async_write_some async_write_some]]
31832    ]
31833    [
31834
31835Write some message data asynchronously.
31836    ]
31837  ]
31838  [
31839    [[*[link beast.ref.boost__beast__websocket__stream.auto_fragment auto_fragment]]
31840    ]
31841    [
31842
31843Set the automatic fragmentation option.
31844
31845Returns `true` if the automatic fragmentation option is set.
31846    ]
31847  ]
31848  [
31849    [[*[link beast.ref.boost__beast__websocket__stream.binary binary]]
31850    ]
31851    [
31852
31853Set the binary message write option.
31854
31855Returns `true` if the binary message write option is set.
31856    ]
31857  ]
31858  [
31859    [[*[link beast.ref.boost__beast__websocket__stream.close close]]
31860    ]
31861    [
31862
31863Send a websocket close control frame.
31864    ]
31865  ]
31866  [
31867    [[*[link beast.ref.boost__beast__websocket__stream.control_callback control_callback]]
31868    ]
31869    [
31870
31871Set a callback to be invoked on each incoming control frame.
31872
31873Reset the control frame callback.
31874    ]
31875  ]
31876  [
31877    [[*[link beast.ref.boost__beast__websocket__stream.get_executor get_executor]]
31878    ]
31879    [
31880
31881Get the executor associated with the object.
31882    ]
31883  ]
31884  [
31885    [[*[link beast.ref.boost__beast__websocket__stream.get_option get_option]]
31886    ]
31887    [
31888
31889
31890Get the permessage-deflate extension options.
31891    ]
31892  ]
31893  [
31894    [[*[link beast.ref.boost__beast__websocket__stream.got_binary got_binary]]
31895    ]
31896    [
31897
31898Returns `true` if the latest message data indicates binary.
31899    ]
31900  ]
31901  [
31902    [[*[link beast.ref.boost__beast__websocket__stream.got_text got_text]]
31903    ]
31904    [
31905
31906Returns `true` if the latest message data indicates text.
31907    ]
31908  ]
31909  [
31910    [[*[link beast.ref.boost__beast__websocket__stream.handshake handshake]]
31911    ]
31912    [
31913
31914Perform the WebSocket handshake in the client role.
31915    ]
31916  ]
31917  [
31918    [[*[link beast.ref.boost__beast__websocket__stream.is_message_done is_message_done]]
31919    ]
31920    [
31921
31922Returns `true` if the last completed read finished the current message.
31923    ]
31924  ]
31925  [
31926    [[*[link beast.ref.boost__beast__websocket__stream.is_open is_open]]
31927    ]
31928    [
31929
31930Returns `true` if the stream is open.
31931    ]
31932  ]
31933  [
31934    [[*[link beast.ref.boost__beast__websocket__stream.next_layer next_layer]]
31935    ]
31936    [
31937
31938Get a reference to the next layer.
31939    ]
31940  ]
31941  [
31942    [[*[link beast.ref.boost__beast__websocket__stream.operator_eq_ operator=]]
31943    ]
31944    [
31945
31946Move assignment (deleted)
31947    ]
31948  ]
31949  [
31950    [[*[link beast.ref.boost__beast__websocket__stream.ping ping]]
31951    ]
31952    [
31953
31954Send a websocket ping control frame.
31955    ]
31956  ]
31957  [
31958    [[*[link beast.ref.boost__beast__websocket__stream.pong pong]]
31959    ]
31960    [
31961
31962Send a websocket pong control frame.
31963    ]
31964  ]
31965  [
31966    [[*[link beast.ref.boost__beast__websocket__stream.read read]]
31967    ]
31968    [
31969
31970Read a complete message.
31971    ]
31972  ]
31973  [
31974    [[*[link beast.ref.boost__beast__websocket__stream.read_message_max read_message_max]]
31975    ]
31976    [
31977
31978Set the maximum incoming message size option.
31979
31980Returns the maximum incoming message size setting.
31981    ]
31982  ]
31983  [
31984    [[*[link beast.ref.boost__beast__websocket__stream.read_size_hint read_size_hint]]
31985    ]
31986    [
31987
31988Returns a suggested maximum buffer size for the next call to read.
31989    ]
31990  ]
31991  [
31992    [[*[link beast.ref.boost__beast__websocket__stream.read_some read_some]]
31993    ]
31994    [
31995
31996Read some message data.
31997    ]
31998  ]
31999  [
32000    [[*[link beast.ref.boost__beast__websocket__stream.reason reason]]
32001    ]
32002    [
32003
32004Returns the close reason received from the remote peer.
32005    ]
32006  ]
32007  [
32008    [[*[link beast.ref.boost__beast__websocket__stream.secure_prng secure_prng]]
32009    ]
32010    [
32011
32012Set whether the PRNG is cryptographically secure.
32013    ]
32014  ]
32015  [
32016    [[*[link beast.ref.boost__beast__websocket__stream.set_option set_option]]
32017    ]
32018    [
32019
32020
32021Set the permessage-deflate extension options.
32022    ]
32023  ]
32024  [
32025    [[*[link beast.ref.boost__beast__websocket__stream.stream stream]]
32026    ]
32027    [
32028
32029Constructor.
32030    ]
32031  ]
32032  [
32033    [[*[link beast.ref.boost__beast__websocket__stream.text text]]
32034    ]
32035    [
32036
32037Set the text message write option.
32038
32039Returns `true` if the text message write option is set.
32040    ]
32041  ]
32042  [
32043    [[*[link beast.ref.boost__beast__websocket__stream.write write]]
32044    ]
32045    [
32046
32047Write a complete message.
32048    ]
32049  ]
32050  [
32051    [[*[link beast.ref.boost__beast__websocket__stream.write_buffer_bytes write_buffer_bytes]]
32052    ]
32053    [
32054
32055Set the write buffer size option.
32056
32057Returns the size of the write buffer.
32058    ]
32059  ]
32060  [
32061    [[*[link beast.ref.boost__beast__websocket__stream.write_some write_some]]
32062    ]
32063    [
32064
32065Write some message data.
32066    ]
32067  ]
32068  [
32069    [[*[link beast.ref.boost__beast__websocket__stream._stream ~stream]]
32070    ]
32071    [
32072
32073Destructor.
32074    ]
32075  ]
32076]
32077[heading Description]
32078The [link beast.ref.boost__beast__websocket__stream `stream`] class template provides asynchronous and blocking message-oriented functionality necessary for clients and servers to utilize the WebSocket protocol.
32079For asynchronous operations, the application must ensure that they are are all performed within the same implicit or explicit strand.
32080
32081[heading Thread Safety]
32082
32083['Distinct]['objects:]Safe.
32084
32085
32086['Shared]['objects:]Unsafe. The application must also ensure that all asynchronous operations are performed within the same implicit or explicit strand.
32087[heading Example]
32088
32089To declare the [link beast.ref.boost__beast__websocket__stream `stream`] object with a [link beast.ref.boost__beast__tcp_stream `tcp_stream`] in a multi-threaded asynchronous program using a strand, you may write:
32090```
32091websocket::stream<tcp_stream> ws{net::make_strand(ioc)};
32092```
32093
32094Alternatively, for a single-threaded or synchronous application you may write:
32095```
32096websocket::stream<tcp_stream> ws(ioc);
32097```
32098
32099[heading Template Parameters]
32100[table [[Type][Description]]
32101  [
32102    [`NextLayer`
32103    ]
32104    [
32105The type representing the next layer, to which data will be read and written during operations. For synchronous operations, the type must support the ['SyncStream] concept. For asynchronous operations, the type must support the ['AsyncStream] concept.
32106    ]
32107  ]
32108  [
32109    [`deflateSupported`
32110    ]
32111    [
32112A `bool` indicating whether or not the stream will be capable of negotiating the permessage-deflate websocket extension. Note that even if this is set to `true`, the permessage deflate options (set by the caller at runtime) must still have the feature enabled for a successful negotiation to occur.
32113    ]
32114  ]
32115]
32116[heading Remarks]
32117A stream object must not be moved or destroyed while there are pending asynchronous operations associated with it.
32118[heading See Also]
32119
32120* [@https://tools.ietf.org/html/rfc6455#section-4.1 Websocket Opening Handshake Client Requirements (RFC6455)]
32121* [@https://tools.ietf.org/html/rfc6455#section-4.2 Websocket Opening Handshake Server Requirements (RFC6455)]
32122* [@https://tools.ietf.org/html/rfc6455#section-7.1.2 Websocket Closing Handshake (RFC6455)]
32123* [@https://tools.ietf.org/html/rfc6455#section-5.5.1 Websocket Close (RFC6455)]
32124* [@https://tools.ietf.org/html/rfc6455#section-5.5.2 WebSocket Ping (RFC6455)]
32125* [@https://tools.ietf.org/html/rfc6455#section-5.5.3 WebSocket Pong (RFC6455)]
32126* [@https://tools.ietf.org/html/rfc7230#section-5.4 Host field (RFC7230)]
32127* [@https://tools.ietf.org/html/rfc7230#section-3.1.1 request-target (RFC7230)]
32128* [@https://tools.ietf.org/html/rfc7230#section-5.3.1 origin-form (RFC7230)]
32129
32130
32131[section:is_deflate_supported websocket::stream::is_deflate_supported]
32132[indexterm2 is_deflate_supported..websocket::stream]
32133
32134
32135Indicates if the permessage-deflate extension is supported.
32136[heading Synopsis]
32137```
32138using is_deflate_supported = std::integral_constant< bool, deflateSupported >;
32139```
32140
32141[heading Description]
32142
32143[endsect]
32144
32145[section:next_layer_type websocket::stream::next_layer_type]
32146[indexterm2 next_layer_type..websocket::stream]
32147
32148
32149The type of the next layer.
32150[heading Synopsis]
32151```
32152using next_layer_type = typename std::remove_reference< NextLayer >::type;
32153```
32154
32155[heading Description]
32156
32157[endsect]
32158
32159[section:executor_type websocket::stream::executor_type]
32160[indexterm2 executor_type..websocket::stream]
32161
32162
32163The type of the executor associated with the object.
32164[heading Synopsis]
32165```
32166using executor_type = beast::executor_type< next_layer_type >;
32167```
32168
32169[heading Description]
32170
32171[endsect]
32172
32173[section:_stream websocket::stream::~stream]
32174[indexterm2 ~stream..websocket::stream]
32175
32176
32177Destructor.
32178[heading Synopsis]
32179```
32180~stream();
32181```
32182
32183[heading Description]
32184Destroys the stream and all associated resources.
32185
32186[heading Remarks]
32187A stream object must not be destroyed while there are pending asynchronous operations associated with it.
32188
32189[endsect]
32190
32191[section:stream websocket::stream::stream]
32192[indexterm2 stream..websocket::stream]
32193
32194
32195Constructor.
32196```
32197``[link beast.ref.boost__beast__websocket__stream.stream.overload1 stream]``(
32198    stream&&);
32199  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.stream.overload1 `more...`]]``
32200
32201template<
32202    class... Args>
32203explicit
32204``[link beast.ref.boost__beast__websocket__stream.stream.overload2 stream]``(
32205    Args&&... args);
32206  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.stream.overload2 `more...`]]``
32207```
32208
32209[section:overload1 websocket::stream::stream (1 of 2 overloads)]
32210
32211Constructor.
32212[heading Synopsis]
32213```
32214stream(
32215    stream&&);
32216```
32217
32218[heading Description]
32219If `NextLayer` is move constructible, this function will move-construct a new stream from the existing stream.
32220After the move, the only valid operation on the moved-from object is destruction.
32221
32222[endsect]
32223
32224[section:overload2 websocket::stream::stream (2 of 2 overloads)]
32225
32226Constructor.
32227[heading Synopsis]
32228```
32229template<
32230    class... Args>
32231stream(
32232    Args&&... args);
32233```
32234
32235[heading Description]
32236This constructor creates a websocket stream and initializes the next layer object.
32237
32238[heading Exceptions]
32239[table [[Type][Thrown On]]
32240  [
32241    [`Any`
32242    ]
32243    [
32244exceptions thrown by the NextLayer constructor.
32245    ]
32246  ]
32247]
32248[heading Parameters]
32249[table [[Name][Description]]
32250  [
32251    [`args`
32252    ]
32253    [
32254The arguments to be passed to initialize the next layer object. The arguments are forwarded to the next layer's constructor.
32255    ]
32256  ]
32257]
32258
32259[endsect]
32260
32261
32262[endsect]
32263
32264[section:operator_eq_ websocket::stream::operator=]
32265[indexterm2 operator=..websocket::stream]
32266
32267
32268Move assignment (deleted)
32269[heading Synopsis]
32270```
32271stream&
32272operator=(
32273    stream&&);
32274```
32275
32276[heading Description]
32277
32278[endsect]
32279
32280[section:get_executor websocket::stream::get_executor]
32281[indexterm2 get_executor..websocket::stream]
32282
32283
32284Get the executor associated with the object.
32285[heading Synopsis]
32286```
32287executor_type
32288get_executor();
32289```
32290
32291[heading Description]
32292This function may be used to obtain the executor object that the stream uses to dispatch handlers for asynchronous operations.
32293
32294[heading Return Value]
32295A copy of the executor that stream will use to dispatch handlers.
32296
32297[endsect]
32298
32299[section:next_layer websocket::stream::next_layer]
32300[indexterm2 next_layer..websocket::stream]
32301
32302
32303Get a reference to the next layer.
32304```
32305next_layer_type&
32306``[link beast.ref.boost__beast__websocket__stream.next_layer.overload1 next_layer]``();
32307  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.next_layer.overload1 `more...`]]``
32308
32309next_layer_type const&
32310``[link beast.ref.boost__beast__websocket__stream.next_layer.overload2 next_layer]``() const;
32311  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.next_layer.overload2 `more...`]]``
32312```
32313
32314[section:overload1 websocket::stream::next_layer (1 of 2 overloads)]
32315
32316Get a reference to the next layer.
32317[heading Synopsis]
32318```
32319next_layer_type&
32320next_layer();
32321```
32322
32323[heading Description]
32324This function returns a reference to the next layer in a stack of stream layers.
32325
32326[heading Return Value]
32327A reference to the next layer in the stack of stream layers.
32328
32329[endsect]
32330
32331[section:overload2 websocket::stream::next_layer (2 of 2 overloads)]
32332
32333Get a reference to the next layer.
32334[heading Synopsis]
32335```
32336next_layer_type const&
32337next_layer() const;
32338```
32339
32340[heading Description]
32341This function returns a reference to the next layer in a stack of stream layers.
32342
32343[heading Return Value]
32344A reference to the next layer in the stack of stream layers.
32345
32346[endsect]
32347
32348
32349[endsect]
32350
32351[section:is_open websocket::stream::is_open]
32352[indexterm2 is_open..websocket::stream]
32353
32354
32355Returns `true` if the stream is open.
32356[heading Synopsis]
32357```
32358bool
32359is_open() const;
32360```
32361
32362[heading Description]
32363The stream is open after a successful handshake, and when no error has occurred.
32364
32365[endsect]
32366
32367[section:got_binary websocket::stream::got_binary]
32368[indexterm2 got_binary..websocket::stream]
32369
32370
32371Returns `true` if the latest message data indicates binary.
32372[heading Synopsis]
32373```
32374bool
32375got_binary() const;
32376```
32377
32378[heading Description]
32379This function informs the caller of whether the last received message frame represents a message with the binary opcode.
32380If there is no last message frame, the return value is undefined.
32381
32382[endsect]
32383
32384[section:got_text websocket::stream::got_text]
32385[indexterm2 got_text..websocket::stream]
32386
32387
32388Returns `true` if the latest message data indicates text.
32389[heading Synopsis]
32390```
32391bool
32392got_text() const;
32393```
32394
32395[heading Description]
32396This function informs the caller of whether the last received message frame represents a message with the text opcode.
32397If there is no last message frame, the return value is undefined.
32398
32399[endsect]
32400
32401[section:is_message_done websocket::stream::is_message_done]
32402[indexterm2 is_message_done..websocket::stream]
32403
32404
32405Returns `true` if the last completed read finished the current message.
32406[heading Synopsis]
32407```
32408bool
32409is_message_done() const;
32410```
32411
32412[heading Description]
32413
32414[endsect]
32415
32416[section:reason websocket::stream::reason]
32417[indexterm2 reason..websocket::stream]
32418
32419
32420Returns the close reason received from the remote peer.
32421[heading Synopsis]
32422```
32423close_reason const&
32424reason() const;
32425```
32426
32427[heading Description]
32428This is only valid after a read completes with [link beast.ref.boost__beast__websocket__error `error::closed`].
32429
32430[endsect]
32431
32432[section:read_size_hint websocket::stream::read_size_hint]
32433[indexterm2 read_size_hint..websocket::stream]
32434
32435
32436Returns a suggested maximum buffer size for the next call to read.
32437```
32438std::size_t
32439``[link beast.ref.boost__beast__websocket__stream.read_size_hint.overload1 read_size_hint]``(
32440    std::size_t initial_size = +``[link beast.ref.boost__beast__websocket__stream.tcp_frame_size tcp_frame_size]``) const;
32441  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.read_size_hint.overload1 `more...`]]``
32442
32443template<
32444    class __DynamicBuffer__>
32445std::size_t
32446``[link beast.ref.boost__beast__websocket__stream.read_size_hint.overload2 read_size_hint]``(
32447    DynamicBuffer& buffer) const;
32448  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.read_size_hint.overload2 `more...`]]``
32449```
32450
32451[section:overload1 websocket::stream::read_size_hint (1 of 2 overloads)]
32452
32453Returns a suggested maximum buffer size for the next call to read.
32454[heading Synopsis]
32455```
32456std::size_t
32457read_size_hint(
32458    std::size_t initial_size = +``[link beast.ref.boost__beast__websocket__stream.tcp_frame_size tcp_frame_size]``) const;
32459```
32460
32461[heading Description]
32462This function returns a reasonable upper limit on the number of bytes for the size of the buffer passed in the next call to read. The number is determined by the state of the current frame and whether or not the permessage-deflate extension is enabled.
32463
32464[heading Parameters]
32465[table [[Name][Description]]
32466  [
32467    [`initial_size`
32468    ]
32469    [
32470A non-zero size representing the caller's desired buffer size for when there is no information which may be used to calculate a more specific value. For example, when reading the first frame header of a message.
32471    ]
32472  ]
32473]
32474
32475[endsect]
32476
32477[section:overload2 websocket::stream::read_size_hint (2 of 2 overloads)]
32478
32479Returns a suggested maximum buffer size for the next call to read.
32480[heading Synopsis]
32481```
32482template<
32483    class __DynamicBuffer__>
32484std::size_t
32485read_size_hint(
32486    DynamicBuffer& buffer) const;
32487```
32488
32489[heading Description]
32490This function returns a reasonable upper limit on the number of bytes for the size of the buffer passed in the next call to read. The number is determined by the state of the current frame and whether or not the permessage-deflate extension is enabled.
32491
32492[heading Parameters]
32493[table [[Name][Description]]
32494  [
32495    [`buffer`
32496    ]
32497    [
32498The buffer which will be used for reading. The implementation will query the buffer to obtain the optimum size of a subsequent call to `buffer.prepare` based on the state of the current frame, if any.
32499    ]
32500  ]
32501]
32502
32503[endsect]
32504
32505
32506[endsect]
32507
32508[section:get_option websocket::stream::get_option]
32509[indexterm2 get_option..websocket::stream]
32510
32511
32512```
32513template<
32514    class Option>
32515void
32516``[link beast.ref.boost__beast__websocket__stream.get_option.overload1 get_option]``(
32517    Option& opt);
32518  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.get_option.overload1 `more...`]]``
32519```
32520
32521
32522Get the permessage-deflate extension options.
32523```
32524void
32525``[link beast.ref.boost__beast__websocket__stream.get_option.overload2 get_option]``(
32526    permessage_deflate& o);
32527  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.get_option.overload2 `more...`]]``
32528```
32529
32530[section:overload1 websocket::stream::get_option (1 of 2 overloads)]
32531
32532[heading Synopsis]
32533```
32534template<
32535    class Option>
32536void
32537get_option(
32538    Option& opt);
32539```
32540
32541[heading Description]
32542
32543[endsect]
32544
32545[section:overload2 websocket::stream::get_option (2 of 2 overloads)]
32546
32547Get the permessage-deflate extension options.
32548[heading Synopsis]
32549```
32550void
32551get_option(
32552    permessage_deflate& o);
32553```
32554
32555[heading Description]
32556
32557[endsect]
32558
32559
32560[endsect]
32561
32562[section:set_option websocket::stream::set_option]
32563[indexterm2 set_option..websocket::stream]
32564
32565
32566```
32567template<
32568    class Option>
32569void
32570``[link beast.ref.boost__beast__websocket__stream.set_option.overload1 set_option]``(
32571    Option opt);
32572  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.set_option.overload1 `more...`]]``
32573```
32574
32575
32576Set the permessage-deflate extension options.
32577```
32578void
32579``[link beast.ref.boost__beast__websocket__stream.set_option.overload2 set_option]``(
32580    permessage_deflate const& o);
32581  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.set_option.overload2 `more...`]]``
32582```
32583
32584[section:overload1 websocket::stream::set_option (1 of 2 overloads)]
32585
32586[heading Synopsis]
32587```
32588template<
32589    class Option>
32590void
32591set_option(
32592    Option opt);
32593```
32594
32595[heading Description]
32596
32597[endsect]
32598
32599[section:overload2 websocket::stream::set_option (2 of 2 overloads)]
32600
32601Set the permessage-deflate extension options.
32602[heading Synopsis]
32603```
32604void
32605set_option(
32606    permessage_deflate const& o);
32607```
32608
32609[heading Description]
32610
32611[heading Exceptions]
32612[table [[Type][Thrown On]]
32613  [
32614    [`invalid_argument`
32615    ]
32616    [
32617if `deflateSupported == false`, and either `client_enable` or `server_enable` is `true`.
32618    ]
32619  ]
32620]
32621
32622[endsect]
32623
32624
32625[endsect]
32626
32627[section:auto_fragment websocket::stream::auto_fragment]
32628[indexterm2 auto_fragment..websocket::stream]
32629
32630
32631Set the automatic fragmentation option.
32632```
32633void
32634``[link beast.ref.boost__beast__websocket__stream.auto_fragment.overload1 auto_fragment]``(
32635    bool value);
32636  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.auto_fragment.overload1 `more...`]]``
32637```
32638
32639
32640Returns `true` if the automatic fragmentation option is set.
32641```
32642bool
32643``[link beast.ref.boost__beast__websocket__stream.auto_fragment.overload2 auto_fragment]``() const;
32644  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.auto_fragment.overload2 `more...`]]``
32645```
32646
32647[section:overload1 websocket::stream::auto_fragment (1 of 2 overloads)]
32648
32649Set the automatic fragmentation option.
32650[heading Synopsis]
32651```
32652void
32653auto_fragment(
32654    bool value);
32655```
32656
32657[heading Description]
32658Determines if outgoing message payloads are broken up into multiple pieces.
32659When the automatic fragmentation size is turned on, outgoing message payloads are broken up into multiple frames no larger than the write buffer size.
32660The default setting is to fragment messages.
32661
32662[heading Parameters]
32663[table [[Name][Description]]
32664  [
32665    [`value`
32666    ]
32667    [
32668A `bool` indicating if auto fragmentation should be on.
32669    ]
32670  ]
32671]
32672[heading Example]
32673
32674Setting the automatic fragmentation option:
32675```
32676ws.auto_fragment(true);
32677```
32678
32679
32680[endsect]
32681
32682[section:overload2 websocket::stream::auto_fragment (2 of 2 overloads)]
32683
32684Returns `true` if the automatic fragmentation option is set.
32685[heading Synopsis]
32686```
32687bool
32688auto_fragment() const;
32689```
32690
32691[heading Description]
32692
32693[endsect]
32694
32695
32696[endsect]
32697
32698[section:binary websocket::stream::binary]
32699[indexterm2 binary..websocket::stream]
32700
32701
32702Set the binary message write option.
32703```
32704void
32705``[link beast.ref.boost__beast__websocket__stream.binary.overload1 binary]``(
32706    bool value);
32707  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.binary.overload1 `more...`]]``
32708```
32709
32710
32711Returns `true` if the binary message write option is set.
32712```
32713bool
32714``[link beast.ref.boost__beast__websocket__stream.binary.overload2 binary]``() const;
32715  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.binary.overload2 `more...`]]``
32716```
32717
32718[section:overload1 websocket::stream::binary (1 of 2 overloads)]
32719
32720Set the binary message write option.
32721[heading Synopsis]
32722```
32723void
32724binary(
32725    bool value);
32726```
32727
32728[heading Description]
32729This controls whether or not outgoing message opcodes are set to binary or text. The setting is only applied at the start when a caller begins a new message. Changing the opcode after a message is started will only take effect after the current message being sent is complete.
32730The default setting is to send text messages.
32731
32732[heading Parameters]
32733[table [[Name][Description]]
32734  [
32735    [`value`
32736    ]
32737    [
32738`true` if outgoing messages should indicate binary, or `false` if they should indicate text.
32739    ]
32740  ]
32741]
32742[heading Example]
32743
32744Setting the message type to binary.
32745```
32746ws.binary(true);
32747```
32748
32749
32750[endsect]
32751
32752[section:overload2 websocket::stream::binary (2 of 2 overloads)]
32753
32754Returns `true` if the binary message write option is set.
32755[heading Synopsis]
32756```
32757bool
32758binary() const;
32759```
32760
32761[heading Description]
32762
32763[endsect]
32764
32765
32766[endsect]
32767
32768[section:control_callback websocket::stream::control_callback]
32769[indexterm2 control_callback..websocket::stream]
32770
32771
32772Set a callback to be invoked on each incoming control frame.
32773```
32774void
32775``[link beast.ref.boost__beast__websocket__stream.control_callback.overload1 control_callback]``(
32776    std::function< void(frame_type, string_view)> cb);
32777  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.control_callback.overload1 `more...`]]``
32778```
32779
32780
32781Reset the control frame callback.
32782```
32783void
32784``[link beast.ref.boost__beast__websocket__stream.control_callback.overload2 control_callback]``();
32785  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.control_callback.overload2 `more...`]]``
32786```
32787
32788[section:overload1 websocket::stream::control_callback (1 of 2 overloads)]
32789
32790Set a callback to be invoked on each incoming control frame.
32791[heading Synopsis]
32792```
32793void
32794control_callback(
32795    std::function< void(frame_type, string_view)> cb);
32796```
32797
32798[heading Description]
32799Sets the callback to be invoked whenever a ping, pong, or close control frame is received during a call to one of the following functions:
32800
32801* [link beast.ref.boost__beast__websocket__stream.read `beast::websocket::stream::read`]
32802* [link beast.ref.boost__beast__websocket__stream.read_some `beast::websocket::stream::read_some`]
32803* [link beast.ref.boost__beast__websocket__stream.async_read `beast::websocket::stream::async_read`]
32804* [link beast.ref.boost__beast__websocket__stream.async_read_some `beast::websocket::stream::async_read_some`]
32805
32806Unlike completion handlers, the callback will be invoked for each control frame during a call to any synchronous or asynchronous read function. The operation is passive, with no associated error code, and triggered by reads.
32807For close frames, the close reason code may be obtained by calling the function [link beast.ref.boost__beast__websocket__stream.reason `reason`].
32808
32809[heading Parameters]
32810[table [[Name][Description]]
32811  [
32812    [`cb`
32813    ]
32814    [
32815
32816The function object to call, which must be invocable with this equivalent signature:
32817```
32818void
32819callback(
32820    frame_type kind,       // The type of frame
32821    string_view payload    // The payload in the frame
32822);
32823```
32824
32825The implementation type-erases the callback which may require a dynamic allocation. To prevent the possibility of a dynamic allocation, use `std::ref` to wrap the callback. If the read operation which receives the control frame is an asynchronous operation, the callback will be invoked using the same method as that used to invoke the final handler.
32826    ]
32827  ]
32828]
32829[heading Remarks]
32830Incoming ping and close frames are automatically handled. Pings are responded to with pongs, and a close frame is responded to with a close frame leading to the closure of the stream. It is not necessary to manually send pings, pongs, or close frames from inside the control callback. Attempting to manually send a close frame from inside the control callback after receiving a close frame will result in undefined behavior.
32831
32832[endsect]
32833
32834[section:overload2 websocket::stream::control_callback (2 of 2 overloads)]
32835
32836Reset the control frame callback.
32837[heading Synopsis]
32838```
32839void
32840control_callback();
32841```
32842
32843[heading Description]
32844This function removes any previously set control frame callback.
32845
32846[endsect]
32847
32848
32849[endsect]
32850
32851[section:read_message_max websocket::stream::read_message_max]
32852[indexterm2 read_message_max..websocket::stream]
32853
32854
32855Set the maximum incoming message size option.
32856```
32857void
32858``[link beast.ref.boost__beast__websocket__stream.read_message_max.overload1 read_message_max]``(
32859    std::size_t amount);
32860  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.read_message_max.overload1 `more...`]]``
32861```
32862
32863
32864Returns the maximum incoming message size setting.
32865```
32866std::size_t
32867``[link beast.ref.boost__beast__websocket__stream.read_message_max.overload2 read_message_max]``() const;
32868  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.read_message_max.overload2 `more...`]]``
32869```
32870
32871[section:overload1 websocket::stream::read_message_max (1 of 2 overloads)]
32872
32873Set the maximum incoming message size option.
32874[heading Synopsis]
32875```
32876void
32877read_message_max(
32878    std::size_t amount);
32879```
32880
32881[heading Description]
32882Sets the largest permissible incoming message size. Message frame fields indicating a size that would bring the total message size over this limit will cause a protocol failure.
32883The default setting is 16 megabytes. A value of zero indicates a limit of the maximum value of a `std::uint64_t`.
32884
32885[heading Example]
32886
32887Setting the maximum read message size.
32888```
32889ws.read_message_max(65536);
32890```
32891
32892[heading Parameters]
32893[table [[Name][Description]]
32894  [
32895    [`amount`
32896    ]
32897    [
32898The limit on the size of incoming messages.
32899    ]
32900  ]
32901]
32902
32903[endsect]
32904
32905[section:overload2 websocket::stream::read_message_max (2 of 2 overloads)]
32906
32907Returns the maximum incoming message size setting.
32908[heading Synopsis]
32909```
32910std::size_t
32911read_message_max() const;
32912```
32913
32914[heading Description]
32915
32916[endsect]
32917
32918
32919[endsect]
32920
32921[section:secure_prng websocket::stream::secure_prng]
32922[indexterm2 secure_prng..websocket::stream]
32923
32924
32925Set whether the PRNG is cryptographically secure.
32926[heading Synopsis]
32927```
32928void
32929secure_prng(
32930    bool value);
32931```
32932
32933[heading Description]
32934This controls whether or not the source of pseudo-random numbers used to produce the masks required by the WebSocket protocol are of cryptographic quality. When the setting is `true`, a strong algorithm is used which cannot be guessed by observing outputs. When the setting is `false`, a much faster algorithm is used. Masking is only performed by streams operating in the client mode. For streams operating in the server mode, this setting has no effect. By default, newly constructed streams use a secure PRNG.
32935If the WebSocket stream is used with an encrypted SSL or TLS next layer, if it is known to the application that intermediate proxies are not vulnerable to cache poisoning, or if the application is designed such that an attacker cannot send arbitrary inputs to the stream interface, then the faster algorithm may be used.
32936For more information please consult the WebSocket protocol RFC.
32937
32938[heading Parameters]
32939[table [[Name][Description]]
32940  [
32941    [`value`
32942    ]
32943    [
32944`true` if the PRNG algorithm should be cryptographically secure.
32945    ]
32946  ]
32947]
32948
32949[endsect]
32950
32951[section:write_buffer_bytes websocket::stream::write_buffer_bytes]
32952[indexterm2 write_buffer_bytes..websocket::stream]
32953
32954
32955Set the write buffer size option.
32956```
32957void
32958``[link beast.ref.boost__beast__websocket__stream.write_buffer_bytes.overload1 write_buffer_bytes]``(
32959    std::size_t amount);
32960  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.write_buffer_bytes.overload1 `more...`]]``
32961```
32962
32963
32964Returns the size of the write buffer.
32965```
32966std::size_t
32967``[link beast.ref.boost__beast__websocket__stream.write_buffer_bytes.overload2 write_buffer_bytes]``() const;
32968  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.write_buffer_bytes.overload2 `more...`]]``
32969```
32970
32971[section:overload1 websocket::stream::write_buffer_bytes (1 of 2 overloads)]
32972
32973Set the write buffer size option.
32974[heading Synopsis]
32975```
32976void
32977write_buffer_bytes(
32978    std::size_t amount);
32979```
32980
32981[heading Description]
32982Sets the size of the write buffer used by the implementation to send frames. The write buffer is needed when masking payload data in the client role, compressing frames, or auto-fragmenting message data.
32983Lowering the size of the buffer can decrease the memory requirements for each connection, while increasing the size of the buffer can reduce the number of calls made to the next layer to write data.
32984The default setting is 4096. The minimum value is 8.
32985The write buffer size can only be changed when the stream is not open. Undefined behavior results if the option is modified after a successful WebSocket handshake.
32986
32987[heading Example]
32988
32989Setting the write buffer size.
32990```
32991ws.write_buffer_bytes(8192);
32992```
32993
32994[heading Parameters]
32995[table [[Name][Description]]
32996  [
32997    [`amount`
32998    ]
32999    [
33000The size of the write buffer in bytes.
33001    ]
33002  ]
33003]
33004
33005[endsect]
33006
33007[section:overload2 websocket::stream::write_buffer_bytes (2 of 2 overloads)]
33008
33009Returns the size of the write buffer.
33010[heading Synopsis]
33011```
33012std::size_t
33013write_buffer_bytes() const;
33014```
33015
33016[heading Description]
33017
33018[endsect]
33019
33020
33021[endsect]
33022
33023[section:text websocket::stream::text]
33024[indexterm2 text..websocket::stream]
33025
33026
33027Set the text message write option.
33028```
33029void
33030``[link beast.ref.boost__beast__websocket__stream.text.overload1 text]``(
33031    bool value);
33032  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.text.overload1 `more...`]]``
33033```
33034
33035
33036Returns `true` if the text message write option is set.
33037```
33038bool
33039``[link beast.ref.boost__beast__websocket__stream.text.overload2 text]``() const;
33040  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.text.overload2 `more...`]]``
33041```
33042
33043[section:overload1 websocket::stream::text (1 of 2 overloads)]
33044
33045Set the text message write option.
33046[heading Synopsis]
33047```
33048void
33049text(
33050    bool value);
33051```
33052
33053[heading Description]
33054This controls whether or not outgoing message opcodes are set to binary or text. The setting is only applied at the start when a caller begins a new message. Changing the opcode after a message is started will only take effect after the current message being sent is complete.
33055The default setting is to send text messages.
33056
33057[heading Parameters]
33058[table [[Name][Description]]
33059  [
33060    [`value`
33061    ]
33062    [
33063`true` if outgoing messages should indicate text, or `false` if they should indicate binary.
33064    ]
33065  ]
33066]
33067[heading Example]
33068
33069Setting the message type to text.
33070```
33071ws.text(true);
33072```
33073
33074
33075[endsect]
33076
33077[section:overload2 websocket::stream::text (2 of 2 overloads)]
33078
33079Returns `true` if the text message write option is set.
33080[heading Synopsis]
33081```
33082bool
33083text() const;
33084```
33085
33086[heading Description]
33087
33088[endsect]
33089
33090
33091[endsect]
33092
33093[section:handshake websocket::stream::handshake]
33094[indexterm2 handshake..websocket::stream]
33095
33096
33097Perform the WebSocket handshake in the client role.
33098```
33099void
33100``[link beast.ref.boost__beast__websocket__stream.handshake.overload1 handshake]``(
33101    string_view host,
33102    string_view target);
33103  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.handshake.overload1 `more...`]]``
33104
33105void
33106``[link beast.ref.boost__beast__websocket__stream.handshake.overload2 handshake]``(
33107    response_type& res,
33108    string_view host,
33109    string_view target);
33110  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.handshake.overload2 `more...`]]``
33111
33112void
33113``[link beast.ref.boost__beast__websocket__stream.handshake.overload3 handshake]``(
33114    string_view host,
33115    string_view target,
33116    error_code& ec);
33117  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.handshake.overload3 `more...`]]``
33118
33119void
33120``[link beast.ref.boost__beast__websocket__stream.handshake.overload4 handshake]``(
33121    response_type& res,
33122    string_view host,
33123    string_view target,
33124    error_code& ec);
33125  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.handshake.overload4 `more...`]]``
33126```
33127
33128[section:overload1 websocket::stream::handshake (1 of 4 overloads)]
33129
33130Perform the WebSocket handshake in the client role.
33131[heading Synopsis]
33132```
33133void
33134handshake(
33135    string_view host,
33136    string_view target);
33137```
33138
33139[heading Description]
33140This function is used to perform the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33141The call blocks until one of the following conditions is true:
33142
33143* The request is sent and the response is received.
33144
33145* An error occurs.
33146
33147The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
33148The handshake is successful if the received HTTP response indicates the upgrade was accepted by the server, represented by a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`].
33149
33150[heading Parameters]
33151[table [[Name][Description]]
33152  [
33153    [`host`
33154    ]
33155    [
33156The name of the remote host. This is required by the HTTP protocol to set the "Host" header field.
33157    ]
33158  ]
33159  [
33160    [`target`
33161    ]
33162    [
33163The request-target, in origin-form. The server may use the target to distinguish different services on the same listening port.
33164    ]
33165  ]
33166]
33167[heading Exceptions]
33168[table [[Type][Thrown On]]
33169  [
33170    [`system_error`
33171    ]
33172    [
33173Thrown on failure.
33174    ]
33175  ]
33176]
33177[heading Example]
33178
33179```
33180ws.handshake("localhost", "/");
33181```
33182
33183[heading See Also]
33184
33185* [@https://tools.ietf.org/html/rfc6455#section-4.1 Websocket Opening Handshake Client Requirements (RFC6455)]
33186* [@https://tools.ietf.org/html/rfc7230#section-5.4 Host field (RFC7230)]
33187* [@https://tools.ietf.org/html/rfc7230#section-3.1.1 request-target (RFC7230)]
33188* [@https://tools.ietf.org/html/rfc7230#section-5.3.1 origin-form (RFC7230)]
33189
33190
33191[endsect]
33192
33193[section:overload2 websocket::stream::handshake (2 of 4 overloads)]
33194
33195Perform the WebSocket handshake in the client role.
33196[heading Synopsis]
33197```
33198void
33199handshake(
33200    response_type& res,
33201    string_view host,
33202    string_view target);
33203```
33204
33205[heading Description]
33206This function is used to perform the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33207The call blocks until one of the following conditions is true:
33208
33209* The request is sent and the response is received.
33210
33211* An error occurs.
33212
33213The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
33214The handshake is successful if the received HTTP response indicates the upgrade was accepted by the server, represented by a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`].
33215
33216[heading Parameters]
33217[table [[Name][Description]]
33218  [
33219    [`res`
33220    ]
33221    [
33222The HTTP Upgrade response returned by the remote endpoint. The caller may use the response to access any additional information sent by the server.
33223    ]
33224  ]
33225  [
33226    [`host`
33227    ]
33228    [
33229The name of the remote host. This is required by the HTTP protocol to set the "Host" header field.
33230    ]
33231  ]
33232  [
33233    [`target`
33234    ]
33235    [
33236The request-target, in origin-form. The server may use the target to distinguish different services on the same listening port.
33237    ]
33238  ]
33239]
33240[heading Exceptions]
33241[table [[Type][Thrown On]]
33242  [
33243    [`system_error`
33244    ]
33245    [
33246Thrown on failure.
33247    ]
33248  ]
33249]
33250[heading Example]
33251
33252```
33253response_type res;
33254ws.handshake(res, "localhost", "/");
33255std::cout << res;
33256```
33257
33258[heading See Also]
33259
33260* [@https://tools.ietf.org/html/rfc6455#section-4.1 Websocket Opening Handshake Client Requirements (RFC6455)]
33261* [@https://tools.ietf.org/html/rfc7230#section-5.4 Host field (RFC7230)]
33262* [@https://tools.ietf.org/html/rfc7230#section-3.1.1 request-target (RFC7230)]
33263* [@https://tools.ietf.org/html/rfc7230#section-5.3.1 origin-form (RFC7230)]
33264
33265
33266[endsect]
33267
33268[section:overload3 websocket::stream::handshake (3 of 4 overloads)]
33269
33270Perform the WebSocket handshake in the client role.
33271[heading Synopsis]
33272```
33273void
33274handshake(
33275    string_view host,
33276    string_view target,
33277    error_code& ec);
33278```
33279
33280[heading Description]
33281This function is used to perform the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33282The call blocks until one of the following conditions is true:
33283
33284* The request is sent and the response is received.
33285
33286* An error occurs.
33287
33288The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
33289The handshake is successful if the received HTTP response indicates the upgrade was accepted by the server, represented by a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`].
33290
33291[heading Parameters]
33292[table [[Name][Description]]
33293  [
33294    [`host`
33295    ]
33296    [
33297The name of the remote host. This is required by the HTTP protocol to set the "Host" header field.
33298    ]
33299  ]
33300  [
33301    [`target`
33302    ]
33303    [
33304The request-target, in origin-form. The server may use the target to distinguish different services on the same listening port.
33305    ]
33306  ]
33307  [
33308    [`ec`
33309    ]
33310    [
33311Set to indicate what error occurred, if any.
33312    ]
33313  ]
33314]
33315[heading Example]
33316
33317```
33318error_code ec;
33319ws.handshake("localhost", "/", ec);
33320```
33321
33322[heading See Also]
33323
33324* [@https://tools.ietf.org/html/rfc6455#section-4.1 Websocket Opening Handshake Client Requirements (RFC6455)]
33325* [@https://tools.ietf.org/html/rfc7230#section-5.4 Host field (RFC7230)]
33326* [@https://tools.ietf.org/html/rfc7230#section-3.1.1 request-target (RFC7230)]
33327* [@https://tools.ietf.org/html/rfc7230#section-5.3.1 origin-form (RFC7230)]
33328
33329
33330[endsect]
33331
33332[section:overload4 websocket::stream::handshake (4 of 4 overloads)]
33333
33334Perform the WebSocket handshake in the client role.
33335[heading Synopsis]
33336```
33337void
33338handshake(
33339    response_type& res,
33340    string_view host,
33341    string_view target,
33342    error_code& ec);
33343```
33344
33345[heading Description]
33346This function is used to perform the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33347The call blocks until one of the following conditions is true:
33348
33349* The request is sent and the response is received.
33350
33351* An error occurs.
33352
33353The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
33354The handshake is successful if the received HTTP response indicates the upgrade was accepted by the server, represented by a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`].
33355
33356[heading Parameters]
33357[table [[Name][Description]]
33358  [
33359    [`res`
33360    ]
33361    [
33362The HTTP Upgrade response returned by the remote endpoint. The caller may use the response to access any additional information sent by the server.
33363    ]
33364  ]
33365  [
33366    [`host`
33367    ]
33368    [
33369The name of the remote host. This is required by the HTTP protocol to set the "Host" header field.
33370    ]
33371  ]
33372  [
33373    [`target`
33374    ]
33375    [
33376The request-target, in origin-form. The server may use the target to distinguish different services on the same listening port.
33377    ]
33378  ]
33379  [
33380    [`ec`
33381    ]
33382    [
33383Set to indicate what error occurred, if any.
33384    ]
33385  ]
33386]
33387[heading Example]
33388
33389```
33390error_code ec;
33391response_type res;
33392ws.handshake(res, "localhost", "/", ec);
33393if(! ec)
33394    std::cout << res;
33395```
33396
33397[heading See Also]
33398
33399* [@https://tools.ietf.org/html/rfc6455#section-4.1 Websocket Opening Handshake Client Requirements (RFC6455)]
33400* [@https://tools.ietf.org/html/rfc7230#section-5.4 Host field (RFC7230)]
33401* [@https://tools.ietf.org/html/rfc7230#section-3.1.1 request-target (RFC7230)]
33402* [@https://tools.ietf.org/html/rfc7230#section-5.3.1 origin-form (RFC7230)]
33403
33404
33405[endsect]
33406
33407
33408[endsect]
33409
33410[section:async_handshake websocket::stream::async_handshake]
33411[indexterm2 async_handshake..websocket::stream]
33412
33413
33414Perform the WebSocket handshake asynchronously in the client role.
33415```
33416template<
33417    class HandshakeHandler = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
33418``__deduced__``
33419``[link beast.ref.boost__beast__websocket__stream.async_handshake.overload1 async_handshake]``(
33420    string_view host,
33421    string_view target,
33422    HandshakeHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
33423  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.async_handshake.overload1 `more...`]]``
33424
33425template<
33426    class HandshakeHandler = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
33427``__deduced__``
33428``[link beast.ref.boost__beast__websocket__stream.async_handshake.overload2 async_handshake]``(
33429    response_type& res,
33430    string_view host,
33431    string_view target,
33432    HandshakeHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
33433  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.async_handshake.overload2 `more...`]]``
33434```
33435
33436[section:overload1 websocket::stream::async_handshake (1 of 2 overloads)]
33437
33438Perform the WebSocket handshake asynchronously in the client role.
33439[heading Synopsis]
33440```
33441template<
33442    class HandshakeHandler = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
33443``__deduced__``
33444async_handshake(
33445    string_view host,
33446    string_view target,
33447    HandshakeHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
33448```
33449
33450[heading Description]
33451This initiating function is used to asynchronously begin performing the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33452This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
33453
33454* The request is sent and the response is received.
33455
33456* An error occurs.
33457
33458The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_read_some` and `async_write_some` functions. No other operation may be performed on the stream until this operation completes.
33459The handshake is successful if the received HTTP response indicates the upgrade was accepted by the server, represented by a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`].
33460
33461[heading Parameters]
33462[table [[Name][Description]]
33463  [
33464    [`host`
33465    ]
33466    [
33467The name of the remote host. This is required by the HTTP protocol to set the "Host" header field. The implementation will not access the string data after the initiating function returns.
33468    ]
33469  ]
33470  [
33471    [`target`
33472    ]
33473    [
33474The request-target, in origin-form. The server may use the target to distinguish different services on the same listening port. The implementation will not access the string data after the initiating function returns.
33475    ]
33476  ]
33477  [
33478    [`handler`
33479    ]
33480    [
33481
33482The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
33483```
33484void handler(
33485    error_code const& ec    // Result of operation
33486);
33487```
33488
33489Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
33490    ]
33491  ]
33492]
33493[heading Example]
33494
33495```
33496ws.async_handshake("localhost", "/",
33497    [](error_code ec)
33498    {
33499        if(ec)
33500            std::cerr << "Error: " << ec.message() << "\n";
33501    });
33502```
33503
33504[heading See Also]
33505
33506* [@https://tools.ietf.org/html/rfc6455#section-4.1 Websocket Opening Handshake Client Requirements (RFC6455)]
33507* [@https://tools.ietf.org/html/rfc7230#section-5.4 Host field (RFC7230)]
33508* [@https://tools.ietf.org/html/rfc7230#section-3.1.1 request-target (RFC7230)]
33509* [@https://tools.ietf.org/html/rfc7230#section-5.3.1 origin-form (RFC7230)]
33510
33511
33512[endsect]
33513
33514[section:overload2 websocket::stream::async_handshake (2 of 2 overloads)]
33515
33516Perform the WebSocket handshake asynchronously in the client role.
33517[heading Synopsis]
33518```
33519template<
33520    class HandshakeHandler = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
33521``__deduced__``
33522async_handshake(
33523    response_type& res,
33524    string_view host,
33525    string_view target,
33526    HandshakeHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
33527```
33528
33529[heading Description]
33530This initiating function is used to asynchronously begin performing the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33531This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
33532
33533* The request is sent and the response is received.
33534
33535* An error occurs.
33536
33537The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_read_some` and `async_write_some` functions. No other operation may be performed on the stream until this operation completes.
33538The handshake is successful if the received HTTP response indicates the upgrade was accepted by the server, represented by a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`].
33539
33540[heading Parameters]
33541[table [[Name][Description]]
33542  [
33543    [`res`
33544    ]
33545    [
33546The HTTP Upgrade response returned by the remote endpoint. The caller may use the response to access any additional information sent by the server. This object will be assigned before the completion handler is invoked.
33547    ]
33548  ]
33549  [
33550    [`host`
33551    ]
33552    [
33553The name of the remote host. This is required by the HTTP protocol to set the "Host" header field. The implementation will not access the string data after the initiating function returns.
33554    ]
33555  ]
33556  [
33557    [`target`
33558    ]
33559    [
33560The request-target, in origin-form. The server may use the target to distinguish different services on the same listening port. The implementation will not access the string data after the initiating function returns.
33561    ]
33562  ]
33563  [
33564    [`handler`
33565    ]
33566    [
33567
33568The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
33569```
33570void handler(
33571    error_code const& ec    // Result of operation
33572);
33573```
33574
33575Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
33576    ]
33577  ]
33578]
33579[heading Example]
33580
33581```
33582response_type res;
33583ws.async_handshake(res, "localhost", "/",
33584    [&res](error_code ec)
33585    {
33586        if(ec)
33587            std::cerr << "Error: " << ec.message() << "\n";
33588        else
33589            std::cout << res;
33590
33591    });
33592```
33593
33594[heading See Also]
33595
33596* [@https://tools.ietf.org/html/rfc6455#section-4.1 Websocket Opening Handshake Client Requirements (RFC6455)]
33597* [@https://tools.ietf.org/html/rfc7230#section-5.4 Host field (RFC7230)]
33598* [@https://tools.ietf.org/html/rfc7230#section-3.1.1 request-target (RFC7230)]
33599* [@https://tools.ietf.org/html/rfc7230#section-5.3.1 origin-form (RFC7230)]
33600
33601
33602[endsect]
33603
33604
33605[endsect]
33606
33607[section:accept websocket::stream::accept]
33608[indexterm2 accept..websocket::stream]
33609
33610
33611Perform the WebSocket handshake in the server role.
33612```
33613void
33614``[link beast.ref.boost__beast__websocket__stream.accept.overload1 accept]``();
33615  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.accept.overload1 `more...`]]``
33616```
33617
33618
33619Read and respond to a WebSocket HTTP Upgrade request.
33620```
33621void
33622``[link beast.ref.boost__beast__websocket__stream.accept.overload2 accept]``(
33623    error_code& ec);
33624  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.accept.overload2 `more...`]]``
33625
33626template<
33627    class __ConstBufferSequence__>
33628void
33629``[link beast.ref.boost__beast__websocket__stream.accept.overload3 accept]``(
33630    ConstBufferSequence const& buffers);
33631  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.accept.overload3 `more...`]]``
33632
33633template<
33634    class __ConstBufferSequence__>
33635void
33636``[link beast.ref.boost__beast__websocket__stream.accept.overload4 accept]``(
33637    ConstBufferSequence const& buffers,
33638    error_code& ec);
33639  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.accept.overload4 `more...`]]``
33640```
33641
33642
33643Respond to a WebSocket HTTP Upgrade request.
33644```
33645template<
33646    class __Body__,
33647    class __Allocator__>
33648void
33649``[link beast.ref.boost__beast__websocket__stream.accept.overload5 accept]``(
33650    http::request< Body, http::basic_fields< Allocator >> const& req);
33651  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.accept.overload5 `more...`]]``
33652
33653template<
33654    class __Body__,
33655    class __Allocator__>
33656void
33657``[link beast.ref.boost__beast__websocket__stream.accept.overload6 accept]``(
33658    http::request< Body, http::basic_fields< Allocator >> const& req,
33659    error_code& ec);
33660  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.accept.overload6 `more...`]]``
33661```
33662
33663[section:overload1 websocket::stream::accept (1 of 6 overloads)]
33664
33665Perform the WebSocket handshake in the server role.
33666[heading Synopsis]
33667```
33668void
33669accept();
33670```
33671
33672[heading Description]
33673This function is used to perform the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33674The call blocks until one of the following conditions is true:
33675
33676* The request is received and the response is sent.
33677
33678* An error occurs.
33679
33680The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
33681If a valid upgrade request is received, an HTTP response with a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`] is sent to the peer, otherwise a non-successful error is associated with the operation.
33682If the request size exceeds the capacity of the stream's internal buffer, the error [link beast.ref.boost__beast__websocket__error `error::buffer_overflow`] will be indicated. To handle larger requests, an application should read the HTTP request directly using [link beast.ref.boost__beast__http__read `
33683            http::read
33684         `] and then pass the request to the appropriate overload of [link beast.ref.boost__beast__websocket__stream.accept `accept`] or [link beast.ref.boost__beast__websocket__stream.async_accept `async_accept`]
33685
33686[heading Exceptions]
33687[table [[Type][Thrown On]]
33688  [
33689    [`system_error`
33690    ]
33691    [
33692Thrown on failure.
33693    ]
33694  ]
33695]
33696[heading See Also]
33697
33698* [@https://tools.ietf.org/html/rfc6455#section-4.2 Websocket Opening Handshake Server Requirements (RFC6455)]
33699
33700
33701[endsect]
33702
33703[section:overload2 websocket::stream::accept (2 of 6 overloads)]
33704
33705Read and respond to a WebSocket HTTP Upgrade request.
33706[heading Synopsis]
33707```
33708void
33709accept(
33710    error_code& ec);
33711```
33712
33713[heading Description]
33714This function is used to perform the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33715The call blocks until one of the following conditions is true:
33716
33717* The request is received and the response is sent.
33718
33719* An error occurs.
33720
33721The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
33722If a valid upgrade request is received, an HTTP response with a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`] is sent to the peer, otherwise a non-successful error is associated with the operation.
33723If the request size exceeds the capacity of the stream's internal buffer, the error [link beast.ref.boost__beast__websocket__error `error::buffer_overflow`] will be indicated. To handle larger requests, an application should read the HTTP request directly using [link beast.ref.boost__beast__http__read `
33724            http::read
33725         `] and then pass the request to the appropriate overload of [link beast.ref.boost__beast__websocket__stream.accept `accept`] or [link beast.ref.boost__beast__websocket__stream.async_accept `async_accept`]
33726
33727[heading Parameters]
33728[table [[Name][Description]]
33729  [
33730    [`ec`
33731    ]
33732    [
33733Set to indicate what error occurred, if any.
33734    ]
33735  ]
33736]
33737[heading See Also]
33738
33739* [@https://tools.ietf.org/html/rfc6455#section-4.2 Websocket Opening Handshake Server Requirements (RFC6455)]
33740
33741
33742[endsect]
33743
33744[section:overload3 websocket::stream::accept (3 of 6 overloads)]
33745
33746Read and respond to a WebSocket HTTP Upgrade request.
33747[heading Synopsis]
33748```
33749template<
33750    class __ConstBufferSequence__>
33751void
33752accept(
33753    ConstBufferSequence const& buffers);
33754```
33755
33756[heading Description]
33757This function is used to perform the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33758The call blocks until one of the following conditions is true:
33759
33760* The request is received and the response is sent.
33761
33762* An error occurs.
33763
33764The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
33765If a valid upgrade request is received, an HTTP response with a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`] is sent to the peer, otherwise a non-successful error is associated with the operation.
33766If the request size exceeds the capacity of the stream's internal buffer, the error [link beast.ref.boost__beast__websocket__error `error::buffer_overflow`] will be indicated. To handle larger requests, an application should read the HTTP request directly using [link beast.ref.boost__beast__http__read `
33767            http::read
33768         `] and then pass the request to the appropriate overload of [link beast.ref.boost__beast__websocket__stream.accept `accept`] or [link beast.ref.boost__beast__websocket__stream.async_accept `async_accept`]
33769
33770[heading Parameters]
33771[table [[Name][Description]]
33772  [
33773    [`buffers`
33774    ]
33775    [
33776Caller provided data that has already been received on the stream. The implementation will copy the caller provided data before the function returns.
33777    ]
33778  ]
33779]
33780[heading Exceptions]
33781[table [[Type][Thrown On]]
33782  [
33783    [`system_error`
33784    ]
33785    [
33786Thrown on failure.
33787    ]
33788  ]
33789]
33790[heading See Also]
33791
33792* [@https://tools.ietf.org/html/rfc6455#section-4.2 Websocket Opening Handshake Server Requirements (RFC6455)]
33793
33794
33795[endsect]
33796
33797[section:overload4 websocket::stream::accept (4 of 6 overloads)]
33798
33799Read and respond to a WebSocket HTTP Upgrade request.
33800[heading Synopsis]
33801```
33802template<
33803    class __ConstBufferSequence__>
33804void
33805accept(
33806    ConstBufferSequence const& buffers,
33807    error_code& ec);
33808```
33809
33810[heading Description]
33811This function is used to perform the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33812The call blocks until one of the following conditions is true:
33813
33814* The request is received and the response is sent.
33815
33816* An error occurs.
33817
33818The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
33819If a valid upgrade request is received, an HTTP response with a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`] is sent to the peer, otherwise a non-successful error is associated with the operation.
33820If the request size exceeds the capacity of the stream's internal buffer, the error [link beast.ref.boost__beast__websocket__error `error::buffer_overflow`] will be indicated. To handle larger requests, an application should read the HTTP request directly using [link beast.ref.boost__beast__http__read `
33821            http::read
33822         `] and then pass the request to the appropriate overload of [link beast.ref.boost__beast__websocket__stream.accept `accept`] or [link beast.ref.boost__beast__websocket__stream.async_accept `async_accept`]
33823
33824[heading Parameters]
33825[table [[Name][Description]]
33826  [
33827    [`buffers`
33828    ]
33829    [
33830Caller provided data that has already been received on the stream. The implementation will copy the caller provided data before the function returns.
33831    ]
33832  ]
33833  [
33834    [`ec`
33835    ]
33836    [
33837Set to indicate what error occurred, if any.
33838    ]
33839  ]
33840]
33841[heading See Also]
33842
33843* [@https://tools.ietf.org/html/rfc6455#section-4.2 Websocket Opening Handshake Server Requirements (RFC6455)]
33844
33845
33846[endsect]
33847
33848[section:overload5 websocket::stream::accept (5 of 6 overloads)]
33849
33850Respond to a WebSocket HTTP Upgrade request.
33851[heading Synopsis]
33852```
33853template<
33854    class __Body__,
33855    class __Allocator__>
33856void
33857accept(
33858    http::request< Body, http::basic_fields< Allocator >> const& req);
33859```
33860
33861[heading Description]
33862This function is used to perform the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33863The call blocks until one of the following conditions is true:
33864
33865* The response is sent.
33866
33867* An error occurs.
33868
33869The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
33870If a valid upgrade request is received, an HTTP response with a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`] is sent to the peer, otherwise a non-successful error is associated with the operation.
33871
33872[heading Parameters]
33873[table [[Name][Description]]
33874  [
33875    [`req`
33876    ]
33877    [
33878An object containing the HTTP Upgrade request. Ownership is not transferred, the implementation will not access this object from other threads.
33879    ]
33880  ]
33881]
33882[heading Exceptions]
33883[table [[Type][Thrown On]]
33884  [
33885    [`system_error`
33886    ]
33887    [
33888Thrown on failure.
33889    ]
33890  ]
33891]
33892[heading See Also]
33893
33894* [@https://tools.ietf.org/html/rfc6455#section-4.2 Websocket Opening Handshake Server Requirements (RFC6455)]
33895
33896
33897[endsect]
33898
33899[section:overload6 websocket::stream::accept (6 of 6 overloads)]
33900
33901Respond to a WebSocket HTTP Upgrade request.
33902[heading Synopsis]
33903```
33904template<
33905    class __Body__,
33906    class __Allocator__>
33907void
33908accept(
33909    http::request< Body, http::basic_fields< Allocator >> const& req,
33910    error_code& ec);
33911```
33912
33913[heading Description]
33914This function is used to perform the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33915The call blocks until one of the following conditions is true:
33916
33917* The response is sent.
33918
33919* An error occurs.
33920
33921The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
33922If a valid upgrade request is received, an HTTP response with a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`] is sent to the peer, otherwise a non-successful error is associated with the operation.
33923
33924[heading Parameters]
33925[table [[Name][Description]]
33926  [
33927    [`req`
33928    ]
33929    [
33930An object containing the HTTP Upgrade request. Ownership is not transferred, the implementation will not access this object from other threads.
33931    ]
33932  ]
33933  [
33934    [`ec`
33935    ]
33936    [
33937Set to indicate what error occurred, if any.
33938    ]
33939  ]
33940]
33941[heading See Also]
33942
33943* [@https://tools.ietf.org/html/rfc6455#section-4.2 Websocket Opening Handshake Server Requirements (RFC6455)]
33944
33945
33946[endsect]
33947
33948
33949[endsect]
33950
33951[section:async_accept websocket::stream::async_accept]
33952[indexterm2 async_accept..websocket::stream]
33953
33954
33955Perform the WebSocket handshake asynchronously in the server role.
33956```
33957template<
33958    class AcceptHandler = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
33959``__deduced__``
33960``[link beast.ref.boost__beast__websocket__stream.async_accept.overload1 async_accept]``(
33961    AcceptHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
33962  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.async_accept.overload1 `more...`]]``
33963
33964template<
33965    class __ConstBufferSequence__,
33966    class AcceptHandler = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
33967``__deduced__``
33968``[link beast.ref.boost__beast__websocket__stream.async_accept.overload2 async_accept]``(
33969    ConstBufferSequence const& buffers,
33970    AcceptHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
33971  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.async_accept.overload2 `more...`]]``
33972
33973template<
33974    class __Body__,
33975    class __Allocator__,
33976    class AcceptHandler = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
33977``__deduced__``
33978``[link beast.ref.boost__beast__websocket__stream.async_accept.overload3 async_accept]``(
33979    http::request< Body, http::basic_fields< Allocator >> const& req,
33980    AcceptHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
33981  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.async_accept.overload3 `more...`]]``
33982```
33983
33984[section:overload1 websocket::stream::async_accept (1 of 3 overloads)]
33985
33986Perform the WebSocket handshake asynchronously in the server role.
33987[heading Synopsis]
33988```
33989template<
33990    class AcceptHandler = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
33991``__deduced__``
33992async_accept(
33993    AcceptHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
33994```
33995
33996[heading Description]
33997This initiating function is used to asynchronously begin performing the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
33998This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
33999
34000* The request is received and the response is sent.
34001
34002* An error occurs.
34003
34004The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_read_some` and `async_write_some` functions. No other operation may be performed on the stream until this operation completes.
34005If a valid upgrade request is received, an HTTP response with a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`] is sent to the peer, otherwise a non-successful error is associated with the operation.
34006If the request size exceeds the capacity of the stream's internal buffer, the error [link beast.ref.boost__beast__websocket__error `error::buffer_overflow`] will be indicated. To handle larger requests, an application should read the HTTP request directly using [link beast.ref.boost__beast__http__async_read `
34007            http::async_read
34008         `] and then pass the request to the appropriate overload of [link beast.ref.boost__beast__websocket__stream.accept `accept`] or [link beast.ref.boost__beast__websocket__stream.async_accept `async_accept`]
34009
34010[heading Parameters]
34011[table [[Name][Description]]
34012  [
34013    [`handler`
34014    ]
34015    [
34016
34017The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
34018```
34019void handler(
34020    error_code const& ec    // Result of operation
34021);
34022```
34023
34024Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
34025    ]
34026  ]
34027]
34028[heading See Also]
34029
34030* [@https://tools.ietf.org/html/rfc6455#section-4.2 Websocket Opening Handshake Server Requirements (RFC6455)]
34031
34032
34033[endsect]
34034
34035[section:overload2 websocket::stream::async_accept (2 of 3 overloads)]
34036
34037Perform the WebSocket handshake asynchronously in the server role.
34038[heading Synopsis]
34039```
34040template<
34041    class __ConstBufferSequence__,
34042    class AcceptHandler = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
34043``__deduced__``
34044async_accept(
34045    ConstBufferSequence const& buffers,
34046    AcceptHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
34047```
34048
34049[heading Description]
34050This initiating function is used to asynchronously begin performing the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
34051This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
34052
34053* The request is received and the response is sent.
34054
34055* An error occurs.
34056
34057The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_read_some` and `async_write_some` functions. No other operation may be performed on the stream until this operation completes.
34058If a valid upgrade request is received, an HTTP response with a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`] is sent to the peer, otherwise a non-successful error is associated with the operation.
34059If the request size exceeds the capacity of the stream's internal buffer, the error [link beast.ref.boost__beast__websocket__error `error::buffer_overflow`] will be indicated. To handle larger requests, an application should read the HTTP request directly using [link beast.ref.boost__beast__http__async_read `
34060            http::async_read
34061         `] and then pass the request to the appropriate overload of [link beast.ref.boost__beast__websocket__stream.accept `accept`] or [link beast.ref.boost__beast__websocket__stream.async_accept `async_accept`]
34062
34063[heading Parameters]
34064[table [[Name][Description]]
34065  [
34066    [`buffers`
34067    ]
34068    [
34069Caller provided data that has already been received on the stream. This may be used for implementations allowing multiple protocols on the same stream. The buffered data will first be applied to the handshake, and then to received WebSocket frames. The implementation will copy the caller provided data before the function returns.
34070    ]
34071  ]
34072  [
34073    [`handler`
34074    ]
34075    [
34076
34077The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
34078```
34079void handler(
34080    error_code const& ec    // Result of operation
34081);
34082```
34083
34084Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
34085    ]
34086  ]
34087]
34088[heading See Also]
34089
34090* [@https://tools.ietf.org/html/rfc6455#section-4.2 Websocket Opening Handshake Server Requirements (RFC6455)]
34091
34092
34093[endsect]
34094
34095[section:overload3 websocket::stream::async_accept (3 of 3 overloads)]
34096
34097Perform the WebSocket handshake asynchronously in the server role.
34098[heading Synopsis]
34099```
34100template<
34101    class __Body__,
34102    class __Allocator__,
34103    class AcceptHandler = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
34104``__deduced__``
34105async_accept(
34106    http::request< Body, http::basic_fields< Allocator >> const& req,
34107    AcceptHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
34108```
34109
34110[heading Description]
34111This initiating function is used to asynchronously begin performing the [@https://en.wikipedia.org/wiki/WebSocket#Protocol_handshake WebSocket handshake], required before messages can be sent and received. During the handshake, the client sends the Websocket Upgrade HTTP request, and the server replies with an HTTP response indicating the result of the handshake.
34112This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
34113
34114* The request is received and the response is sent.
34115
34116* An error occurs.
34117
34118The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_read_some` and `async_write_some` functions. No other operation may be performed on the stream until this operation completes.
34119If a valid upgrade request is received, an HTTP response with a [@https://tools.ietf.org/html/rfc7230#section-3.1.2 status-code] of [link beast.ref.boost__beast__http__status `beast::http::status::switching_protocols`] is sent to the peer, otherwise a non-successful error is associated with the operation.
34120
34121[heading Parameters]
34122[table [[Name][Description]]
34123  [
34124    [`req`
34125    ]
34126    [
34127An object containing the HTTP Upgrade request. Ownership is not transferred, the implementation will not access this object from other threads.
34128    ]
34129  ]
34130  [
34131    [`handler`
34132    ]
34133    [
34134
34135The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
34136```
34137void handler(
34138    error_code const& ec    // Result of operation
34139);
34140```
34141
34142Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
34143    ]
34144  ]
34145]
34146[heading See Also]
34147
34148* [@https://tools.ietf.org/html/rfc6455#section-4.2 Websocket Opening Handshake Server Requirements (RFC6455)]
34149
34150
34151[endsect]
34152
34153
34154[endsect]
34155
34156[section:close websocket::stream::close]
34157[indexterm2 close..websocket::stream]
34158
34159
34160Send a websocket close control frame.
34161```
34162void
34163``[link beast.ref.boost__beast__websocket__stream.close.overload1 close]``(
34164    close_reason const& cr);
34165  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.close.overload1 `more...`]]``
34166
34167void
34168``[link beast.ref.boost__beast__websocket__stream.close.overload2 close]``(
34169    close_reason const& cr,
34170    error_code& ec);
34171  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.close.overload2 `more...`]]``
34172```
34173
34174[section:overload1 websocket::stream::close (1 of 2 overloads)]
34175
34176Send a websocket close control frame.
34177[heading Synopsis]
34178```
34179void
34180close(
34181    close_reason const& cr);
34182```
34183
34184[heading Description]
34185This function is used to send a [@https://tools.ietf.org/html/rfc6455#section-5.5.1 close frame], which begins the websocket closing handshake. The session ends when both ends of the connection have sent and received a close frame.
34186The call blocks until one of the following conditions is true:
34187
34188* The close frame is written.
34189
34190* An error occurs.
34191
34192The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `write_some` function.
34193After beginning the closing handshake, the program should not write further message data, pings, or pongs. Instead, the program should continue reading message data until an error occurs. A read returning [link beast.ref.boost__beast__websocket__error `error::closed`] indicates a successful connection closure.
34194
34195[heading Parameters]
34196[table [[Name][Description]]
34197  [
34198    [`cr`
34199    ]
34200    [
34201The reason for the close. If the close reason specifies a close code other than beast::websocket::close_code::none, the close frame is sent with the close code and optional reason string. Otherwise, the close frame is sent with no payload.
34202    ]
34203  ]
34204]
34205[heading Exceptions]
34206[table [[Type][Thrown On]]
34207  [
34208    [`system_error`
34209    ]
34210    [
34211Thrown on failure.
34212    ]
34213  ]
34214]
34215[heading See Also]
34216
34217* [@https://tools.ietf.org/html/rfc6455#section-7.1.2 Websocket Closing Handshake (RFC6455)]
34218
34219
34220[endsect]
34221
34222[section:overload2 websocket::stream::close (2 of 2 overloads)]
34223
34224Send a websocket close control frame.
34225[heading Synopsis]
34226```
34227void
34228close(
34229    close_reason const& cr,
34230    error_code& ec);
34231```
34232
34233[heading Description]
34234This function is used to send a [@https://tools.ietf.org/html/rfc6455#section-5.5.1 close frame], which begins the websocket closing handshake. The session ends when both ends of the connection have sent and received a close frame.
34235The call blocks until one of the following conditions is true:
34236
34237* The close frame is written.
34238
34239* An error occurs.
34240
34241The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `write_some` function.
34242After beginning the closing handshake, the program should not write further message data, pings, or pongs. Instead, the program should continue reading message data until an error occurs. A read returning [link beast.ref.boost__beast__websocket__error `error::closed`] indicates a successful connection closure.
34243
34244[heading Parameters]
34245[table [[Name][Description]]
34246  [
34247    [`cr`
34248    ]
34249    [
34250The reason for the close. If the close reason specifies a close code other than beast::websocket::close_code::none, the close frame is sent with the close code and optional reason string. Otherwise, the close frame is sent with no payload.
34251    ]
34252  ]
34253  [
34254    [`ec`
34255    ]
34256    [
34257Set to indicate what error occurred, if any.
34258    ]
34259  ]
34260]
34261[heading See Also]
34262
34263* [@https://tools.ietf.org/html/rfc6455#section-7.1.2 Websocket Closing Handshake (RFC6455)]
34264
34265
34266[endsect]
34267
34268
34269[endsect]
34270
34271[section:async_close websocket::stream::async_close]
34272[indexterm2 async_close..websocket::stream]
34273
34274
34275Send a websocket close control frame asynchronously.
34276[heading Synopsis]
34277```
34278template<
34279    class CloseHandler = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
34280``__deduced__``
34281async_close(
34282    close_reason const& cr,
34283    CloseHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
34284```
34285
34286[heading Description]
34287This function is used to asynchronously send a [@https://tools.ietf.org/html/rfc6455#section-5.5.1 close frame], which begins the websocket closing handshake. The session ends when both ends of the connection have sent and received a close frame.
34288This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
34289
34290* The close frame finishes sending.
34291
34292* An error occurs.
34293
34294The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_write_some` function. No other operations except for message reading operations should be initiated on the stream after a close operation is started.
34295After beginning the closing handshake, the program should not write further message data, pings, or pongs. Instead, the program should continue reading message data until an error occurs. A read returning [link beast.ref.boost__beast__websocket__error `error::closed`] indicates a successful connection closure.
34296
34297[heading Parameters]
34298[table [[Name][Description]]
34299  [
34300    [`cr`
34301    ]
34302    [
34303The reason for the close. If the close reason specifies a close code other than beast::websocket::close_code::none, the close frame is sent with the close code and optional reason string. Otherwise, the close frame is sent with no payload.
34304    ]
34305  ]
34306  [
34307    [`handler`
34308    ]
34309    [
34310
34311The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
34312```
34313void handler(
34314    error_code const& ec     // Result of operation
34315);
34316```
34317
34318Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
34319    ]
34320  ]
34321]
34322[heading See Also]
34323
34324* [@https://tools.ietf.org/html/rfc6455#section-7.1.2 Websocket Closing Handshake (RFC6455)]
34325
34326
34327[endsect]
34328
34329[section:ping websocket::stream::ping]
34330[indexterm2 ping..websocket::stream]
34331
34332
34333Send a websocket ping control frame.
34334```
34335void
34336``[link beast.ref.boost__beast__websocket__stream.ping.overload1 ping]``(
34337    ping_data const& payload);
34338  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.ping.overload1 `more...`]]``
34339
34340void
34341``[link beast.ref.boost__beast__websocket__stream.ping.overload2 ping]``(
34342    ping_data const& payload,
34343    error_code& ec);
34344  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.ping.overload2 `more...`]]``
34345```
34346
34347[section:overload1 websocket::stream::ping (1 of 2 overloads)]
34348
34349Send a websocket ping control frame.
34350[heading Synopsis]
34351```
34352void
34353ping(
34354    ping_data const& payload);
34355```
34356
34357[heading Description]
34358This function is used to send a [@https://tools.ietf.org/html/rfc6455#section-5.5.2 ping frame], which usually elicits an automatic pong control frame response from the peer.
34359The call blocks until one of the following conditions is true:
34360
34361* The ping frame is written.
34362
34363* An error occurs.
34364
34365The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `write_some` function.
34366
34367[heading Parameters]
34368[table [[Name][Description]]
34369  [
34370    [`payload`
34371    ]
34372    [
34373The payload of the ping message, which may be empty.
34374    ]
34375  ]
34376]
34377[heading Exceptions]
34378[table [[Type][Thrown On]]
34379  [
34380    [`system_error`
34381    ]
34382    [
34383Thrown on failure.
34384    ]
34385  ]
34386]
34387
34388[endsect]
34389
34390[section:overload2 websocket::stream::ping (2 of 2 overloads)]
34391
34392Send a websocket ping control frame.
34393[heading Synopsis]
34394```
34395void
34396ping(
34397    ping_data const& payload,
34398    error_code& ec);
34399```
34400
34401[heading Description]
34402This function is used to send a [@https://tools.ietf.org/html/rfc6455#section-5.5.2 ping frame], which usually elicits an automatic pong control frame response from the peer.
34403The call blocks until one of the following conditions is true:
34404
34405* The ping frame is written.
34406
34407* An error occurs.
34408
34409The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `write_some` function.
34410
34411[heading Parameters]
34412[table [[Name][Description]]
34413  [
34414    [`payload`
34415    ]
34416    [
34417The payload of the ping message, which may be empty.
34418    ]
34419  ]
34420  [
34421    [`ec`
34422    ]
34423    [
34424Set to indicate what error occurred, if any.
34425    ]
34426  ]
34427]
34428
34429[endsect]
34430
34431
34432[endsect]
34433
34434[section:async_ping websocket::stream::async_ping]
34435[indexterm2 async_ping..websocket::stream]
34436
34437
34438Send a websocket ping control frame asynchronously.
34439[heading Synopsis]
34440```
34441template<
34442    class __WriteHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
34443``__deduced__``
34444async_ping(
34445    ping_data const& payload,
34446    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
34447```
34448
34449[heading Description]
34450This function is used to asynchronously send a [@https://tools.ietf.org/html/rfc6455#section-5.5.2 ping frame], which usually elicits an automatic pong control frame response from the peer.
34451
34452* The ping frame is written.
34453
34454* An error occurs.
34455
34456The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_write_some` function. The program must ensure that no other calls to [link beast.ref.boost__beast__websocket__stream.ping `ping`], [link beast.ref.boost__beast__websocket__stream.pong `pong`], [link beast.ref.boost__beast__websocket__stream.async_ping `async_ping`], or [link beast.ref.boost__beast__websocket__stream.async_pong `async_pong`] are performed until this operation completes.
34457If a close frame is sent or received before the ping frame is sent, the error received by this completion handler will be `net::error::operation_aborted`.
34458
34459[heading Parameters]
34460[table [[Name][Description]]
34461  [
34462    [`payload`
34463    ]
34464    [
34465The payload of the ping message, which may be empty. The implementation will not access the contents of this object after the initiating function returns.
34466    ]
34467  ]
34468  [
34469    [`handler`
34470    ]
34471    [
34472
34473The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
34474```
34475void handler(
34476    error_code const& ec     // Result of operation
34477);
34478```
34479
34480Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
34481    ]
34482  ]
34483]
34484
34485[endsect]
34486
34487[section:pong websocket::stream::pong]
34488[indexterm2 pong..websocket::stream]
34489
34490
34491Send a websocket pong control frame.
34492```
34493void
34494``[link beast.ref.boost__beast__websocket__stream.pong.overload1 pong]``(
34495    ping_data const& payload);
34496  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.pong.overload1 `more...`]]``
34497
34498void
34499``[link beast.ref.boost__beast__websocket__stream.pong.overload2 pong]``(
34500    ping_data const& payload,
34501    error_code& ec);
34502  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.pong.overload2 `more...`]]``
34503```
34504
34505[section:overload1 websocket::stream::pong (1 of 2 overloads)]
34506
34507Send a websocket pong control frame.
34508[heading Synopsis]
34509```
34510void
34511pong(
34512    ping_data const& payload);
34513```
34514
34515[heading Description]
34516This function is used to send a [@https://tools.ietf.org/html/rfc6455#section-5.5.3 pong frame], which is usually sent automatically in response to a ping frame from the remote peer.
34517The call blocks until one of the following conditions is true:
34518
34519* The pong frame is written.
34520
34521* An error occurs.
34522
34523The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `write_some` function.
34524WebSocket allows pong frames to be sent at any time, without first receiving a ping. An unsolicited pong sent in this fashion may indicate to the remote peer that the connection is still active.
34525
34526[heading Parameters]
34527[table [[Name][Description]]
34528  [
34529    [`payload`
34530    ]
34531    [
34532The payload of the pong message, which may be empty.
34533    ]
34534  ]
34535]
34536[heading Exceptions]
34537[table [[Type][Thrown On]]
34538  [
34539    [`system_error`
34540    ]
34541    [
34542Thrown on failure.
34543    ]
34544  ]
34545]
34546
34547[endsect]
34548
34549[section:overload2 websocket::stream::pong (2 of 2 overloads)]
34550
34551Send a websocket pong control frame.
34552[heading Synopsis]
34553```
34554void
34555pong(
34556    ping_data const& payload,
34557    error_code& ec);
34558```
34559
34560[heading Description]
34561This function is used to send a [@https://tools.ietf.org/html/rfc6455#section-5.5.3 pong frame], which is usually sent automatically in response to a ping frame from the remote peer.
34562The call blocks until one of the following conditions is true:
34563
34564* The pong frame is written.
34565
34566* An error occurs.
34567
34568The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `write_some` function.
34569WebSocket allows pong frames to be sent at any time, without first receiving a ping. An unsolicited pong sent in this fashion may indicate to the remote peer that the connection is still active.
34570
34571[heading Parameters]
34572[table [[Name][Description]]
34573  [
34574    [`payload`
34575    ]
34576    [
34577The payload of the pong message, which may be empty.
34578    ]
34579  ]
34580  [
34581    [`ec`
34582    ]
34583    [
34584Set to indicate what error occurred, if any.
34585    ]
34586  ]
34587]
34588
34589[endsect]
34590
34591
34592[endsect]
34593
34594[section:async_pong websocket::stream::async_pong]
34595[indexterm2 async_pong..websocket::stream]
34596
34597
34598Send a websocket pong control frame asynchronously.
34599[heading Synopsis]
34600```
34601template<
34602    class __WriteHandler__ = net::default_completion_token_t<``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
34603``__deduced__``
34604async_pong(
34605    ping_data const& payload,
34606    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
34607```
34608
34609[heading Description]
34610This function is used to asynchronously send a [@https://tools.ietf.org/html/rfc6455#section-5.5.3 pong frame], which is usually sent automatically in response to a ping frame from the remote peer.
34611
34612* The pong frame is written.
34613
34614* An error occurs.
34615
34616The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_write_some` function. The program must ensure that no other calls to [link beast.ref.boost__beast__websocket__stream.ping `ping`], [link beast.ref.boost__beast__websocket__stream.pong `pong`], [link beast.ref.boost__beast__websocket__stream.async_ping `async_ping`], or [link beast.ref.boost__beast__websocket__stream.async_pong `async_pong`] are performed until this operation completes.
34617If a close frame is sent or received before the pong frame is sent, the error received by this completion handler will be `net::error::operation_aborted`.
34618WebSocket allows pong frames to be sent at any time, without first receiving a ping. An unsolicited pong sent in this fashion may indicate to the remote peer that the connection is still active.
34619
34620[heading Parameters]
34621[table [[Name][Description]]
34622  [
34623    [`payload`
34624    ]
34625    [
34626The payload of the pong message, which may be empty. The implementation will not access the contents of this object after the initiating function returns.
34627    ]
34628  ]
34629  [
34630    [`handler`
34631    ]
34632    [
34633
34634The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
34635```
34636void handler(
34637    error_code const& ec     // Result of operation
34638);
34639```
34640
34641Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
34642    ]
34643  ]
34644]
34645
34646[endsect]
34647
34648[section:read websocket::stream::read]
34649[indexterm2 read..websocket::stream]
34650
34651
34652Read a complete message.
34653```
34654template<
34655    class __DynamicBuffer__>
34656std::size_t
34657``[link beast.ref.boost__beast__websocket__stream.read.overload1 read]``(
34658    DynamicBuffer& buffer);
34659  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.read.overload1 `more...`]]``
34660
34661template<
34662    class __DynamicBuffer__>
34663std::size_t
34664``[link beast.ref.boost__beast__websocket__stream.read.overload2 read]``(
34665    DynamicBuffer& buffer,
34666    error_code& ec);
34667  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.read.overload2 `more...`]]``
34668```
34669
34670[section:overload1 websocket::stream::read (1 of 2 overloads)]
34671
34672Read a complete message.
34673[heading Synopsis]
34674```
34675template<
34676    class __DynamicBuffer__>
34677std::size_t
34678read(
34679    DynamicBuffer& buffer);
34680```
34681
34682[heading Description]
34683This function is used to read a complete message.
34684The call blocks until one of the following is true:
34685
34686* A complete message is received.
34687
34688* A close frame is received. In this case the error indicated by the function will be [link beast.ref.boost__beast__websocket__error `error::closed`].
34689
34690* An error occurs.
34691
34692The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
34693Received message data is appended to the buffer. The functions [link beast.ref.boost__beast__websocket__stream.got_binary `got_binary`] and [link beast.ref.boost__beast__websocket__stream.got_text `got_text`] may be used to query the stream and determine the type of the last received message.
34694Until the call returns, the implementation will read incoming control frames and handle them automatically as follows:
34695
34696* The [link beast.ref.boost__beast__websocket__stream.control_callback `control_callback`] will be invoked for each control frame.
34697
34698* For each received ping frame, a pong frame will be automatically sent.
34699
34700* If a close frame is received, the WebSocket closing handshake is performed. In this case, when the function returns, the error [link beast.ref.boost__beast__websocket__error `error::closed`] will be indicated.
34701
34702[heading Return Value]
34703The number of message payload bytes appended to the buffer.
34704[heading Parameters]
34705[table [[Name][Description]]
34706  [
34707    [`buffer`
34708    ]
34709    [
34710A dynamic buffer to append message data to.
34711    ]
34712  ]
34713]
34714[heading Exceptions]
34715[table [[Type][Thrown On]]
34716  [
34717    [`system_error`
34718    ]
34719    [
34720Thrown on failure.
34721    ]
34722  ]
34723]
34724
34725[endsect]
34726
34727[section:overload2 websocket::stream::read (2 of 2 overloads)]
34728
34729Read a complete message.
34730[heading Synopsis]
34731```
34732template<
34733    class __DynamicBuffer__>
34734std::size_t
34735read(
34736    DynamicBuffer& buffer,
34737    error_code& ec);
34738```
34739
34740[heading Description]
34741This function is used to read a complete message.
34742The call blocks until one of the following is true:
34743
34744* A complete message is received.
34745
34746* A close frame is received. In this case the error indicated by the function will be [link beast.ref.boost__beast__websocket__error `error::closed`].
34747
34748* An error occurs.
34749
34750The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
34751Received message data is appended to the buffer. The functions [link beast.ref.boost__beast__websocket__stream.got_binary `got_binary`] and [link beast.ref.boost__beast__websocket__stream.got_text `got_text`] may be used to query the stream and determine the type of the last received message.
34752Until the call returns, the implementation will read incoming control frames and handle them automatically as follows:
34753
34754* The [link beast.ref.boost__beast__websocket__stream.control_callback `control_callback`] will be invoked for each control frame.
34755
34756* For each received ping frame, a pong frame will be automatically sent.
34757
34758* If a close frame is received, the WebSocket closing handshake is performed. In this case, when the function returns, the error [link beast.ref.boost__beast__websocket__error `error::closed`] will be indicated.
34759
34760[heading Return Value]
34761The number of message payload bytes appended to the buffer.
34762[heading Parameters]
34763[table [[Name][Description]]
34764  [
34765    [`buffer`
34766    ]
34767    [
34768A dynamic buffer to append message data to.
34769    ]
34770  ]
34771  [
34772    [`ec`
34773    ]
34774    [
34775Set to indicate what error occurred, if any.
34776    ]
34777  ]
34778]
34779
34780[endsect]
34781
34782
34783[endsect]
34784
34785[section:async_read websocket::stream::async_read]
34786[indexterm2 async_read..websocket::stream]
34787
34788
34789Read a complete message asynchronously.
34790[heading Synopsis]
34791```
34792template<
34793    class __DynamicBuffer__,
34794    class __ReadHandler__ = net::default_completion_token_t<                ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
34795``__deduced__``
34796async_read(
34797    DynamicBuffer& buffer,
34798    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
34799```
34800
34801[heading Description]
34802This function is used to asynchronously read a complete message.
34803This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
34804
34805* A complete message is received.
34806
34807* A close frame is received. In this case the error indicated by the function will be [link beast.ref.boost__beast__websocket__error `error::closed`].
34808
34809* An error occurs.
34810
34811The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_read_some` and `async_write_some` functions. The program must ensure that no other calls to [link beast.ref.boost__beast__websocket__stream.read `read`], [link beast.ref.boost__beast__websocket__stream.read_some `read_some`], [link beast.ref.boost__beast__websocket__stream.async_read `async_read`], or [link beast.ref.boost__beast__websocket__stream.async_read_some `async_read_some`] are performed until this operation completes.
34812Received message data is appended to the buffer. The functions [link beast.ref.boost__beast__websocket__stream.got_binary `got_binary`] and [link beast.ref.boost__beast__websocket__stream.got_text `got_text`] may be used to query the stream and determine the type of the last received message.
34813Until the operation completes, the implementation will read incoming control frames and handle them automatically as follows:
34814
34815* The [link beast.ref.boost__beast__websocket__stream.control_callback `control_callback`] will be invoked for each control frame.
34816
34817* For each received ping frame, a pong frame will be automatically sent.
34818
34819* If a close frame is received, the WebSocket close procedure is performed. In this case, when the function returns, the error [link beast.ref.boost__beast__websocket__error `error::closed`] will be indicated.
34820
34821Pong frames and close frames sent by the implementation while the read operation is outstanding do not prevent the application from also writing message data, sending pings, sending pongs, or sending close frames.
34822
34823[heading Parameters]
34824[table [[Name][Description]]
34825  [
34826    [`buffer`
34827    ]
34828    [
34829A dynamic buffer to append message data to.
34830    ]
34831  ]
34832  [
34833    [`handler`
34834    ]
34835    [
34836
34837The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
34838```
34839void handler(
34840    error_code const& ec,       // Result of operation
34841    std::size_t bytes_written   // Number of bytes appended to buffer
34842);
34843```
34844
34845Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
34846    ]
34847  ]
34848]
34849
34850[endsect]
34851
34852[section:read_some websocket::stream::read_some]
34853[indexterm2 read_some..websocket::stream]
34854
34855
34856Read some message data.
34857```
34858template<
34859    class __DynamicBuffer__>
34860std::size_t
34861``[link beast.ref.boost__beast__websocket__stream.read_some.overload1 read_some]``(
34862    DynamicBuffer& buffer,
34863    std::size_t limit);
34864  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.read_some.overload1 `more...`]]``
34865
34866template<
34867    class __DynamicBuffer__>
34868std::size_t
34869``[link beast.ref.boost__beast__websocket__stream.read_some.overload2 read_some]``(
34870    DynamicBuffer& buffer,
34871    std::size_t limit,
34872    error_code& ec);
34873  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.read_some.overload2 `more...`]]``
34874
34875template<
34876    class __MutableBufferSequence__>
34877std::size_t
34878``[link beast.ref.boost__beast__websocket__stream.read_some.overload3 read_some]``(
34879    MutableBufferSequence const& buffers);
34880  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.read_some.overload3 `more...`]]``
34881
34882template<
34883    class __MutableBufferSequence__>
34884std::size_t
34885``[link beast.ref.boost__beast__websocket__stream.read_some.overload4 read_some]``(
34886    MutableBufferSequence const& buffers,
34887    error_code& ec);
34888  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.read_some.overload4 `more...`]]``
34889```
34890
34891[section:overload1 websocket::stream::read_some (1 of 4 overloads)]
34892
34893Read some message data.
34894[heading Synopsis]
34895```
34896template<
34897    class __DynamicBuffer__>
34898std::size_t
34899read_some(
34900    DynamicBuffer& buffer,
34901    std::size_t limit);
34902```
34903
34904[heading Description]
34905This function is used to read some message data.
34906The call blocks until one of the following is true:
34907
34908* Some message data is received.
34909
34910* A close frame is received. In this case the error indicated by the function will be [link beast.ref.boost__beast__websocket__error `error::closed`].
34911
34912* An error occurs.
34913
34914The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
34915Received message data is appended to the buffer. The functions [link beast.ref.boost__beast__websocket__stream.got_binary `got_binary`] and [link beast.ref.boost__beast__websocket__stream.got_text `got_text`] may be used to query the stream and determine the type of the last received message. The function [link beast.ref.boost__beast__websocket__stream.is_message_done `is_message_done`] may be called to determine if the message received by the last read operation is complete.
34916Until the call returns, the implementation will read incoming control frames and handle them automatically as follows:
34917
34918* The [link beast.ref.boost__beast__websocket__stream.control_callback `control_callback`] will be invoked for each control frame.
34919
34920* For each received ping frame, a pong frame will be automatically sent.
34921
34922* If a close frame is received, the WebSocket closing handshake is performed. In this case, when the function returns, the error [link beast.ref.boost__beast__websocket__error `error::closed`] will be indicated.
34923
34924[heading Return Value]
34925The number of message payload bytes appended to the buffer.
34926[heading Parameters]
34927[table [[Name][Description]]
34928  [
34929    [`buffer`
34930    ]
34931    [
34932A dynamic buffer to append message data to.
34933    ]
34934  ]
34935  [
34936    [`limit`
34937    ]
34938    [
34939An upper limit on the number of bytes this function will append into the buffer. If this value is zero, then a reasonable size will be chosen automatically.
34940    ]
34941  ]
34942]
34943[heading Exceptions]
34944[table [[Type][Thrown On]]
34945  [
34946    [`system_error`
34947    ]
34948    [
34949Thrown on failure.
34950    ]
34951  ]
34952]
34953
34954[endsect]
34955
34956[section:overload2 websocket::stream::read_some (2 of 4 overloads)]
34957
34958Read some message data.
34959[heading Synopsis]
34960```
34961template<
34962    class __DynamicBuffer__>
34963std::size_t
34964read_some(
34965    DynamicBuffer& buffer,
34966    std::size_t limit,
34967    error_code& ec);
34968```
34969
34970[heading Description]
34971This function is used to read some message data.
34972The call blocks until one of the following is true:
34973
34974* Some message data is received.
34975
34976* A close frame is received. In this case the error indicated by the function will be [link beast.ref.boost__beast__websocket__error `error::closed`].
34977
34978* An error occurs.
34979
34980The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
34981Received message data is appended to the buffer. The functions [link beast.ref.boost__beast__websocket__stream.got_binary `got_binary`] and [link beast.ref.boost__beast__websocket__stream.got_text `got_text`] may be used to query the stream and determine the type of the last received message. The function [link beast.ref.boost__beast__websocket__stream.is_message_done `is_message_done`] may be called to determine if the message received by the last read operation is complete.
34982Until the call returns, the implementation will read incoming control frames and handle them automatically as follows:
34983
34984* The [link beast.ref.boost__beast__websocket__stream.control_callback `control_callback`] will be invoked for each control frame.
34985
34986* For each received ping frame, a pong frame will be automatically sent.
34987
34988* If a close frame is received, the WebSocket closing handshake is performed. In this case, when the function returns, the error [link beast.ref.boost__beast__websocket__error `error::closed`] will be indicated.
34989
34990[heading Return Value]
34991The number of message payload bytes appended to the buffer.
34992[heading Parameters]
34993[table [[Name][Description]]
34994  [
34995    [`buffer`
34996    ]
34997    [
34998A dynamic buffer to append message data to.
34999    ]
35000  ]
35001  [
35002    [`limit`
35003    ]
35004    [
35005An upper limit on the number of bytes this function will append into the buffer. If this value is zero, then a reasonable size will be chosen automatically.
35006    ]
35007  ]
35008  [
35009    [`ec`
35010    ]
35011    [
35012Set to indicate what error occurred, if any.
35013    ]
35014  ]
35015]
35016
35017[endsect]
35018
35019[section:overload3 websocket::stream::read_some (3 of 4 overloads)]
35020
35021Read some message data.
35022[heading Synopsis]
35023```
35024template<
35025    class __MutableBufferSequence__>
35026std::size_t
35027read_some(
35028    MutableBufferSequence const& buffers);
35029```
35030
35031[heading Description]
35032This function is used to read some message data.
35033The call blocks until one of the following is true:
35034
35035* Some message data is received.
35036
35037* A close frame is received. In this case the error indicated by the function will be [link beast.ref.boost__beast__websocket__error `error::closed`].
35038
35039* An error occurs.
35040
35041The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
35042The functions [link beast.ref.boost__beast__websocket__stream.got_binary `got_binary`] and [link beast.ref.boost__beast__websocket__stream.got_text `got_text`] may be used to query the stream and determine the type of the last received message. The function [link beast.ref.boost__beast__websocket__stream.is_message_done `is_message_done`] may be called to determine if the message received by the last read operation is complete.
35043Until the call returns, the implementation will read incoming control frames and handle them automatically as follows:
35044
35045* The [link beast.ref.boost__beast__websocket__stream.control_callback `control_callback`] will be invoked for each control frame.
35046
35047* For each received ping frame, a pong frame will be automatically sent.
35048
35049* If a close frame is received, the WebSocket closing handshake is performed. In this case, when the function returns, the error [link beast.ref.boost__beast__websocket__error `error::closed`] will be indicated.
35050
35051[heading Return Value]
35052The number of message payload bytes appended to the buffer.
35053[heading Parameters]
35054[table [[Name][Description]]
35055  [
35056    [`buffers`
35057    ]
35058    [
35059A buffer sequence to write message data into. The previous contents of the buffers will be overwritten, starting from the beginning.
35060    ]
35061  ]
35062]
35063[heading Exceptions]
35064[table [[Type][Thrown On]]
35065  [
35066    [`system_error`
35067    ]
35068    [
35069Thrown on failure.
35070    ]
35071  ]
35072]
35073
35074[endsect]
35075
35076[section:overload4 websocket::stream::read_some (4 of 4 overloads)]
35077
35078Read some message data.
35079[heading Synopsis]
35080```
35081template<
35082    class __MutableBufferSequence__>
35083std::size_t
35084read_some(
35085    MutableBufferSequence const& buffers,
35086    error_code& ec);
35087```
35088
35089[heading Description]
35090This function is used to read some message data.
35091The call blocks until one of the following is true:
35092
35093* Some message data is received.
35094
35095* A close frame is received. In this case the error indicated by the function will be [link beast.ref.boost__beast__websocket__error `error::closed`].
35096
35097* An error occurs.
35098
35099The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` and `write_some` functions.
35100The functions [link beast.ref.boost__beast__websocket__stream.got_binary `got_binary`] and [link beast.ref.boost__beast__websocket__stream.got_text `got_text`] may be used to query the stream and determine the type of the last received message. The function [link beast.ref.boost__beast__websocket__stream.is_message_done `is_message_done`] may be called to determine if the message received by the last read operation is complete.
35101Until the call returns, the implementation will read incoming control frames and handle them automatically as follows:
35102
35103* The [link beast.ref.boost__beast__websocket__stream.control_callback `control_callback`] will be invoked for each control frame.
35104
35105* For each received ping frame, a pong frame will be automatically sent.
35106
35107* If a close frame is received, the WebSocket closing handshake is performed. In this case, when the function returns, the error [link beast.ref.boost__beast__websocket__error `error::closed`] will be indicated.
35108
35109[heading Return Value]
35110The number of message payload bytes appended to the buffer.
35111[heading Parameters]
35112[table [[Name][Description]]
35113  [
35114    [`buffers`
35115    ]
35116    [
35117A buffer sequence to write message data into. The previous contents of the buffers will be overwritten, starting from the beginning.
35118    ]
35119  ]
35120  [
35121    [`ec`
35122    ]
35123    [
35124Set to indicate what error occurred, if any.
35125    ]
35126  ]
35127]
35128
35129[endsect]
35130
35131
35132[endsect]
35133
35134[section:async_read_some websocket::stream::async_read_some]
35135[indexterm2 async_read_some..websocket::stream]
35136
35137
35138Read some message data asynchronously.
35139```
35140template<
35141    class __DynamicBuffer__,
35142    class __ReadHandler__ = net::default_completion_token_t<                ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
35143``__deduced__``
35144``[link beast.ref.boost__beast__websocket__stream.async_read_some.overload1 async_read_some]``(
35145    DynamicBuffer& buffer,
35146    std::size_t limit,
35147    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
35148  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.async_read_some.overload1 `more...`]]``
35149
35150template<
35151    class __MutableBufferSequence__,
35152    class __ReadHandler__ = net::default_completion_token_t<                ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
35153``__deduced__``
35154``[link beast.ref.boost__beast__websocket__stream.async_read_some.overload2 async_read_some]``(
35155    MutableBufferSequence const& buffers,
35156    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
35157  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.async_read_some.overload2 `more...`]]``
35158```
35159
35160[section:overload1 websocket::stream::async_read_some (1 of 2 overloads)]
35161
35162Read some message data asynchronously.
35163[heading Synopsis]
35164```
35165template<
35166    class __DynamicBuffer__,
35167    class __ReadHandler__ = net::default_completion_token_t<                ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
35168``__deduced__``
35169async_read_some(
35170    DynamicBuffer& buffer,
35171    std::size_t limit,
35172    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
35173```
35174
35175[heading Description]
35176This function is used to asynchronously read some message data.
35177This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
35178
35179* Some message data is received.
35180
35181* A close frame is received. In this case the error indicated by the function will be [link beast.ref.boost__beast__websocket__error `error::closed`].
35182
35183* An error occurs.
35184
35185The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_read_some` and `async_write_some` functions. The program must ensure that no other calls to [link beast.ref.boost__beast__websocket__stream.read `read`], [link beast.ref.boost__beast__websocket__stream.read_some `read_some`], [link beast.ref.boost__beast__websocket__stream.async_read `async_read`], or [link beast.ref.boost__beast__websocket__stream.async_read_some `async_read_some`] are performed until this operation completes.
35186Received message data is appended to the buffer. The functions [link beast.ref.boost__beast__websocket__stream.got_binary `got_binary`] and [link beast.ref.boost__beast__websocket__stream.got_text `got_text`] may be used to query the stream and determine the type of the last received message.
35187Until the operation completes, the implementation will read incoming control frames and handle them automatically as follows:
35188
35189* The [link beast.ref.boost__beast__websocket__stream.control_callback `control_callback`] will be invoked for each control frame.
35190
35191* For each received ping frame, a pong frame will be automatically sent.
35192
35193* If a close frame is received, the WebSocket close procedure is performed. In this case, when the function returns, the error [link beast.ref.boost__beast__websocket__error `error::closed`] will be indicated.
35194
35195Pong frames and close frames sent by the implementation while the read operation is outstanding do not prevent the application from also writing message data, sending pings, sending pongs, or sending close frames.
35196
35197[heading Parameters]
35198[table [[Name][Description]]
35199  [
35200    [`buffer`
35201    ]
35202    [
35203A dynamic buffer to append message data to.
35204    ]
35205  ]
35206  [
35207    [`limit`
35208    ]
35209    [
35210An upper limit on the number of bytes this function will append into the buffer. If this value is zero, then a reasonable size will be chosen automatically.
35211    ]
35212  ]
35213  [
35214    [`handler`
35215    ]
35216    [
35217
35218The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
35219```
35220void handler(
35221    error_code const& ec,       // Result of operation
35222    std::size_t bytes_written   // Number of bytes appended to buffer
35223);
35224```
35225
35226Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
35227    ]
35228  ]
35229]
35230
35231[endsect]
35232
35233[section:overload2 websocket::stream::async_read_some (2 of 2 overloads)]
35234
35235Read some message data asynchronously.
35236[heading Synopsis]
35237```
35238template<
35239    class __MutableBufferSequence__,
35240    class __ReadHandler__ = net::default_completion_token_t<                ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
35241``__deduced__``
35242async_read_some(
35243    MutableBufferSequence const& buffers,
35244    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
35245```
35246
35247[heading Description]
35248This function is used to asynchronously read some message data.
35249This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
35250
35251* Some message data is received.
35252
35253* A close frame is received. In this case the error indicated by the function will be [link beast.ref.boost__beast__websocket__error `error::closed`].
35254
35255* An error occurs.
35256
35257The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_read_some` and `async_write_some` functions. The program must ensure that no other calls to [link beast.ref.boost__beast__websocket__stream.read `read`], [link beast.ref.boost__beast__websocket__stream.read_some `read_some`], [link beast.ref.boost__beast__websocket__stream.async_read `async_read`], or [link beast.ref.boost__beast__websocket__stream.async_read_some `async_read_some`] are performed until this operation completes.
35258Received message data is appended to the buffer. The functions [link beast.ref.boost__beast__websocket__stream.got_binary `got_binary`] and [link beast.ref.boost__beast__websocket__stream.got_text `got_text`] may be used to query the stream and determine the type of the last received message.
35259Until the operation completes, the implementation will read incoming control frames and handle them automatically as follows:
35260
35261* The [link beast.ref.boost__beast__websocket__stream.control_callback `control_callback`] will be invoked for each control frame.
35262
35263* For each received ping frame, a pong frame will be automatically sent.
35264
35265* If a close frame is received, the WebSocket close procedure is performed. In this case, when the function returns, the error [link beast.ref.boost__beast__websocket__error `error::closed`] will be indicated.
35266
35267Pong frames and close frames sent by the implementation while the read operation is outstanding do not prevent the application from also writing message data, sending pings, sending pongs, or sending close frames.
35268
35269[heading Parameters]
35270[table [[Name][Description]]
35271  [
35272    [`buffers`
35273    ]
35274    [
35275A buffer sequence to write message data into. The previous contents of the buffers will be overwritten, starting from the beginning. The implementation will make copies of this object as needed, but but ownership of the underlying memory is not transferred. The caller is responsible for ensuring that the memory locations pointed to by the buffer sequence remain valid until the completion handler is called.
35276    ]
35277  ]
35278  [
35279    [`handler`
35280    ]
35281    [
35282
35283The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
35284```
35285void handler(
35286    error_code const& ec,       // Result of operation
35287    std::size_t bytes_written   // Number of bytes written to the buffers
35288);
35289```
35290
35291Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
35292    ]
35293  ]
35294]
35295
35296[endsect]
35297
35298
35299[endsect]
35300
35301[section:write websocket::stream::write]
35302[indexterm2 write..websocket::stream]
35303
35304
35305Write a complete message.
35306```
35307template<
35308    class __ConstBufferSequence__>
35309std::size_t
35310``[link beast.ref.boost__beast__websocket__stream.write.overload1 write]``(
35311    ConstBufferSequence const& buffers);
35312  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.write.overload1 `more...`]]``
35313
35314template<
35315    class __ConstBufferSequence__>
35316std::size_t
35317``[link beast.ref.boost__beast__websocket__stream.write.overload2 write]``(
35318    ConstBufferSequence const& buffers,
35319    error_code& ec);
35320  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.write.overload2 `more...`]]``
35321```
35322
35323[section:overload1 websocket::stream::write (1 of 2 overloads)]
35324
35325Write a complete message.
35326[heading Synopsis]
35327```
35328template<
35329    class __ConstBufferSequence__>
35330std::size_t
35331write(
35332    ConstBufferSequence const& buffers);
35333```
35334
35335[heading Description]
35336This function is used to write a complete message.
35337The call blocks until one of the following is true:
35338
35339* The message is written.
35340
35341* An error occurs.
35342
35343The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `write_some` function.
35344The current setting of the [link beast.ref.boost__beast__websocket__stream.binary `binary`] option controls whether the message opcode is set to text or binary. If the [link beast.ref.boost__beast__websocket__stream.auto_fragment `auto_fragment`] option is set, the message will be split into one or more frames as necessary. The actual payload contents sent may be transformed as per the WebSocket protocol settings.
35345
35346[heading Parameters]
35347[table [[Name][Description]]
35348  [
35349    [`buffers`
35350    ]
35351    [
35352The buffers containing the message to send.
35353    ]
35354  ]
35355]
35356[heading Return Value]
35357The number of bytes sent from the buffers.
35358[heading Exceptions]
35359[table [[Type][Thrown On]]
35360  [
35361    [`system_error`
35362    ]
35363    [
35364Thrown on failure.
35365    ]
35366  ]
35367]
35368
35369[endsect]
35370
35371[section:overload2 websocket::stream::write (2 of 2 overloads)]
35372
35373Write a complete message.
35374[heading Synopsis]
35375```
35376template<
35377    class __ConstBufferSequence__>
35378std::size_t
35379write(
35380    ConstBufferSequence const& buffers,
35381    error_code& ec);
35382```
35383
35384[heading Description]
35385This function is used to write a complete message.
35386The call blocks until one of the following is true:
35387
35388* The complete message is written.
35389
35390* An error occurs.
35391
35392The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `write_some` function.
35393The current setting of the [link beast.ref.boost__beast__websocket__stream.binary `binary`] option controls whether the message opcode is set to text or binary. If the [link beast.ref.boost__beast__websocket__stream.auto_fragment `auto_fragment`] option is set, the message will be split into one or more frames as necessary. The actual payload contents sent may be transformed as per the WebSocket protocol settings.
35394
35395[heading Parameters]
35396[table [[Name][Description]]
35397  [
35398    [`buffers`
35399    ]
35400    [
35401The buffers containing the message to send.
35402    ]
35403  ]
35404  [
35405    [`ec`
35406    ]
35407    [
35408Set to indicate what error occurred, if any.
35409    ]
35410  ]
35411]
35412[heading Return Value]
35413The number of bytes sent from the buffers.
35414
35415[endsect]
35416
35417
35418[endsect]
35419
35420[section:async_write websocket::stream::async_write]
35421[indexterm2 async_write..websocket::stream]
35422
35423
35424Write a complete message asynchronously.
35425[heading Synopsis]
35426```
35427template<
35428    class __ConstBufferSequence__,
35429    class __WriteHandler__ = net::default_completion_token_t<                ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
35430``__deduced__``
35431async_write(
35432    ConstBufferSequence const& buffers,
35433    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
35434```
35435
35436[heading Description]
35437This function is used to asynchronously write a complete message.
35438This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
35439
35440* The complete message is written.
35441
35442* An error occurs.
35443
35444The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_write_some` function. The program must ensure that no other calls to [link beast.ref.boost__beast__websocket__stream.write `write`], [link beast.ref.boost__beast__websocket__stream.write_some `write_some`], [link beast.ref.boost__beast__websocket__stream.async_write `async_write`], or [link beast.ref.boost__beast__websocket__stream.async_write_some `async_write_some`] are performed until this operation completes.
35445The current setting of the [link beast.ref.boost__beast__websocket__stream.binary `binary`] option controls whether the message opcode is set to text or binary. If the [link beast.ref.boost__beast__websocket__stream.auto_fragment `auto_fragment`] option is set, the message will be split into one or more frames as necessary. The actual payload contents sent may be transformed as per the WebSocket protocol settings.
35446
35447[heading Parameters]
35448[table [[Name][Description]]
35449  [
35450    [`buffers`
35451    ]
35452    [
35453A buffer sequence containing the entire message payload. The implementation will make copies of this object as needed, but ownership of the underlying memory is not transferred. The caller is responsible for ensuring that the memory locations pointed to by buffers remains valid until the completion handler is called.
35454    ]
35455  ]
35456  [
35457    [`handler`
35458    ]
35459    [
35460
35461The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
35462```
35463void handler(
35464    error_code const& ec,           // Result of operation
35465    std::size_t bytes_transferred   // Number of bytes sent from the
35466                                    // buffers. If an error occurred,
35467                                    // this will be less than the buffer_size.
35468);
35469```
35470
35471Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
35472    ]
35473  ]
35474]
35475
35476[endsect]
35477
35478[section:write_some websocket::stream::write_some]
35479[indexterm2 write_some..websocket::stream]
35480
35481
35482Write some message data.
35483```
35484template<
35485    class __ConstBufferSequence__>
35486std::size_t
35487``[link beast.ref.boost__beast__websocket__stream.write_some.overload1 write_some]``(
35488    bool fin,
35489    ConstBufferSequence const& buffers);
35490  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.write_some.overload1 `more...`]]``
35491
35492template<
35493    class __ConstBufferSequence__>
35494std::size_t
35495``[link beast.ref.boost__beast__websocket__stream.write_some.overload2 write_some]``(
35496    bool fin,
35497    ConstBufferSequence const& buffers,
35498    error_code& ec);
35499  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__stream.write_some.overload2 `more...`]]``
35500```
35501
35502[section:overload1 websocket::stream::write_some (1 of 2 overloads)]
35503
35504Write some message data.
35505[heading Synopsis]
35506```
35507template<
35508    class __ConstBufferSequence__>
35509std::size_t
35510write_some(
35511    bool fin,
35512    ConstBufferSequence const& buffers);
35513```
35514
35515[heading Description]
35516This function is used to send part of a message.
35517The call blocks until one of the following is true:
35518
35519* The message data is written.
35520
35521* An error occurs.
35522
35523The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `write_some` function.
35524If this is the beginning of a new message, the message opcode will be set to text or binary based on the current setting of the [link beast.ref.boost__beast__websocket__stream.binary `binary`] (or [link beast.ref.boost__beast__websocket__stream.text `text`]) option. The actual payload sent may be transformed as per the WebSocket protocol settings.
35525
35526[heading Parameters]
35527[table [[Name][Description]]
35528  [
35529    [`fin`
35530    ]
35531    [
35532`true` if this is the last part of the message.
35533    ]
35534  ]
35535  [
35536    [`buffers`
35537    ]
35538    [
35539The buffers containing the message part to send.
35540    ]
35541  ]
35542]
35543[heading Return Value]
35544The number of bytes sent from the buffers.
35545[heading Exceptions]
35546[table [[Type][Thrown On]]
35547  [
35548    [`system_error`
35549    ]
35550    [
35551Thrown on failure.
35552    ]
35553  ]
35554]
35555
35556[endsect]
35557
35558[section:overload2 websocket::stream::write_some (2 of 2 overloads)]
35559
35560Write some message data.
35561[heading Synopsis]
35562```
35563template<
35564    class __ConstBufferSequence__>
35565std::size_t
35566write_some(
35567    bool fin,
35568    ConstBufferSequence const& buffers,
35569    error_code& ec);
35570```
35571
35572[heading Description]
35573This function is used to send part of a message.
35574The call blocks until one of the following is true:
35575
35576* The message data is written.
35577
35578* An error occurs.
35579
35580The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `write_some` function.
35581If this is the beginning of a new message, the message opcode will be set to text or binary based on the current setting of the [link beast.ref.boost__beast__websocket__stream.binary `binary`] (or [link beast.ref.boost__beast__websocket__stream.text `text`]) option. The actual payload sent may be transformed as per the WebSocket protocol settings.
35582
35583[heading Parameters]
35584[table [[Name][Description]]
35585  [
35586    [`fin`
35587    ]
35588    [
35589`true` if this is the last part of the message.
35590    ]
35591  ]
35592  [
35593    [`buffers`
35594    ]
35595    [
35596The buffers containing the message part to send.
35597    ]
35598  ]
35599  [
35600    [`ec`
35601    ]
35602    [
35603Set to indicate what error occurred, if any.
35604    ]
35605  ]
35606]
35607[heading Return Value]
35608The number of bytes sent from the buffers.
35609[heading Return Value]
35610The number of bytes consumed in the input buffers.
35611
35612[endsect]
35613
35614
35615[endsect]
35616
35617[section:async_write_some websocket::stream::async_write_some]
35618[indexterm2 async_write_some..websocket::stream]
35619
35620
35621Write some message data asynchronously.
35622[heading Synopsis]
35623```
35624template<
35625    class __ConstBufferSequence__,
35626    class __WriteHandler__ = net::default_completion_token_t<                ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]``>>
35627``__deduced__``
35628async_write_some(
35629    bool fin,
35630    ConstBufferSequence const& buffers,
35631    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__websocket__stream.executor_type executor_type]`` >{});
35632```
35633
35634[heading Description]
35635This function is used to asynchronously write part of a message.
35636This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
35637
35638* The message data is written.
35639
35640* An error occurs.
35641
35642The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_write_some` function. The program must ensure that no other calls to [link beast.ref.boost__beast__websocket__stream.write `write`], [link beast.ref.boost__beast__websocket__stream.write_some `write_some`], [link beast.ref.boost__beast__websocket__stream.async_write `async_write`], or [link beast.ref.boost__beast__websocket__stream.async_write_some `async_write_some`] are performed until this operation completes.
35643If this is the beginning of a new message, the message opcode will be set to text or binary based on the current setting of the [link beast.ref.boost__beast__websocket__stream.binary `binary`] (or [link beast.ref.boost__beast__websocket__stream.text `text`]) option. The actual payload sent may be transformed as per the WebSocket protocol settings.
35644
35645[heading Parameters]
35646[table [[Name][Description]]
35647  [
35648    [`fin`
35649    ]
35650    [
35651`true` if this is the last part of the message.
35652    ]
35653  ]
35654  [
35655    [`buffers`
35656    ]
35657    [
35658The buffers containing the message part to send. The implementation will make copies of this object as needed, but ownership of the underlying memory is not transferred. The caller is responsible for ensuring that the memory locations pointed to by buffers remains valid until the completion handler is called.
35659    ]
35660  ]
35661  [
35662    [`handler`
35663    ]
35664    [
35665
35666The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
35667```
35668void handler(
35669    error_code const& ec,           // Result of operation
35670    std::size_t bytes_transferred   // Number of bytes sent from the
35671                                    // buffers. If an error occurred,
35672                                    // this will be less than the buffer_size.
35673);
35674```
35675
35676Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
35677    ]
35678  ]
35679]
35680
35681[endsect]
35682
35683
35684[endsect]
35685
35686[section:boost__beast__test__stream test::stream]
35687
35688A two-way socket useful for unit testing.
35689[heading Synopsis]
35690Defined in header [include_file boost/beast/_experimental/test/stream.hpp]
35691
35692```
35693class stream
35694```
35695
35696[heading Types]
35697[table [[Name][Description]]
35698  [
35699    [[*[link beast.ref.boost__beast__test__stream.buffer_type buffer_type]]
35700    ]
35701    [
35702
35703    ]
35704  ]
35705  [
35706    [[*[link beast.ref.boost__beast__test__stream.executor_type executor_type]]
35707    ]
35708    [
35709
35710The type of the executor associated with the object.
35711    ]
35712  ]
35713]
35714[heading Member Functions]
35715[table [[Name][Description]]
35716  [
35717    [[*[link beast.ref.boost__beast__test__stream.append append]]
35718    ]
35719    [
35720
35721Appends a string to the pending input data.
35722    ]
35723  ]
35724  [
35725    [[*[link beast.ref.boost__beast__test__stream.async_read_some async_read_some]]
35726    ]
35727    [
35728
35729Start an asynchronous read.
35730    ]
35731  ]
35732  [
35733    [[*[link beast.ref.boost__beast__test__stream.async_write_some async_write_some]]
35734    ]
35735    [
35736
35737Start an asynchronous write.
35738    ]
35739  ]
35740  [
35741    [[*[link beast.ref.boost__beast__test__stream.buffer buffer]]
35742    ]
35743    [
35744
35745Direct input buffer access.
35746    ]
35747  ]
35748  [
35749    [[*[link beast.ref.boost__beast__test__stream.clear clear]]
35750    ]
35751    [
35752
35753Clear the pending input area.
35754    ]
35755  ]
35756  [
35757    [[*[link beast.ref.boost__beast__test__stream.close close]]
35758    ]
35759    [
35760
35761Close the stream.
35762    ]
35763  ]
35764  [
35765    [[*[link beast.ref.boost__beast__test__stream.close_remote close_remote]]
35766    ]
35767    [
35768
35769Close the other end of the stream.
35770    ]
35771  ]
35772  [
35773    [[*[link beast.ref.boost__beast__test__stream.connect connect]]
35774    ]
35775    [
35776
35777Establish a connection.
35778    ]
35779  ]
35780  [
35781    [[*[link beast.ref.boost__beast__test__stream.get_executor get_executor]]
35782    ]
35783    [
35784
35785Return the executor associated with the object.
35786    ]
35787  ]
35788  [
35789    [[*[link beast.ref.boost__beast__test__stream.nread nread]]
35790    ]
35791    [
35792
35793Return the number of reads.
35794    ]
35795  ]
35796  [
35797    [[*[link beast.ref.boost__beast__test__stream.nread_bytes nread_bytes]]
35798    ]
35799    [
35800
35801Return the number of bytes read.
35802    ]
35803  ]
35804  [
35805    [[*[link beast.ref.boost__beast__test__stream.nwrite nwrite]]
35806    ]
35807    [
35808
35809Return the number of writes.
35810    ]
35811  ]
35812  [
35813    [[*[link beast.ref.boost__beast__test__stream.nwrite_bytes nwrite_bytes]]
35814    ]
35815    [
35816
35817Return the number of bytes written.
35818    ]
35819  ]
35820  [
35821    [[*[link beast.ref.boost__beast__test__stream.operator_eq_ operator=]]
35822    ]
35823    [
35824
35825Move Assignment.
35826    ]
35827  ]
35828  [
35829    [[*[link beast.ref.boost__beast__test__stream.read_size read_size]]
35830    ]
35831    [
35832
35833Set the maximum number of bytes returned by read_some.
35834    ]
35835  ]
35836  [
35837    [[*[link beast.ref.boost__beast__test__stream.read_some read_some]]
35838    ]
35839    [
35840
35841Read some data from the stream.
35842    ]
35843  ]
35844  [
35845    [[*[link beast.ref.boost__beast__test__stream.str str]]
35846    ]
35847    [
35848
35849Returns a string view representing the pending input data.
35850    ]
35851  ]
35852  [
35853    [[*[link beast.ref.boost__beast__test__stream.stream stream]]
35854    ]
35855    [
35856
35857Move Constructor.
35858
35859Construct a stream.
35860    ]
35861  ]
35862  [
35863    [[*[link beast.ref.boost__beast__test__stream.write_size write_size]]
35864    ]
35865    [
35866
35867Set the maximum number of bytes returned by write_some.
35868    ]
35869  ]
35870  [
35871    [[*[link beast.ref.boost__beast__test__stream.write_some write_some]]
35872    ]
35873    [
35874
35875Write some data to the stream.
35876    ]
35877  ]
35878  [
35879    [[*[link beast.ref.boost__beast__test__stream._stream ~stream]]
35880    ]
35881    [
35882
35883Destructor.
35884    ]
35885  ]
35886]
35887[heading Description]
35888An instance of this class simulates a traditional socket, while also providing features useful for unit testing. Each endpoint maintains an independent buffer called the input area. Writes from one endpoint append data to the peer's pending input area. When an endpoint performs a read and data is present in the input area, the data is delivered to the blocking or asynchronous operation. Otherwise the operation is blocked or deferred until data is made available, or until the endpoints become disconnected.
35889These streams may be used anywhere an algorithm accepts a reference to a synchronous or asynchronous read or write stream. It is possible to use a test stream in a call to `net::read_until`, or in a call to [link beast.ref.boost__beast__http__async_write `boost::beast::http::async_write`] for example.
35890As with Boost.Asio I/O objects, a [link beast.ref.boost__beast__test__stream `stream`] constructs with a reference to the `net::io_context` to use for handling asynchronous I/O. For asynchronous operations, the stream follows the same rules as a traditional asio socket with respect to how completion handlers for asynchronous operations are performed.
35891To facilitate testing, these streams support some additional features:
35892
35893* The input area, represented by a [link beast.ref.boost__beast__basic_flat_buffer `beast::basic_flat_buffer`], may be directly accessed by the caller to inspect the contents before or after the remote endpoint writes data. This allows a unit test to verify that the received data matches.
35894
35895* Data may be manually appended to the input area. This data will delivered in the next call to [link beast.ref.boost__beast__test__stream.read_some `stream::read_some`] or [link beast.ref.boost__beast__test__stream.async_read_some `stream::async_read_some`]. This allows predefined test vectors to be set up for testing read algorithms.
35896
35897* The stream may be constructed with a fail count. The stream will eventually fail with a predefined error after a certain number of operations, where the number of operations is controlled by the test. When a test loops over a range of operation counts, it is possible to exercise every possible point of failure in the algorithm being tested. When used correctly the technique allows the tests to reach a high percentage of code coverage.
35898
35899[heading Thread Safety]
35900
35901['Distinct]['objects:]Safe.
35902
35903
35904['Shared]['objects:]Unsafe. The application must also ensure that all asynchronous operations are performed within the same implicit or explicit strand.
35905
35906[section:buffer_type test::stream::buffer_type]
35907[indexterm2 buffer_type..test::stream]
35908
35909
35910[heading Synopsis]
35911```
35912using buffer_type = flat_buffer;
35913```
35914
35915[heading Description]
35916
35917[endsect]
35918
35919[section:executor_type test::stream::executor_type]
35920[indexterm2 executor_type..test::stream]
35921
35922
35923The type of the executor associated with the object.
35924[heading Synopsis]
35925```
35926using executor_type = net::io_context::executor_type;
35927```
35928
35929[heading Description]
35930
35931[endsect]
35932
35933[section:_stream test::stream::~stream]
35934[indexterm2 ~stream..test::stream]
35935
35936
35937Destructor.
35938[heading Synopsis]
35939```
35940~stream();
35941```
35942
35943[heading Description]
35944If an asynchronous read operation is pending, it will simply be discarded with no notification to the completion handler.
35945If a connection is established while the stream is destroyed, the peer will see the error `net::error::connection_reset` when performing any reads or writes.
35946
35947[endsect]
35948
35949[section:stream test::stream::stream]
35950[indexterm2 stream..test::stream]
35951
35952
35953Move Constructor.
35954```
35955``[link beast.ref.boost__beast__test__stream.stream.overload1 stream]``(
35956    stream&& other);
35957  ``[''''&raquo;''' [link beast.ref.boost__beast__test__stream.stream.overload1 `more...`]]``
35958```
35959
35960
35961Construct a stream.
35962```
35963explicit
35964``[link beast.ref.boost__beast__test__stream.stream.overload2 stream]``(
35965    net::io_context& ioc);
35966  ``[''''&raquo;''' [link beast.ref.boost__beast__test__stream.stream.overload2 `more...`]]``
35967
35968``[link beast.ref.boost__beast__test__stream.stream.overload3 stream]``(
35969    net::io_context& ioc,
35970    fail_count& fc);
35971  ``[''''&raquo;''' [link beast.ref.boost__beast__test__stream.stream.overload3 `more...`]]``
35972
35973``[link beast.ref.boost__beast__test__stream.stream.overload4 stream]``(
35974    net::io_context& ioc,
35975    string_view s);
35976  ``[''''&raquo;''' [link beast.ref.boost__beast__test__stream.stream.overload4 `more...`]]``
35977
35978``[link beast.ref.boost__beast__test__stream.stream.overload5 stream]``(
35979    net::io_context& ioc,
35980    fail_count& fc,
35981    string_view s);
35982  ``[''''&raquo;''' [link beast.ref.boost__beast__test__stream.stream.overload5 `more...`]]``
35983```
35984
35985[section:overload1 test::stream::stream (1 of 5 overloads)]
35986
35987Move Constructor.
35988[heading Synopsis]
35989```
35990stream(
35991    stream&& other);
35992```
35993
35994[heading Description]
35995Moving the stream while asynchronous operations are pending results in undefined behavior.
35996
35997[endsect]
35998
35999[section:overload2 test::stream::stream (2 of 5 overloads)]
36000
36001Construct a stream.
36002[heading Synopsis]
36003```
36004stream(
36005    net::io_context& ioc);
36006```
36007
36008[heading Description]
36009The stream will be created in a disconnected state.
36010
36011[heading Parameters]
36012[table [[Name][Description]]
36013  [
36014    [`ioc`
36015    ]
36016    [
36017The `io_context` object that the stream will use to dispatch handlers for any asynchronous operations.
36018    ]
36019  ]
36020]
36021
36022[endsect]
36023
36024[section:overload3 test::stream::stream (3 of 5 overloads)]
36025
36026Construct a stream.
36027[heading Synopsis]
36028```
36029stream(
36030    net::io_context& ioc,
36031    fail_count& fc);
36032```
36033
36034[heading Description]
36035The stream will be created in a disconnected state.
36036
36037[heading Parameters]
36038[table [[Name][Description]]
36039  [
36040    [`ioc`
36041    ]
36042    [
36043The `io_context` object that the stream will use to dispatch handlers for any asynchronous operations.
36044    ]
36045  ]
36046  [
36047    [`fc`
36048    ]
36049    [
36050The [link beast.ref.boost__beast__test__fail_count `fail_count`] to associate with the stream. Each I/O operation performed on the stream will increment the fail count. When the fail count reaches its internal limit, a simulated failure error will be raised.
36051    ]
36052  ]
36053]
36054
36055[endsect]
36056
36057[section:overload4 test::stream::stream (4 of 5 overloads)]
36058
36059Construct a stream.
36060[heading Synopsis]
36061```
36062stream(
36063    net::io_context& ioc,
36064    string_view s);
36065```
36066
36067[heading Description]
36068The stream will be created in a disconnected state.
36069
36070[heading Parameters]
36071[table [[Name][Description]]
36072  [
36073    [`ioc`
36074    ]
36075    [
36076The `io_context` object that the stream will use to dispatch handlers for any asynchronous operations.
36077    ]
36078  ]
36079  [
36080    [`s`
36081    ]
36082    [
36083A string which will be appended to the input area, not including the null terminator.
36084    ]
36085  ]
36086]
36087
36088[endsect]
36089
36090[section:overload5 test::stream::stream (5 of 5 overloads)]
36091
36092Construct a stream.
36093[heading Synopsis]
36094```
36095stream(
36096    net::io_context& ioc,
36097    fail_count& fc,
36098    string_view s);
36099```
36100
36101[heading Description]
36102The stream will be created in a disconnected state.
36103
36104[heading Parameters]
36105[table [[Name][Description]]
36106  [
36107    [`ioc`
36108    ]
36109    [
36110The `io_context` object that the stream will use to dispatch handlers for any asynchronous operations.
36111    ]
36112  ]
36113  [
36114    [`fc`
36115    ]
36116    [
36117The [link beast.ref.boost__beast__test__fail_count `fail_count`] to associate with the stream. Each I/O operation performed on the stream will increment the fail count. When the fail count reaches its internal limit, a simulated failure error will be raised.
36118    ]
36119  ]
36120  [
36121    [`s`
36122    ]
36123    [
36124A string which will be appended to the input area, not including the null terminator.
36125    ]
36126  ]
36127]
36128
36129[endsect]
36130
36131
36132[endsect]
36133
36134[section:operator_eq_ test::stream::operator=]
36135[indexterm2 operator=..test::stream]
36136
36137
36138Move Assignment.
36139[heading Synopsis]
36140```
36141stream&
36142operator=(
36143    stream&& other);
36144```
36145
36146[heading Description]
36147Moving the stream while asynchronous operations are pending results in undefined behavior.
36148
36149[endsect]
36150
36151[section:connect test::stream::connect]
36152[indexterm2 connect..test::stream]
36153
36154
36155Establish a connection.
36156[heading Synopsis]
36157```
36158void
36159connect(
36160    stream& remote);
36161```
36162
36163[heading Description]
36164
36165[endsect]
36166
36167[section:get_executor test::stream::get_executor]
36168[indexterm2 get_executor..test::stream]
36169
36170
36171Return the executor associated with the object.
36172[heading Synopsis]
36173```
36174executor_type
36175get_executor();
36176```
36177
36178[heading Description]
36179
36180[endsect]
36181
36182[section:read_size test::stream::read_size]
36183[indexterm2 read_size..test::stream]
36184
36185
36186Set the maximum number of bytes returned by read_some.
36187[heading Synopsis]
36188```
36189void
36190read_size(
36191    std::size_t n);
36192```
36193
36194[heading Description]
36195
36196[endsect]
36197
36198[section:write_size test::stream::write_size]
36199[indexterm2 write_size..test::stream]
36200
36201
36202Set the maximum number of bytes returned by write_some.
36203[heading Synopsis]
36204```
36205void
36206write_size(
36207    std::size_t n);
36208```
36209
36210[heading Description]
36211
36212[endsect]
36213
36214[section:buffer test::stream::buffer]
36215[indexterm2 buffer..test::stream]
36216
36217
36218Direct input buffer access.
36219[heading Synopsis]
36220```
36221buffer_type&
36222buffer();
36223```
36224
36225[heading Description]
36226
36227[endsect]
36228
36229[section:str test::stream::str]
36230[indexterm2 str..test::stream]
36231
36232
36233Returns a string view representing the pending input data.
36234[heading Synopsis]
36235```
36236string_view
36237str() const;
36238```
36239
36240[heading Description]
36241
36242[endsect]
36243
36244[section:append test::stream::append]
36245[indexterm2 append..test::stream]
36246
36247
36248Appends a string to the pending input data.
36249[heading Synopsis]
36250```
36251void
36252append(
36253    string_view s);
36254```
36255
36256[heading Description]
36257
36258[endsect]
36259
36260[section:clear test::stream::clear]
36261[indexterm2 clear..test::stream]
36262
36263
36264Clear the pending input area.
36265[heading Synopsis]
36266```
36267void
36268clear();
36269```
36270
36271[heading Description]
36272
36273[endsect]
36274
36275[section:nread test::stream::nread]
36276[indexterm2 nread..test::stream]
36277
36278
36279Return the number of reads.
36280[heading Synopsis]
36281```
36282std::size_t
36283nread() const;
36284```
36285
36286[heading Description]
36287
36288[endsect]
36289
36290[section:nread_bytes test::stream::nread_bytes]
36291[indexterm2 nread_bytes..test::stream]
36292
36293
36294Return the number of bytes read.
36295[heading Synopsis]
36296```
36297std::size_t
36298nread_bytes() const;
36299```
36300
36301[heading Description]
36302
36303[endsect]
36304
36305[section:nwrite test::stream::nwrite]
36306[indexterm2 nwrite..test::stream]
36307
36308
36309Return the number of writes.
36310[heading Synopsis]
36311```
36312std::size_t
36313nwrite() const;
36314```
36315
36316[heading Description]
36317
36318[endsect]
36319
36320[section:nwrite_bytes test::stream::nwrite_bytes]
36321[indexterm2 nwrite_bytes..test::stream]
36322
36323
36324Return the number of bytes written.
36325[heading Synopsis]
36326```
36327std::size_t
36328nwrite_bytes() const;
36329```
36330
36331[heading Description]
36332
36333[endsect]
36334
36335[section:close test::stream::close]
36336[indexterm2 close..test::stream]
36337
36338
36339Close the stream.
36340[heading Synopsis]
36341```
36342void
36343close();
36344```
36345
36346[heading Description]
36347The other end of the connection will see `error::eof` after reading all the remaining data.
36348
36349[endsect]
36350
36351[section:close_remote test::stream::close_remote]
36352[indexterm2 close_remote..test::stream]
36353
36354
36355Close the other end of the stream.
36356[heading Synopsis]
36357```
36358void
36359close_remote();
36360```
36361
36362[heading Description]
36363This end of the connection will see `error::eof` after reading all the remaining data.
36364
36365[endsect]
36366
36367[section:read_some test::stream::read_some]
36368[indexterm2 read_some..test::stream]
36369
36370
36371Read some data from the stream.
36372```
36373template<
36374    class __MutableBufferSequence__>
36375std::size_t
36376``[link beast.ref.boost__beast__test__stream.read_some.overload1 read_some]``(
36377    MutableBufferSequence const& buffers);
36378  ``[''''&raquo;''' [link beast.ref.boost__beast__test__stream.read_some.overload1 `more...`]]``
36379
36380template<
36381    class __MutableBufferSequence__>
36382std::size_t
36383``[link beast.ref.boost__beast__test__stream.read_some.overload2 read_some]``(
36384    MutableBufferSequence const& buffers,
36385    error_code& ec);
36386  ``[''''&raquo;''' [link beast.ref.boost__beast__test__stream.read_some.overload2 `more...`]]``
36387```
36388
36389[section:overload1 test::stream::read_some (1 of 2 overloads)]
36390
36391Read some data from the stream.
36392[heading Synopsis]
36393```
36394template<
36395    class __MutableBufferSequence__>
36396std::size_t
36397read_some(
36398    MutableBufferSequence const& buffers);
36399```
36400
36401[heading Description]
36402This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
36403
36404[heading Parameters]
36405[table [[Name][Description]]
36406  [
36407    [`buffers`
36408    ]
36409    [
36410The buffers into which the data will be read.
36411    ]
36412  ]
36413]
36414[heading Return Value]
36415The number of bytes read.
36416[heading Exceptions]
36417[table [[Type][Thrown On]]
36418  [
36419    [`boost::system::system_error`
36420    ]
36421    [
36422Thrown on failure.
36423    ]
36424  ]
36425]
36426[heading Remarks]
36427The `read_some` operation may not read all of the requested number of bytes. Consider using the function [link beast.ref.boost__beast__file_mode `net::read`] if you need to ensure that the requested amount of data is read before the blocking operation completes.
36428
36429[endsect]
36430
36431[section:overload2 test::stream::read_some (2 of 2 overloads)]
36432
36433Read some data from the stream.
36434[heading Synopsis]
36435```
36436template<
36437    class __MutableBufferSequence__>
36438std::size_t
36439read_some(
36440    MutableBufferSequence const& buffers,
36441    error_code& ec);
36442```
36443
36444[heading Description]
36445This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
36446
36447[heading Parameters]
36448[table [[Name][Description]]
36449  [
36450    [`buffers`
36451    ]
36452    [
36453The buffers into which the data will be read.
36454    ]
36455  ]
36456  [
36457    [`ec`
36458    ]
36459    [
36460Set to indicate what error occurred, if any.
36461    ]
36462  ]
36463]
36464[heading Return Value]
36465The number of bytes read.
36466[heading Remarks]
36467The `read_some` operation may not read all of the requested number of bytes. Consider using the function [link beast.ref.boost__beast__file_mode `net::read`] if you need to ensure that the requested amount of data is read before the blocking operation completes.
36468
36469[endsect]
36470
36471
36472[endsect]
36473
36474[section:async_read_some test::stream::async_read_some]
36475[indexterm2 async_read_some..test::stream]
36476
36477
36478Start an asynchronous read.
36479[heading Synopsis]
36480```
36481template<
36482    class __MutableBufferSequence__,
36483    class __ReadHandler__>
36484``__deduced__``
36485async_read_some(
36486    MutableBufferSequence const& buffers,
36487    ReadHandler&& handler);
36488```
36489
36490[heading Description]
36491This function is used to asynchronously read one or more bytes of data from the stream. The function call always returns immediately.
36492
36493[heading Parameters]
36494[table [[Name][Description]]
36495  [
36496    [`buffers`
36497    ]
36498    [
36499The buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.
36500    ]
36501  ]
36502  [
36503    [`handler`
36504    ]
36505    [
36506
36507The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
36508```
36509void handler(
36510    error_code const& ec,           // Result of operation.
36511    std::size_t bytes_transferred   // Number of bytes read.
36512);
36513```
36514
36515Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
36516    ]
36517  ]
36518]
36519[heading Remarks]
36520The `async_read_some` operation may not read all of the requested number of bytes. Consider using the function `net::async_read` if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
36521
36522[endsect]
36523
36524[section:write_some test::stream::write_some]
36525[indexterm2 write_some..test::stream]
36526
36527
36528Write some data to the stream.
36529```
36530template<
36531    class __ConstBufferSequence__>
36532std::size_t
36533``[link beast.ref.boost__beast__test__stream.write_some.overload1 write_some]``(
36534    ConstBufferSequence const& buffers);
36535  ``[''''&raquo;''' [link beast.ref.boost__beast__test__stream.write_some.overload1 `more...`]]``
36536
36537template<
36538    class __ConstBufferSequence__>
36539std::size_t
36540``[link beast.ref.boost__beast__test__stream.write_some.overload2 write_some]``(
36541    ConstBufferSequence const& buffers,
36542    error_code& ec);
36543  ``[''''&raquo;''' [link beast.ref.boost__beast__test__stream.write_some.overload2 `more...`]]``
36544```
36545
36546[section:overload1 test::stream::write_some (1 of 2 overloads)]
36547
36548Write some data to the stream.
36549[heading Synopsis]
36550```
36551template<
36552    class __ConstBufferSequence__>
36553std::size_t
36554write_some(
36555    ConstBufferSequence const& buffers);
36556```
36557
36558[heading Description]
36559This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
36560
36561[heading Parameters]
36562[table [[Name][Description]]
36563  [
36564    [`buffers`
36565    ]
36566    [
36567The data to be written.
36568    ]
36569  ]
36570]
36571[heading Return Value]
36572The number of bytes written.
36573[heading Exceptions]
36574[table [[Type][Thrown On]]
36575  [
36576    [`boost::system::system_error`
36577    ]
36578    [
36579Thrown on failure.
36580    ]
36581  ]
36582]
36583[heading Remarks]
36584The `write_some` operation may not transmit all of the data to the peer. Consider using the function [link beast.ref.boost__beast__file_mode `net::write`] if you need to ensure that all data is written before the blocking operation completes.
36585
36586[endsect]
36587
36588[section:overload2 test::stream::write_some (2 of 2 overloads)]
36589
36590Write some data to the stream.
36591[heading Synopsis]
36592```
36593template<
36594    class __ConstBufferSequence__>
36595std::size_t
36596write_some(
36597    ConstBufferSequence const& buffers,
36598    error_code& ec);
36599```
36600
36601[heading Description]
36602This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
36603
36604[heading Parameters]
36605[table [[Name][Description]]
36606  [
36607    [`buffers`
36608    ]
36609    [
36610The data to be written.
36611    ]
36612  ]
36613  [
36614    [`ec`
36615    ]
36616    [
36617Set to indicate what error occurred, if any.
36618    ]
36619  ]
36620]
36621[heading Return Value]
36622The number of bytes written.
36623[heading Remarks]
36624The `write_some` operation may not transmit all of the data to the peer. Consider using the function [link beast.ref.boost__beast__file_mode `net::write`] if you need to ensure that all data is written before the blocking operation completes.
36625
36626[endsect]
36627
36628
36629[endsect]
36630
36631[section:async_write_some test::stream::async_write_some]
36632[indexterm2 async_write_some..test::stream]
36633
36634
36635Start an asynchronous write.
36636[heading Synopsis]
36637```
36638template<
36639    class __ConstBufferSequence__,
36640    class __WriteHandler__>
36641``__deduced__``
36642async_write_some(
36643    ConstBufferSequence const& buffers,
36644    WriteHandler&& handler);
36645```
36646
36647[heading Description]
36648This function is used to asynchronously write one or more bytes of data to the stream. The function call always returns immediately.
36649
36650[heading Parameters]
36651[table [[Name][Description]]
36652  [
36653    [`buffers`
36654    ]
36655    [
36656The data to be written to the stream. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.
36657    ]
36658  ]
36659  [
36660    [`handler`
36661    ]
36662    [
36663
36664The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
36665```
36666void handler(
36667    error_code const& ec,           // Result of operation.
36668    std::size_t bytes_transferred   // Number of bytes written.
36669);
36670```
36671
36672Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
36673    ]
36674  ]
36675]
36676[heading Remarks]
36677The `async_write_some` operation may not transmit all of the data to the peer. Consider using the function `net::async_write` if you need to ensure that all data is written before the asynchronous operation completes.
36678
36679[endsect]
36680
36681
36682[endsect]
36683
36684[section:boost__beast__websocket__stream_base websocket::stream_base]
36685
36686This class is used as a base for the [link beast.ref.boost__beast__websocket__stream `websocket::stream`] class template to group common types and constants.
36687[heading Synopsis]
36688Defined in header [include_file boost/beast/websocket/stream_base.hpp]
36689
36690```
36691struct stream_base
36692```
36693
36694[heading Types]
36695[table [[Name][Description]]
36696  [
36697    [[*[link beast.ref.boost__beast__websocket__stream_base__decorator decorator]]
36698    ]
36699    [
36700
36701Stream option used to adjust HTTP fields of WebSocket upgrade request and responses.
36702    ]
36703  ]
36704  [
36705    [[*[link beast.ref.boost__beast__websocket__stream_base.duration duration]]
36706    ]
36707    [
36708
36709The type used to represent durations.
36710    ]
36711  ]
36712  [
36713    [[*[link beast.ref.boost__beast__websocket__stream_base.time_point time_point]]
36714    ]
36715    [
36716
36717The type used to represent time points.
36718    ]
36719  ]
36720  [
36721    [[*[link beast.ref.boost__beast__websocket__stream_base__timeout timeout]]
36722    ]
36723    [
36724
36725Stream option to control the behavior of websocket timeouts.
36726    ]
36727  ]
36728]
36729[heading Static Members]
36730[table [[Name][Description]]
36731  [
36732    [[*[link beast.ref.boost__beast__websocket__stream_base.never never]]
36733    ]
36734    [
36735
36736Returns the special time_point value meaning "never".
36737    ]
36738  ]
36739  [
36740    [[*[link beast.ref.boost__beast__websocket__stream_base.none none]]
36741    ]
36742    [
36743
36744Returns the special duration value meaning "none".
36745    ]
36746  ]
36747]
36748[heading Description]
36749
36750[section:status websocket::stream_base::status]
36751[indexterm2 status..websocket::stream_base]
36752
36753
36754[heading Synopsis]
36755```
36756enum status
36757```
36758
36759[heading Protected protected-type]
36760[table [[Name][Description]]
36761  [
36762    [[*[link beast.ref. status]]
36763    ]
36764    [
36765
36766    ]
36767  ]
36768]
36769[heading Description]
36770
36771[endsect]
36772
36773[section:duration websocket::stream_base::duration]
36774[indexterm2 duration..websocket::stream_base]
36775
36776
36777The type used to represent durations.
36778[heading Synopsis]
36779```
36780using duration = std::chrono::steady_clock::duration;
36781```
36782
36783[heading Description]
36784
36785[endsect]
36786
36787[section:time_point websocket::stream_base::time_point]
36788[indexterm2 time_point..websocket::stream_base]
36789
36790
36791The type used to represent time points.
36792[heading Synopsis]
36793```
36794using time_point = std::chrono::steady_clock::time_point;
36795```
36796
36797[heading Description]
36798
36799[endsect]
36800
36801[section:never websocket::stream_base::never]
36802[indexterm2 never..websocket::stream_base]
36803
36804
36805Returns the special time_point value meaning "never".
36806[heading Synopsis]
36807```
36808static
36809time_point
36810never();
36811```
36812
36813[heading Description]
36814
36815[endsect]
36816
36817[section:none websocket::stream_base::none]
36818[indexterm2 none..websocket::stream_base]
36819
36820
36821Returns the special duration value meaning "none".
36822[heading Synopsis]
36823```
36824static
36825duration
36826none();
36827```
36828
36829[heading Description]
36830
36831[endsect]
36832
36833
36834[endsect]
36835
36836[section:boost__beast__websocket__stream_base__timeout websocket::stream_base::timeout]
36837
36838Stream option to control the behavior of websocket timeouts.
36839[heading Synopsis]
36840Defined in header [include_file boost/beast/websocket/stream_base.hpp]
36841
36842```
36843struct timeout
36844```
36845
36846[heading Static Members]
36847[table [[Name][Description]]
36848  [
36849    [[*[link beast.ref.boost__beast__websocket__stream_base__timeout.suggested suggested]]
36850    ]
36851    [
36852
36853Construct timeout settings with suggested values for a role.
36854    ]
36855  ]
36856]
36857[heading Data Members]
36858[table [[Name][Description]]
36859  [
36860    [[*[link beast.ref.boost__beast__websocket__stream_base__timeout.handshake_timeout handshake_timeout]]
36861    ]
36862    [
36863
36864Time limit on handshake, accept, and close operations:
36865    ]
36866  ]
36867  [
36868    [[*[link beast.ref.boost__beast__websocket__stream_base__timeout.idle_timeout idle_timeout]]
36869    ]
36870    [
36871
36872The time limit after which a connection is considered idle.
36873    ]
36874  ]
36875  [
36876    [[*[link beast.ref.boost__beast__websocket__stream_base__timeout.keep_alive_pings keep_alive_pings]]
36877    ]
36878    [
36879
36880Automatic ping setting.
36881    ]
36882  ]
36883]
36884[heading Description]
36885Timeout features are available for asynchronous operations only.
36886
36887[section:handshake_timeout websocket::stream_base::timeout::handshake_timeout]
36888[indexterm2 handshake_timeout..websocket::stream_base::timeout]
36889
36890
36891Time limit on handshake, accept, and close operations:
36892[heading Synopsis]
36893```
36894duration handshake_timeout;
36895```
36896
36897[heading Description]
36898This value whether or not there is a time limit, and the duration of that time limit, for asynchronous handshake, accept, and close operations. If this is equal to the value [link beast.ref.boost__beast__websocket__stream_base.none `none`] then there will be no time limit. Otherwise, if any of the applicable operations takes longer than this amount of time, the operation will be canceled and a timeout error delivered to the completion handler.
36899
36900[endsect]
36901
36902[section:idle_timeout websocket::stream_base::timeout::idle_timeout]
36903[indexterm2 idle_timeout..websocket::stream_base::timeout]
36904
36905
36906The time limit after which a connection is considered idle.
36907[heading Synopsis]
36908```
36909duration idle_timeout;
36910```
36911
36912[heading Description]
36913
36914[endsect]
36915
36916[section:keep_alive_pings websocket::stream_base::timeout::keep_alive_pings]
36917[indexterm2 keep_alive_pings..websocket::stream_base::timeout]
36918
36919
36920Automatic ping setting.
36921[heading Synopsis]
36922```
36923bool keep_alive_pings;
36924```
36925
36926[heading Description]
36927If the idle interval is set, this setting affects the behavior of the stream when no data is received for the timeout interval as follows:
36928
36929* When `keep_alive_pings` is `true`, an idle ping will be sent automatically. If another timeout interval elapses with no received data then the connection will be closed. An outstanding read operation must be pending, which will complete immediately the error [link beast.ref.boost__beast__error `beast::error::timeout`].
36930
36931* When `keep_alive_pings` is `false`, the connection will be closed. An outstanding read operation must be pending, which will complete immediately the error [link beast.ref.boost__beast__error `beast::error::timeout`].
36932
36933
36934[endsect]
36935
36936[section:suggested websocket::stream_base::timeout::suggested]
36937[indexterm2 suggested..websocket::stream_base::timeout]
36938
36939
36940Construct timeout settings with suggested values for a role.
36941[heading Synopsis]
36942```
36943static
36944timeout
36945suggested(
36946    role_type role);
36947```
36948
36949[heading Description]
36950This constructs the timeout settings with a predefined set of values which varies depending on the desired role. The values are selected upon construction, regardless of the current or actual role in use on the stream.
36951
36952[heading Example]
36953
36954This statement sets the timeout settings of the stream to the suggested values for the server role:
36955```
36956```
36957
36958[heading Parameters]
36959[table [[Name][Description]]
36960  [
36961    [`role`
36962    ]
36963    [
36964The role of the websocket stream ([link beast.ref.boost__beast__role_type `role_type::client`] or [link beast.ref.boost__beast__role_type `role_type::server`]).
36965    ]
36966  ]
36967]
36968
36969[endsect]
36970
36971
36972[endsect]
36973
36974[section:boost__beast__http__token_list http::token_list]
36975
36976A list of tokens in a comma separated HTTP field value.
36977[heading Synopsis]
36978Defined in header [include_file boost/beast/http/rfc7230.hpp]
36979
36980```
36981class token_list
36982```
36983
36984[heading Types]
36985[table [[Name][Description]]
36986  [
36987    [[*[link beast.ref.boost__beast__http__token_list.const_iterator const_iterator]]
36988    ]
36989    [
36990
36991A constant iterator to the list.
36992    ]
36993  ]
36994  [
36995    [[*[link beast.ref.boost__beast__http__token_list.value_type value_type]]
36996    ]
36997    [
36998
36999The type of each element in the token list.
37000    ]
37001  ]
37002]
37003[heading Member Functions]
37004[table [[Name][Description]]
37005  [
37006    [[*[link beast.ref.boost__beast__http__token_list.begin begin]]
37007    ]
37008    [
37009
37010Return a const iterator to the beginning of the list.
37011    ]
37012  ]
37013  [
37014    [[*[link beast.ref.boost__beast__http__token_list.cbegin cbegin]]
37015    ]
37016    [
37017
37018Return a const iterator to the beginning of the list.
37019    ]
37020  ]
37021  [
37022    [[*[link beast.ref.boost__beast__http__token_list.cend cend]]
37023    ]
37024    [
37025
37026Return a const iterator to the end of the list.
37027    ]
37028  ]
37029  [
37030    [[*[link beast.ref.boost__beast__http__token_list.end end]]
37031    ]
37032    [
37033
37034Return a const iterator to the end of the list.
37035    ]
37036  ]
37037  [
37038    [[*[link beast.ref.boost__beast__http__token_list.exists exists]]
37039    ]
37040    [
37041
37042Return `true` if a token is present in the list.
37043    ]
37044  ]
37045  [
37046    [[*[link beast.ref.boost__beast__http__token_list.token_list token_list]]
37047    ]
37048    [
37049
37050Construct a list.
37051    ]
37052  ]
37053]
37054[heading Description]
37055This container allows iteration of a list of items in a header field value. The input is a comma separated list of tokens.
37056If a parsing error is encountered while iterating the string, the behavior of the container will be as if a string containing only characters up to but excluding the first invalid character was used to construct the list.
37057
37058[heading BNF]
37059
37060```
37061token-list  = *( "," OWS ) token *( OWS "," [ OWS token ] )
37062```
37063
37064To use this class, construct with the string to be parsed and then use [link beast.ref.boost__beast__http__token_list.begin `begin`] and [link beast.ref.boost__beast__http__token_list.end `end`], or range-for to iterate each item:
37065
37066[heading Example]
37067
37068```
37069for(auto const& token : token_list{"apple, pear, banana"})
37070    std::cout << token << "\n";
37071```
37072
37073
37074[section:value_type http::token_list::value_type]
37075[indexterm2 value_type..http::token_list]
37076
37077
37078The type of each element in the token list.
37079[heading Synopsis]
37080```
37081using value_type = string_view;
37082```
37083
37084[heading Description]
37085
37086[endsect]
37087
37088[section:const_iterator http::token_list::const_iterator]
37089[indexterm2 const_iterator..http::token_list]
37090
37091
37092A constant iterator to the list.
37093[heading Synopsis]
37094```
37095using const_iterator = ``['implementation-defined]``;
37096```
37097
37098[heading Description]
37099
37100[endsect]
37101
37102[section:token_list http::token_list::token_list]
37103[indexterm2 token_list..http::token_list]
37104
37105
37106Construct a list.
37107[heading Synopsis]
37108```
37109token_list(
37110    string_view s);
37111```
37112
37113[heading Description]
37114
37115[heading Parameters]
37116[table [[Name][Description]]
37117  [
37118    [`s`
37119    ]
37120    [
37121A string containing the list contents. The string must remain valid for the lifetime of the container.
37122    ]
37123  ]
37124]
37125
37126[endsect]
37127
37128[section:begin http::token_list::begin]
37129[indexterm2 begin..http::token_list]
37130
37131
37132Return a const iterator to the beginning of the list.
37133[heading Synopsis]
37134```
37135const_iterator
37136begin() const;
37137```
37138
37139[heading Description]
37140
37141[endsect]
37142
37143[section:end http::token_list::end]
37144[indexterm2 end..http::token_list]
37145
37146
37147Return a const iterator to the end of the list.
37148[heading Synopsis]
37149```
37150const_iterator
37151end() const;
37152```
37153
37154[heading Description]
37155
37156[endsect]
37157
37158[section:cbegin http::token_list::cbegin]
37159[indexterm2 cbegin..http::token_list]
37160
37161
37162Return a const iterator to the beginning of the list.
37163[heading Synopsis]
37164```
37165const_iterator
37166cbegin() const;
37167```
37168
37169[heading Description]
37170
37171[endsect]
37172
37173[section:cend http::token_list::cend]
37174[indexterm2 cend..http::token_list]
37175
37176
37177Return a const iterator to the end of the list.
37178[heading Synopsis]
37179```
37180const_iterator
37181cend() const;
37182```
37183
37184[heading Description]
37185
37186[endsect]
37187
37188[section:exists http::token_list::exists]
37189[indexterm2 exists..http::token_list]
37190
37191
37192Return `true` if a token is present in the list.
37193[heading Synopsis]
37194```
37195bool
37196exists(
37197    string_view const& s);
37198```
37199
37200[heading Description]
37201
37202[heading Parameters]
37203[table [[Name][Description]]
37204  [
37205    [`s`
37206    ]
37207    [
37208The token to find. A case-insensitive comparison is used.
37209    ]
37210  ]
37211]
37212
37213[endsect]
37214
37215
37216[endsect]
37217
37218[section:boost__beast__unlimited_rate_policy unlimited_rate_policy]
37219
37220A rate policy with unlimited throughput.
37221[heading Synopsis]
37222Defined in header [include_file boost/beast/core/rate_policy.hpp]
37223
37224```
37225class unlimited_rate_policy
37226```
37227
37228[heading Description]
37229This rate policy object does not apply any rate limit.
37230
37231* ['RatePolicy]
37232
37233[heading See Also]
37234[link beast.ref.boost__beast__basic_stream `beast::basic_stream`], [link beast.ref.boost__beast__tcp_stream `beast::tcp_stream`]
37235
37236
37237[endsect]
37238
37239[section:boost__beast__http__empty_body__value_type http::empty_body::value_type]
37240
37241The type of container used for the body.
37242[heading Synopsis]
37243Defined in header [include_file boost/beast/http/empty_body.hpp]
37244
37245```
37246struct value_type
37247```
37248
37249[heading Description]
37250This determines the type of [link beast.ref.boost__beast__http__message.body `message::body`] when this body type is used with a message container.
37251
37252
37253[endsect]
37254
37255[section:boost__beast__http__buffer_body__value_type http::buffer_body::value_type]
37256
37257The type of the body member when used in a message.
37258[heading Synopsis]
37259Defined in header [include_file boost/beast/http/buffer_body.hpp]
37260
37261```
37262struct value_type
37263```
37264
37265[heading Data Members]
37266[table [[Name][Description]]
37267  [
37268    [[*[link beast.ref.boost__beast__http__buffer_body__value_type.data data]]
37269    ]
37270    [
37271
37272A pointer to a contiguous area of memory of [link beast.ref.boost__beast__http__buffer_body__value_type.size `size`] octets, else `nullptr`.
37273    ]
37274  ]
37275  [
37276    [[*[link beast.ref.boost__beast__http__buffer_body__value_type.more more]]
37277    ]
37278    [
37279
37280`true` if this is not the last buffer.
37281    ]
37282  ]
37283  [
37284    [[*[link beast.ref.boost__beast__http__buffer_body__value_type.size size]]
37285    ]
37286    [
37287
37288The number of octets in the buffer pointed to by [link beast.ref.boost__beast__http__buffer_body__value_type.data `data`].
37289    ]
37290  ]
37291]
37292[heading Description]
37293
37294[section:data http::buffer_body::value_type::data]
37295[indexterm2 data..http::buffer_body::value_type]
37296
37297
37298A pointer to a contiguous area of memory of [link beast.ref.boost__beast__http__buffer_body__value_type.size `size`] octets, else `nullptr`.
37299[heading Synopsis]
37300```
37301void* data = nullptr;
37302```
37303
37304[heading Description]
37305
37306[heading When Serializing]
37307
37308If this is `nullptr` and `more` is `true`, the error [link beast.ref.boost__beast__http__error `error::need_buffer`] will be returned from [link beast.ref.boost__beast__http__serializer.get `serializer::get`] Otherwise, the serializer will use the memory pointed to by `data` having `size` octets of valid storage as the next buffer representing the body.
37309
37310[heading When Parsing]
37311
37312If this is `nullptr`, the error [link beast.ref.boost__beast__http__error `error::need_buffer`] will be returned from [link beast.ref.boost__beast__http__parser.put `parser::put`]. Otherwise, the parser will store body octets into the memory pointed to by `data` having `size` octets of valid storage. After octets are stored, the `data` and `size` members are adjusted: `data` is incremented to point to the next octet after the data written, while `size` is decremented to reflect the remaining space at the memory location pointed to by `data`.
37313
37314[endsect]
37315
37316[section:size http::buffer_body::value_type::size]
37317[indexterm2 size..http::buffer_body::value_type]
37318
37319
37320The number of octets in the buffer pointed to by [link beast.ref.boost__beast__http__buffer_body__value_type.data `data`].
37321[heading Synopsis]
37322```
37323std::size_t size = 0;
37324```
37325
37326[heading Description]
37327
37328[heading When Serializing]
37329
37330If `data` is `nullptr` during serialization, this value is ignored. Otherwise, it represents the number of valid body octets pointed to by `data`.
37331
37332[heading When Parsing]
37333
37334The value of this field will be decremented during parsing to indicate the number of remaining free octets in the buffer pointed to by `data`. When it reaches zero, the parser will return [link beast.ref.boost__beast__http__error `error::need_buffer`], indicating to the caller that the values of `data` and `size` should be updated to point to a new memory buffer.
37335
37336[endsect]
37337
37338[section:more http::buffer_body::value_type::more]
37339[indexterm2 more..http::buffer_body::value_type]
37340
37341
37342`true` if this is not the last buffer.
37343[heading Synopsis]
37344```
37345bool more = true;
37346```
37347
37348[heading Description]
37349
37350[heading When Serializing]
37351
37352If this is `true` and `data` is `nullptr`, the error [link beast.ref.boost__beast__http__error `error::need_buffer`] will be returned from [link beast.ref.boost__beast__http__serializer.get `serializer::get`]
37353
37354[heading When Parsing]
37355
37356This field is not used during parsing.
37357
37358[endsect]
37359
37360
37361[endsect]
37362
37363[section:boost__beast__http__basic_file_body__value_type http::basic_file_body::value_type]
37364
37365The type of the [link beast.ref.boost__beast__http__message.body `message::body`] member.
37366[heading Synopsis]
37367Defined in header [include_file boost/beast/http/basic_file_body.hpp]
37368
37369```
37370class value_type
37371```
37372
37373[heading Member Functions]
37374[table [[Name][Description]]
37375  [
37376    [[*[link beast.ref.boost__beast__http__basic_file_body__value_type.close close]]
37377    ]
37378    [
37379
37380Close the file if open.
37381    ]
37382  ]
37383  [
37384    [[*[link beast.ref.boost__beast__http__basic_file_body__value_type.file file]]
37385    ]
37386    [
37387
37388Return the file.
37389    ]
37390  ]
37391  [
37392    [[*[link beast.ref.boost__beast__http__basic_file_body__value_type.is_open is_open]]
37393    ]
37394    [
37395
37396Returns `true` if the file is open.
37397    ]
37398  ]
37399  [
37400    [[*[link beast.ref.boost__beast__http__basic_file_body__value_type.open open]]
37401    ]
37402    [
37403
37404Open a file at the given path with the specified mode.
37405    ]
37406  ]
37407  [
37408    [[*[link beast.ref.boost__beast__http__basic_file_body__value_type.operator_eq_ operator=]]
37409    ]
37410    [
37411
37412Move assignment.
37413    ]
37414  ]
37415  [
37416    [[*[link beast.ref.boost__beast__http__basic_file_body__value_type.reset reset]]
37417    ]
37418    [
37419
37420Set the open file.
37421    ]
37422  ]
37423  [
37424    [[*[link beast.ref.boost__beast__http__basic_file_body__value_type.size size]]
37425    ]
37426    [
37427
37428Returns the size of the file if open.
37429    ]
37430  ]
37431  [
37432    [[*[link beast.ref.boost__beast__http__basic_file_body__value_type.value_type value_type]]
37433    ]
37434    [
37435
37436Constructor.
37437    ]
37438  ]
37439  [
37440    [[*[link beast.ref.boost__beast__http__basic_file_body__value_type._value_type ~value_type]]
37441    ]
37442    [
37443
37444Destructor.
37445    ]
37446  ]
37447]
37448[heading Description]
37449Messages declared using [link beast.ref.boost__beast__http__basic_file_body `basic_file_body`] will have this type for the body member. This rich class interface allow the file to be opened with the file handle maintained directly in the object, which is attached to the message.
37450
37451[section:_value_type http::basic_file_body::value_type::~value_type]
37452[indexterm2 ~value_type..http::basic_file_body::value_type]
37453
37454
37455Destructor.
37456[heading Synopsis]
37457```
37458~value_type();
37459```
37460
37461[heading Description]
37462If the file is open, it is closed first.
37463
37464[endsect]
37465
37466[section:value_type http::basic_file_body::value_type::value_type]
37467[indexterm2 value_type..http::basic_file_body::value_type]
37468
37469
37470Constructor.
37471```
37472``[link beast.ref.boost__beast__http__basic_file_body__value_type.value_type.overload1 value_type]``();
37473  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_file_body__value_type.value_type.overload1 `more...`]]``
37474
37475``[link beast.ref.boost__beast__http__basic_file_body__value_type.value_type.overload2 value_type]``(
37476    value_type&& other);
37477  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_file_body__value_type.value_type.overload2 `more...`]]``
37478```
37479
37480[section:overload1 http::basic_file_body::value_type::value_type (1 of 2 overloads)]
37481
37482Constructor.
37483[heading Synopsis]
37484```
37485value_type();
37486```
37487
37488[heading Description]
37489
37490[endsect]
37491
37492[section:overload2 http::basic_file_body::value_type::value_type (2 of 2 overloads)]
37493
37494Constructor.
37495[heading Synopsis]
37496```
37497value_type(
37498    value_type&& other);
37499```
37500
37501[heading Description]
37502
37503[endsect]
37504
37505
37506[endsect]
37507
37508[section:operator_eq_ http::basic_file_body::value_type::operator=]
37509[indexterm2 operator=..http::basic_file_body::value_type]
37510
37511
37512Move assignment.
37513[heading Synopsis]
37514```
37515value_type&
37516operator=(
37517    value_type&& other);
37518```
37519
37520[heading Description]
37521
37522[endsect]
37523
37524[section:file http::basic_file_body::value_type::file]
37525[indexterm2 file..http::basic_file_body::value_type]
37526
37527
37528Return the file.
37529[heading Synopsis]
37530```
37531File&
37532file();
37533```
37534
37535[heading Description]
37536
37537[endsect]
37538
37539[section:is_open http::basic_file_body::value_type::is_open]
37540[indexterm2 is_open..http::basic_file_body::value_type]
37541
37542
37543Returns `true` if the file is open.
37544[heading Synopsis]
37545```
37546bool
37547is_open() const;
37548```
37549
37550[heading Description]
37551
37552[endsect]
37553
37554[section:size http::basic_file_body::value_type::size]
37555[indexterm2 size..http::basic_file_body::value_type]
37556
37557
37558Returns the size of the file if open.
37559[heading Synopsis]
37560```
37561std::uint64_t
37562size() const;
37563```
37564
37565[heading Description]
37566
37567[endsect]
37568
37569[section:close http::basic_file_body::value_type::close]
37570[indexterm2 close..http::basic_file_body::value_type]
37571
37572
37573Close the file if open.
37574[heading Synopsis]
37575```
37576void
37577close();
37578```
37579
37580[heading Description]
37581
37582[endsect]
37583
37584[section:open http::basic_file_body::value_type::open]
37585[indexterm2 open..http::basic_file_body::value_type]
37586
37587
37588Open a file at the given path with the specified mode.
37589[heading Synopsis]
37590```
37591void
37592open(
37593    char const* path,
37594    file_mode mode,
37595    error_code& ec);
37596```
37597
37598[heading Description]
37599
37600[heading Parameters]
37601[table [[Name][Description]]
37602  [
37603    [`path`
37604    ]
37605    [
37606The utf-8 encoded path to the file
37607    ]
37608  ]
37609  [
37610    [`mode`
37611    ]
37612    [
37613The file mode to use
37614    ]
37615  ]
37616  [
37617    [`ec`
37618    ]
37619    [
37620Set to the error, if any occurred
37621    ]
37622  ]
37623]
37624
37625[endsect]
37626
37627[section:reset http::basic_file_body::value_type::reset]
37628[indexterm2 reset..http::basic_file_body::value_type]
37629
37630
37631Set the open file.
37632[heading Synopsis]
37633```
37634void
37635reset(
37636    File&& file,
37637    error_code& ec);
37638```
37639
37640[heading Description]
37641This function is used to set the open file. Any previously set file will be closed.
37642
37643[heading Parameters]
37644[table [[Name][Description]]
37645  [
37646    [`file`
37647    ]
37648    [
37649The file to set. The file must be open or else an error occurs
37650    ]
37651  ]
37652  [
37653    [`ec`
37654    ]
37655    [
37656Set to the error, if any occurred
37657    ]
37658  ]
37659]
37660
37661[endsect]
37662
37663
37664[endsect]
37665
37666[section:boost__beast__http__basic_fields__value_type http::basic_fields::value_type]
37667
37668The type of element used to represent a field.
37669[heading Synopsis]
37670Defined in header [include_file boost/beast/http/fields.hpp]
37671
37672```
37673class value_type
37674```
37675
37676[heading Member Functions]
37677[table [[Name][Description]]
37678  [
37679    [[*[link beast.ref.boost__beast__http__basic_fields__value_type.name name]]
37680    ]
37681    [
37682
37683Returns the field enum, which can be [link beast.ref.boost__beast__http__field `field::unknown`].
37684    ]
37685  ]
37686  [
37687    [[*[link beast.ref.boost__beast__http__basic_fields__value_type.name_string name_string]]
37688    ]
37689    [
37690
37691Returns the field name as a string.
37692    ]
37693  ]
37694  [
37695    [[*[link beast.ref.boost__beast__http__basic_fields__value_type.operator_eq_ operator=]]
37696    ]
37697    [
37698
37699Assignment (deleted)
37700    ]
37701  ]
37702  [
37703    [[*[link beast.ref.boost__beast__http__basic_fields__value_type.value value]]
37704    ]
37705    [
37706
37707Returns the value of the field.
37708    ]
37709  ]
37710  [
37711    [[*[link beast.ref.boost__beast__http__basic_fields__value_type.value_type value_type]]
37712    ]
37713    [
37714
37715Constructor (deleted)
37716    ]
37717  ]
37718]
37719[heading Protected Member Functions]
37720[table [[Name][Description]]
37721  [
37722    [[*[link beast.ref.boost__beast__http__basic_fields__value_type.value_type value_type]]
37723    ]
37724    [
37725
37726    ]
37727  ]
37728]
37729[heading Description]
37730
37731[section:value_type http::basic_fields::value_type::value_type]
37732[indexterm2 value_type..http::basic_fields::value_type]
37733
37734
37735```
37736``[link beast.ref.boost__beast__http__basic_fields__value_type.value_type.overload1 value_type]``(
37737    field name,
37738    string_view sname,
37739    string_view value);
37740  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields__value_type.value_type.overload1 `more...`]]``
37741```
37742
37743
37744Constructor (deleted)
37745```
37746``[link beast.ref.boost__beast__http__basic_fields__value_type.value_type.overload2 value_type]``(
37747    value_type const&);
37748  ``[''''&raquo;''' [link beast.ref.boost__beast__http__basic_fields__value_type.value_type.overload2 `more...`]]``
37749```
37750
37751[section:overload1 http::basic_fields::value_type::value_type (1 of 2 overloads)]
37752
37753[heading Synopsis]
37754```
37755value_type(
37756    field name,
37757    string_view sname,
37758    string_view value);
37759```
37760
37761[heading Description]
37762
37763[endsect]
37764
37765[section:overload2 http::basic_fields::value_type::value_type (2 of 2 overloads)]
37766
37767Constructor (deleted)
37768[heading Synopsis]
37769```
37770value_type(
37771    value_type const&);
37772```
37773
37774[heading Description]
37775
37776[endsect]
37777
37778
37779[endsect]
37780
37781[section:operator_eq_ http::basic_fields::value_type::operator=]
37782[indexterm2 operator=..http::basic_fields::value_type]
37783
37784
37785Assignment (deleted)
37786[heading Synopsis]
37787```
37788value_type&
37789operator=(
37790    value_type const&);
37791```
37792
37793[heading Description]
37794
37795[endsect]
37796
37797[section:name http::basic_fields::value_type::name]
37798[indexterm2 name..http::basic_fields::value_type]
37799
37800
37801Returns the field enum, which can be [link beast.ref.boost__beast__http__field `field::unknown`].
37802[heading Synopsis]
37803```
37804field
37805name() const;
37806```
37807
37808[heading Description]
37809
37810[endsect]
37811
37812[section:name_string http::basic_fields::value_type::name_string]
37813[indexterm2 name_string..http::basic_fields::value_type]
37814
37815
37816Returns the field name as a string.
37817[heading Synopsis]
37818```
37819string_view const
37820name_string() const;
37821```
37822
37823[heading Description]
37824
37825[endsect]
37826
37827[section:value http::basic_fields::value_type::value]
37828[indexterm2 value..http::basic_fields::value_type]
37829
37830
37831Returns the value of the field.
37832[heading Synopsis]
37833```
37834string_view const
37835value() const;
37836```
37837
37838[heading Description]
37839
37840[endsect]
37841
37842
37843[endsect]
37844
37845[section:boost__beast__http__vector_body http::vector_body]
37846
37847A ['Body] using `std::vector`
37848[heading Synopsis]
37849Defined in header [include_file boost/beast/http/vector_body.hpp]
37850
37851```
37852template<
37853    class T,
37854    class __Allocator__ = std::allocator<T>>
37855struct vector_body
37856```
37857
37858[heading Types]
37859[table [[Name][Description]]
37860  [
37861    [[*[link beast.ref.boost__beast__http__vector_body.reader reader]]
37862    ]
37863    [
37864
37865The algorithm for parsing the body.
37866    ]
37867  ]
37868  [
37869    [[*[link beast.ref.boost__beast__http__vector_body.value_type value_type]]
37870    ]
37871    [
37872
37873The type of container used for the body.
37874    ]
37875  ]
37876  [
37877    [[*[link beast.ref.boost__beast__http__vector_body.writer writer]]
37878    ]
37879    [
37880
37881The algorithm for serializing the body.
37882    ]
37883  ]
37884]
37885[heading Static Members]
37886[table [[Name][Description]]
37887  [
37888    [[*[link beast.ref.boost__beast__http__vector_body.size size]]
37889    ]
37890    [
37891
37892Returns the payload size of the body.
37893    ]
37894  ]
37895]
37896[heading Description]
37897This body uses `std::vector` as a memory-based container for holding message payloads. Messages using this body type may be serialized and parsed.
37898
37899[section:value_type http::vector_body::value_type]
37900[indexterm2 value_type..http::vector_body]
37901
37902
37903The type of container used for the body.
37904[heading Synopsis]
37905```
37906using value_type = std::vector< T, Allocator >;
37907```
37908
37909[heading Description]
37910This determines the type of [link beast.ref.boost__beast__http__message.body `message::body`] when this body type is used with a message container.
37911
37912[endsect]
37913
37914[section:reader http::vector_body::reader]
37915[indexterm2 reader..http::vector_body]
37916
37917
37918The algorithm for parsing the body.
37919[heading Synopsis]
37920```
37921using reader = ``['implementation-defined]``;
37922```
37923
37924[heading Description]
37925Meets the requirements of ['BodyReader].
37926
37927[endsect]
37928
37929[section:writer http::vector_body::writer]
37930[indexterm2 writer..http::vector_body]
37931
37932
37933The algorithm for serializing the body.
37934[heading Synopsis]
37935```
37936using writer = ``['implementation-defined]``;
37937```
37938
37939[heading Description]
37940Meets the requirements of ['BodyWriter].
37941
37942[endsect]
37943
37944[section:size http::vector_body::size]
37945[indexterm2 size..http::vector_body]
37946
37947
37948Returns the payload size of the body.
37949[heading Synopsis]
37950```
37951static
37952std::uint64_t
37953size(
37954    value_type const& body);
37955```
37956
37957[heading Description]
37958When this body is used with [link beast.ref.boost__beast__http__message.prepare_payload `message::prepare_payload`], the Content-Length will be set to the payload size, and any chunked Transfer-Encoding will be removed.
37959
37960[endsect]
37961
37962
37963[endsect]
37964
37965[section:boost__beast__http__basic_file_body__writer http::basic_file_body::writer]
37966
37967Algorithm for retrieving buffers when serializing.
37968[heading Synopsis]
37969Defined in header [include_file boost/beast/http/basic_file_body.hpp]
37970
37971```
37972class writer
37973```
37974
37975[heading Types]
37976[table [[Name][Description]]
37977  [
37978    [[*[link beast.ref.boost__beast__http__basic_file_body__writer.const_buffers_type const_buffers_type]]
37979    ]
37980    [
37981
37982    ]
37983  ]
37984]
37985[heading Member Functions]
37986[table [[Name][Description]]
37987  [
37988    [[*[link beast.ref.boost__beast__http__basic_file_body__writer.get get]]
37989    ]
37990    [
37991
37992    ]
37993  ]
37994  [
37995    [[*[link beast.ref.boost__beast__http__basic_file_body__writer.init init]]
37996    ]
37997    [
37998
37999    ]
38000  ]
38001  [
38002    [[*[link beast.ref.boost__beast__http__basic_file_body__writer.writer writer]]
38003    ]
38004    [
38005
38006    ]
38007  ]
38008]
38009[heading Description]
38010Objects of this type are created during serialization to extract the buffers representing the body.
38011
38012[section:const_buffers_type http::basic_file_body::writer::const_buffers_type]
38013[indexterm2 const_buffers_type..http::basic_file_body::writer]
38014
38015
38016[heading Synopsis]
38017```
38018using const_buffers_type = net::const_buffer;
38019```
38020
38021[heading Description]
38022
38023[endsect]
38024
38025[section:writer http::basic_file_body::writer::writer]
38026[indexterm2 writer..http::basic_file_body::writer]
38027
38028
38029[heading Synopsis]
38030```
38031template<
38032    bool isRequest,
38033    class __Fields__>
38034writer(
38035    header< isRequest, Fields >& h,
38036    value_type& b);
38037```
38038
38039[heading Description]
38040
38041[endsect]
38042
38043[section:init http::basic_file_body::writer::init]
38044[indexterm2 init..http::basic_file_body::writer]
38045
38046
38047[heading Synopsis]
38048```
38049void
38050init(
38051    error_code& ec);
38052```
38053
38054[heading Description]
38055
38056[endsect]
38057
38058[section:get http::basic_file_body::writer::get]
38059[indexterm2 get..http::basic_file_body::writer]
38060
38061
38062[heading Synopsis]
38063```
38064boost::optional< std::pair< const_buffers_type, bool > >
38065get(
38066    error_code& ec);
38067```
38068
38069[heading Description]
38070
38071[endsect]
38072
38073
38074[endsect]
38075
38076[section:boost__beast__zlib__z_params zlib::z_params]
38077
38078Deflate codec parameters.
38079[heading Synopsis]
38080Defined in header [include_file boost/beast/zlib/zlib.hpp]
38081
38082```
38083struct z_params
38084```
38085
38086[heading Data Members]
38087[table [[Name][Description]]
38088  [
38089    [[*[link beast.ref.boost__beast__zlib__z_params.avail_in avail_in]]
38090    ]
38091    [
38092
38093The number of bytes of input available at `next_in`.
38094    ]
38095  ]
38096  [
38097    [[*[link beast.ref.boost__beast__zlib__z_params.avail_out avail_out]]
38098    ]
38099    [
38100
38101The remaining bytes of space at `next_out`.
38102    ]
38103  ]
38104  [
38105    [[*[link beast.ref.boost__beast__zlib__z_params.data_type data_type]]
38106    ]
38107    [
38108
38109    ]
38110  ]
38111  [
38112    [[*[link beast.ref.boost__beast__zlib__z_params.next_in next_in]]
38113    ]
38114    [
38115
38116A pointer to the next input byte.
38117    ]
38118  ]
38119  [
38120    [[*[link beast.ref.boost__beast__zlib__z_params.next_out next_out]]
38121    ]
38122    [
38123
38124A pointer to the next output byte.
38125    ]
38126  ]
38127  [
38128    [[*[link beast.ref.boost__beast__zlib__z_params.total_in total_in]]
38129    ]
38130    [
38131
38132The total number of input bytes read so far.
38133    ]
38134  ]
38135  [
38136    [[*[link beast.ref.boost__beast__zlib__z_params.total_out total_out]]
38137    ]
38138    [
38139
38140The total number of bytes output so far.
38141    ]
38142  ]
38143]
38144[heading Description]
38145Objects of this type are filled in by callers and provided to the deflate codec to define the input and output areas for the next compress or decompress operation.
38146The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out has dropped to zero. The application must initialize zalloc, zfree and opaque before calling the init function. All other fields are set by the compression library and must not be updated by the application.
38147The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the uncompressed data and may be saved for use in the decompressor (particularly if the decompressor wants to decompress everything in a single step).
38148
38149[section:next_in zlib::z_params::next_in]
38150[indexterm2 next_in..zlib::z_params]
38151
38152
38153A pointer to the next input byte.
38154[heading Synopsis]
38155```
38156void const* next_in;
38157```
38158
38159[heading Description]
38160If there is no more input, this may be set to `nullptr`.
38161
38162[endsect]
38163
38164[section:avail_in zlib::z_params::avail_in]
38165[indexterm2 avail_in..zlib::z_params]
38166
38167
38168The number of bytes of input available at `next_in`.
38169[heading Synopsis]
38170```
38171std::size_t avail_in;
38172```
38173
38174[heading Description]
38175If there is no more input, this should be set to zero.
38176
38177[endsect]
38178
38179[section:total_in zlib::z_params::total_in]
38180[indexterm2 total_in..zlib::z_params]
38181
38182
38183The total number of input bytes read so far.
38184[heading Synopsis]
38185```
38186std::size_t total_in = 0;
38187```
38188
38189[heading Description]
38190
38191[endsect]
38192
38193[section:next_out zlib::z_params::next_out]
38194[indexterm2 next_out..zlib::z_params]
38195
38196
38197A pointer to the next output byte.
38198[heading Synopsis]
38199```
38200void* next_out;
38201```
38202
38203[heading Description]
38204
38205[endsect]
38206
38207[section:avail_out zlib::z_params::avail_out]
38208[indexterm2 avail_out..zlib::z_params]
38209
38210
38211The remaining bytes of space at `next_out`.
38212[heading Synopsis]
38213```
38214std::size_t avail_out;
38215```
38216
38217[heading Description]
38218
38219[endsect]
38220
38221[section:total_out zlib::z_params::total_out]
38222[indexterm2 total_out..zlib::z_params]
38223
38224
38225The total number of bytes output so far.
38226[heading Synopsis]
38227```
38228std::size_t total_out = 0;
38229```
38230
38231[heading Description]
38232
38233[endsect]
38234
38235[section:data_type zlib::z_params::data_type]
38236[indexterm2 data_type..zlib::z_params]
38237
38238
38239[heading Synopsis]
38240```
38241int data_type = ``[link beast.ref.boost__beast__zlib__kind unknown]``;
38242```
38243
38244[heading Description]
38245
38246[endsect]
38247
38248
38249[endsect]
38250
38251[section:boost__beast__errc errc]
38252[indexterm1 errc]
38253
38254
38255The set of constants used for cross-platform error codes.
38256[heading Synopsis]
38257Defined in header [include_file boost/beast/core/error.hpp]
38258
38259```
38260enum errc
38261```
38262
38263[heading Values]
38264[table [[Name][Description]]
38265]
38266[heading Description]
38267
38268
38269[endsect]
38270
38271[section:boost__beast__error error]
38272[indexterm1 error]
38273
38274
38275Error codes returned from library operations.
38276[heading Synopsis]
38277Defined in header [include_file boost/beast/core/error.hpp]
38278
38279```
38280enum error
38281```
38282
38283[heading Values]
38284[table [[Name][Description]]
38285  [
38286    [`timeout`
38287    ]
38288    [
38289
38290The socket was closed due to a timeout.
38291
38292This error indicates that a socket was closed due to a
38293a timeout detected during an operation.
38294
38295Error codes with this value will compare equal to @ref condition::timeout.
38296
38297    ]
38298  ]
38299]
38300[heading Description]
38301
38302
38303[endsect]
38304
38305[section:boost__beast__condition condition]
38306[indexterm1 condition]
38307
38308
38309Error conditions corresponding to sets of library error codes.
38310[heading Synopsis]
38311Defined in header [include_file boost/beast/core/error.hpp]
38312
38313```
38314enum condition
38315```
38316
38317[heading Values]
38318[table [[Name][Description]]
38319  [
38320    [`timeout`
38321    ]
38322    [
38323
38324The operation timed out.
38325
38326This error indicates that an operation took took too long.
38327
38328    ]
38329  ]
38330]
38331[heading Description]
38332
38333
38334[endsect]
38335
38336[section:boost__beast__file_mode file_mode]
38337[indexterm1 file_mode]
38338
38339
38340File open modes.
38341[heading Synopsis]
38342Defined in header [include_file boost/beast/core/file_base.hpp]
38343
38344```
38345enum file_mode
38346```
38347
38348[heading Values]
38349[table [[Name][Description]]
38350  [
38351    [`read`
38352    ]
38353    [
38354
38355Random read-only access to an existing file.
38356
38357    ]
38358  ]
38359  [
38360    [`scan`
38361    ]
38362    [
38363
38364Sequential read-only access to an existing file.
38365
38366    ]
38367  ]
38368  [
38369    [`write`
38370    ]
38371    [
38372
38373Random reading and writing to a new or truncated file.
38374
38375This mode permits random-access reading and writing
38376for the specified file. If the file does not exist
38377prior to the function call, it is created with an
38378initial size of zero bytes. Otherwise if the file
38379already exists, the size is truncated to zero bytes.
38380
38381    ]
38382  ]
38383  [
38384    [`write_new`
38385    ]
38386    [
38387
38388Random reading and writing to a new file only.
38389
38390This mode permits random-access reading and writing
38391for the specified file. The file will be created with
38392an initial size of zero bytes. If the file already exists
38393prior to the function call, an error is returned and
38394no file is opened.
38395
38396    ]
38397  ]
38398  [
38399    [`write_existing`
38400    ]
38401    [
38402
38403Random write-only access to existing file.
38404
38405If the file does not exist, an error is generated.
38406
38407    ]
38408  ]
38409  [
38410    [`append`
38411    ]
38412    [
38413
38414Appending to a new or truncated file.
38415
38416The current file position shall be set to the end of
38417the file prior to each write.
38418
38419@li If the file does not exist, it is created.
38420
38421@li If the file exists, it is truncated to
38422zero size upon opening.
38423
38424    ]
38425  ]
38426  [
38427    [`append_existing`
38428    ]
38429    [
38430
38431Appending to an existing file.
38432
38433The current file position shall be set to the end of
38434the file prior to each write.
38435
38436If the file does not exist, an error is generated.
38437
38438    ]
38439  ]
38440]
38441[heading Description]
38442These modes are used when opening files using instances of the ['File] concept.
38443
38444[heading See Also]
38445[link beast.ref.boost__beast__file_stdio `file_stdio`]
38446
38447
38448[endsect]
38449
38450[section:boost__beast__role_type role_type]
38451[indexterm1 role_type]
38452
38453
38454The role of local or remote peer.
38455[heading Synopsis]
38456Defined in header [include_file boost/beast/core/role.hpp]
38457
38458```
38459enum role_type
38460```
38461
38462[heading Values]
38463[table [[Name][Description]]
38464  [
38465    [`client`
38466    ]
38467    [
38468
38469The stream is operating as a client.
38470
38471    ]
38472  ]
38473  [
38474    [`server`
38475    ]
38476    [
38477
38478The stream is operating as a server.
38479
38480    ]
38481  ]
38482]
38483[heading Description]
38484Whether the endpoint is a client or server affects the behavior of teardown. The teardown behavior also depends on the type of the stream being torn down.
38485The default implementation of teardown for regular TCP/IP sockets is as follows:
38486
38487* In the client role, a TCP/IP shutdown is sent after reading all remaining data on the connection.
38488
38489* In the server role, a TCP/IP shutdown is sent before reading all remaining data on the connection.
38490
38491When the next layer type is a `net::ssl::stream`, the connection is closed by performing the SSL closing handshake corresponding to the role type, client or server.
38492
38493
38494[endsect]
38495
38496[section:boost__beast__is_const_buffer_sequence is_const_buffer_sequence]
38497[indexterm1 is_const_buffer_sequence]
38498
38499
38500Determine if a list of types satisfy the ['ConstBufferSequence] requirements.
38501[heading Synopsis]
38502Defined in header [include_file boost/beast/core/buffer_traits.hpp]
38503
38504```
38505template<
38506    class... __BufferSequence__>
38507using is_const_buffer_sequence = ``['see-below]``;
38508```
38509
38510[heading Description]
38511This metafunction is used to determine if all of the specified types meet the requirements for constant buffer sequences. This type alias will be `std::true_type` if each specified type meets the requirements, otherwise, this type alias will be `std::false_type`.
38512
38513[heading Template Parameters]
38514[table [[Type][Description]]
38515  [
38516    [`BufferSequence`
38517    ]
38518    [
38519A list of zero or more types to check. If this list is empty, the resulting type alias will be `std::true_type`.
38520    ]
38521  ]
38522]
38523
38524
38525[endsect]
38526
38527[section:boost__beast__is_mutable_buffer_sequence is_mutable_buffer_sequence]
38528[indexterm1 is_mutable_buffer_sequence]
38529
38530
38531Determine if a list of types satisfy the ['MutableBufferSequence] requirements.
38532[heading Synopsis]
38533Defined in header [include_file boost/beast/core/buffer_traits.hpp]
38534
38535```
38536template<
38537    class... __BufferSequence__>
38538using is_mutable_buffer_sequence = ``['see-below]``;
38539```
38540
38541[heading Description]
38542This metafunction is used to determine if all of the specified types meet the requirements for mutable buffer sequences. This type alias will be `std::true_type` if each specified type meets the requirements, otherwise, this type alias will be `std::false_type`.
38543
38544[heading Template Parameters]
38545[table [[Type][Description]]
38546  [
38547    [`BufferSequence`
38548    ]
38549    [
38550A list of zero or more types to check. If this list is empty, the resulting type alias will be `std::true_type`.
38551    ]
38552  ]
38553]
38554
38555
38556[endsect]
38557
38558[section:boost__beast__buffers_type buffers_type]
38559[indexterm1 buffers_type]
38560
38561
38562Type alias for the underlying buffer type of a list of buffer sequence types.
38563[heading Synopsis]
38564Defined in header [include_file boost/beast/core/buffer_traits.hpp]
38565
38566```
38567template<
38568    class... __BufferSequence__>
38569using buffers_type = ``['see-below]``;
38570```
38571
38572[heading Description]
38573This metafunction is used to determine the underlying buffer type for a list of buffer sequence. The equivalent type of the alias will vary depending on the template type argument:
38574
38575* If every type in the list is a ['MutableBufferSequence], the resulting type alias will be `net::mutable_buffer`, otherwise
38576
38577* The resulting type alias will be `net::const_buffer`.
38578
38579[heading Example]
38580
38581The following code returns the first buffer in a buffer sequence, or generates a compilation error if the argument is not a buffer sequence:
38582```
38583template <class BufferSequence>
38584buffers_type <BufferSequence>
38585buffers_front (BufferSequence const& buffers)
38586{
38587    static_assert(
38588        net::is_const_buffer_sequence<BufferSequence>::value,
38589        "BufferSequence type requirements not met");
38590    auto const first = net::buffer_sequence_begin (buffers);
38591    if (first == net::buffer_sequence_end (buffers))
38592        return {};
38593    return *first;
38594}
38595```
38596
38597[heading Template Parameters]
38598[table [[Type][Description]]
38599  [
38600    [`BufferSequence`
38601    ]
38602    [
38603A list of zero or more types to check. If this list is empty, the resulting type alias will be `net::mutable_buffer`.
38604    ]
38605  ]
38606]
38607
38608
38609[endsect]
38610
38611[section:boost__beast__buffers_iterator_type buffers_iterator_type]
38612[indexterm1 buffers_iterator_type]
38613
38614
38615Type alias for the iterator type of a buffer sequence type.
38616[heading Synopsis]
38617Defined in header [include_file boost/beast/core/buffer_traits.hpp]
38618
38619```
38620template<
38621    class __BufferSequence__>
38622using buffers_iterator_type = ``['see-below]``;
38623```
38624
38625[heading Description]
38626This metafunction is used to determine the type of iterator used by a particular buffer sequence.
38627
38628[heading Template Parameters]
38629[table [[Type][Description]]
38630  [
38631    [`T`
38632    ]
38633    [
38634The buffer sequence type to use. The resulting type alias will be equal to the iterator type used by the buffer sequence.
38635    ]
38636  ]
38637]
38638
38639
38640[endsect]
38641
38642[section:boost__beast__error_code error_code]
38643[indexterm1 error_code]
38644
38645
38646The type of error code used by the library.
38647[heading Synopsis]
38648Defined in header [include_file boost/beast/core/error.hpp]
38649
38650```
38651using error_code = boost::system::error_code;
38652```
38653
38654[heading Description]
38655
38656
38657[endsect]
38658
38659[section:boost__beast__system_error system_error]
38660[indexterm1 system_error]
38661
38662
38663The type of system error thrown by the library.
38664[heading Synopsis]
38665Defined in header [include_file boost/beast/core/error.hpp]
38666
38667```
38668using system_error = boost::system::system_error;
38669```
38670
38671[heading Description]
38672
38673
38674[endsect]
38675
38676[section:boost__beast__error_category error_category]
38677[indexterm1 error_category]
38678
38679
38680The type of error category used by the library.
38681[heading Synopsis]
38682Defined in header [include_file boost/beast/core/error.hpp]
38683
38684```
38685using error_category = boost::system::error_category;
38686```
38687
38688[heading Description]
38689
38690
38691[endsect]
38692
38693[section:boost__beast__error_condition error_condition]
38694[indexterm1 error_condition]
38695
38696
38697The type of error condition used by the library.
38698[heading Synopsis]
38699Defined in header [include_file boost/beast/core/error.hpp]
38700
38701```
38702using error_condition = boost::system::error_condition;
38703```
38704
38705[heading Description]
38706
38707
38708[endsect]
38709
38710[section:boost__beast__flat_buffer flat_buffer]
38711[indexterm1 flat_buffer]
38712
38713
38714A flat buffer which uses the default allocator.
38715[heading Synopsis]
38716Defined in header [include_file boost/beast/core/flat_buffer.hpp]
38717
38718```
38719using flat_buffer = basic_flat_buffer< std::allocator< char > >;
38720```
38721
38722[heading Types]
38723[table [[Name][Description]]
38724  [
38725    [[*[link beast.ref.boost__beast__basic_flat_buffer.allocator_type allocator_type]]
38726    ]
38727    [
38728
38729The type of allocator used.
38730    ]
38731  ]
38732  [
38733    [[*[link beast.ref.boost__beast__basic_flat_buffer.const_buffers_type const_buffers_type]]
38734    ]
38735    [
38736
38737The ConstBufferSequence used to represent the readable bytes.
38738    ]
38739  ]
38740  [
38741    [[*[link beast.ref.boost__beast__basic_flat_buffer.mutable_buffers_type mutable_buffers_type]]
38742    ]
38743    [
38744
38745The MutableBufferSequence used to represent the writable bytes.
38746    ]
38747  ]
38748]
38749[heading Member Functions]
38750[table [[Name][Description]]
38751  [
38752    [[*[link beast.ref.boost__beast__basic_flat_buffer.basic_flat_buffer basic_flat_buffer]]
38753    ]
38754    [
38755
38756Constructor.
38757
38758Move Constructor.
38759
38760Copy Constructor.
38761    ]
38762  ]
38763  [
38764    [[*[link beast.ref.boost__beast__basic_flat_buffer.capacity capacity]]
38765    ]
38766    [
38767
38768Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
38769    ]
38770  ]
38771  [
38772    [[*[link beast.ref.boost__beast__basic_flat_buffer.cdata cdata]]
38773    ]
38774    [
38775
38776Returns a constant buffer sequence representing the readable bytes.
38777    ]
38778  ]
38779  [
38780    [[*[link beast.ref.boost__beast__basic_flat_buffer.clear clear]]
38781    ]
38782    [
38783
38784Set the size of the readable and writable bytes to zero.
38785    ]
38786  ]
38787  [
38788    [[*[link beast.ref.boost__beast__basic_flat_buffer.commit commit]]
38789    ]
38790    [
38791
38792Append writable bytes to the readable bytes.
38793    ]
38794  ]
38795  [
38796    [[*[link beast.ref.boost__beast__basic_flat_buffer.consume consume]]
38797    ]
38798    [
38799
38800Remove bytes from beginning of the readable bytes.
38801    ]
38802  ]
38803  [
38804    [[*[link beast.ref.boost__beast__basic_flat_buffer.data data]]
38805    ]
38806    [
38807
38808Returns a constant buffer sequence representing the readable bytes.
38809
38810Returns a mutable buffer sequence representing the readable bytes.
38811    ]
38812  ]
38813  [
38814    [[*[link beast.ref.boost__beast__basic_flat_buffer.get_allocator get_allocator]]
38815    ]
38816    [
38817
38818Returns a copy of the allocator used.
38819    ]
38820  ]
38821  [
38822    [[*[link beast.ref.boost__beast__basic_flat_buffer.max_size max_size]]
38823    ]
38824    [
38825
38826Set the maximum allowed capacity.
38827
38828Return the maximum number of bytes, both readable and writable, that can ever be held.
38829    ]
38830  ]
38831  [
38832    [[*[link beast.ref.boost__beast__basic_flat_buffer.operator_eq_ operator=]]
38833    ]
38834    [
38835
38836Move Assignment.
38837
38838Copy Assignment.
38839
38840Copy assignment.
38841    ]
38842  ]
38843  [
38844    [[*[link beast.ref.boost__beast__basic_flat_buffer.prepare prepare]]
38845    ]
38846    [
38847
38848Returns a mutable buffer sequence representing writable bytes.
38849    ]
38850  ]
38851  [
38852    [[*[link beast.ref.boost__beast__basic_flat_buffer.reserve reserve]]
38853    ]
38854    [
38855
38856Guarantee a minimum capacity.
38857    ]
38858  ]
38859  [
38860    [[*[link beast.ref.boost__beast__basic_flat_buffer.shrink_to_fit shrink_to_fit]]
38861    ]
38862    [
38863
38864Request the removal of unused capacity.
38865    ]
38866  ]
38867  [
38868    [[*[link beast.ref.boost__beast__basic_flat_buffer.size size]]
38869    ]
38870    [
38871
38872Returns the number of readable bytes.
38873    ]
38874  ]
38875  [
38876    [[*[link beast.ref.boost__beast__basic_flat_buffer._basic_flat_buffer ~basic_flat_buffer]]
38877    ]
38878    [
38879
38880Destructor.
38881    ]
38882  ]
38883]
38884[heading Friends]
38885[table [[Name][Description]]
38886  [
38887    [[*[link beast.ref.boost__beast__basic_flat_buffer.swap swap]]
38888    ]
38889    [
38890
38891Exchange two dynamic buffers.
38892    ]
38893  ]
38894]
38895A dynamic buffer encapsulates memory storage that may be automatically resized as required, where the memory is divided into two regions: readable bytes followed by writable bytes. These memory regions are internal to the dynamic buffer, but direct access to the elements is provided to permit them to be efficiently used with I/O operations.
38896Objects of this type meet the requirements of ['DynamicBuffer] and have the following additional properties:
38897
38898* A mutable buffer sequence representing the readable bytes is returned by [link beast.ref.boost__beast__basic_flat_buffer.data `data`] when `this` is non-const.
38899
38900* A configurable maximum buffer size may be set upon construction. Attempts to exceed the buffer size will throw `std::length_error`.
38901
38902* Buffer sequences representing the readable and writable bytes, returned by [link beast.ref.boost__beast__basic_flat_buffer.data `data`] and [link beast.ref.boost__beast__basic_flat_buffer.prepare `prepare`], will have length one.
38903
38904Upon construction, a maximum size for the buffer may be specified. If this limit is exceeded, the `std::length_error` exception will be thrown.
38905
38906[heading Remarks]
38907This class is designed for use with algorithms that take dynamic buffers as parameters, and are optimized for the case where the input sequence or output sequence is stored in a single contiguous buffer.
38908[heading Description]
38909
38910
38911[endsect]
38912
38913[section:boost__beast__multi_buffer multi_buffer]
38914[indexterm1 multi_buffer]
38915
38916
38917A typical multi buffer.
38918[heading Synopsis]
38919Defined in header [include_file boost/beast/core/multi_buffer.hpp]
38920
38921```
38922using multi_buffer = basic_multi_buffer< std::allocator< char > >;
38923```
38924
38925[heading Types]
38926[table [[Name][Description]]
38927  [
38928    [[*[link beast.ref.boost__beast__basic_multi_buffer.allocator_type allocator_type]]
38929    ]
38930    [
38931
38932The type of allocator used.
38933    ]
38934  ]
38935  [
38936    [[*[link beast.ref.boost__beast__basic_multi_buffer.const_buffers_type const_buffers_type]]
38937    ]
38938    [
38939
38940The ConstBufferSequence used to represent the readable bytes.
38941    ]
38942  ]
38943  [
38944    [[*[link beast.ref.boost__beast__basic_multi_buffer.mutable_buffers_type mutable_buffers_type]]
38945    ]
38946    [
38947
38948The MutableBufferSequence used to represent the writable bytes.
38949    ]
38950  ]
38951]
38952[heading Member Functions]
38953[table [[Name][Description]]
38954  [
38955    [[*[link beast.ref.boost__beast__basic_multi_buffer.basic_multi_buffer basic_multi_buffer]]
38956    ]
38957    [
38958
38959Constructor.
38960
38961Move Constructor.
38962
38963Copy Constructor.
38964    ]
38965  ]
38966  [
38967    [[*[link beast.ref.boost__beast__basic_multi_buffer.capacity capacity]]
38968    ]
38969    [
38970
38971Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
38972    ]
38973  ]
38974  [
38975    [[*[link beast.ref.boost__beast__basic_multi_buffer.cdata cdata]]
38976    ]
38977    [
38978
38979Returns a constant buffer sequence representing the readable bytes.
38980    ]
38981  ]
38982  [
38983    [[*[link beast.ref.boost__beast__basic_multi_buffer.clear clear]]
38984    ]
38985    [
38986
38987Set the size of the readable and writable bytes to zero.
38988    ]
38989  ]
38990  [
38991    [[*[link beast.ref.boost__beast__basic_multi_buffer.commit commit]]
38992    ]
38993    [
38994
38995Append writable bytes to the readable bytes.
38996    ]
38997  ]
38998  [
38999    [[*[link beast.ref.boost__beast__basic_multi_buffer.consume consume]]
39000    ]
39001    [
39002
39003Remove bytes from beginning of the readable bytes.
39004    ]
39005  ]
39006  [
39007    [[*[link beast.ref.boost__beast__basic_multi_buffer.data data]]
39008    ]
39009    [
39010
39011Returns a constant buffer sequence representing the readable bytes.
39012
39013Returns a mutable buffer sequence representing the readable bytes.
39014    ]
39015  ]
39016  [
39017    [[*[link beast.ref.boost__beast__basic_multi_buffer.get_allocator get_allocator]]
39018    ]
39019    [
39020
39021Returns a copy of the allocator used.
39022    ]
39023  ]
39024  [
39025    [[*[link beast.ref.boost__beast__basic_multi_buffer.max_size max_size]]
39026    ]
39027    [
39028
39029Set the maximum allowed capacity.
39030
39031Return the maximum number of bytes, both readable and writable, that can ever be held.
39032    ]
39033  ]
39034  [
39035    [[*[link beast.ref.boost__beast__basic_multi_buffer.operator_eq_ operator=]]
39036    ]
39037    [
39038
39039Move Assignment.
39040
39041Copy Assignment.
39042    ]
39043  ]
39044  [
39045    [[*[link beast.ref.boost__beast__basic_multi_buffer.prepare prepare]]
39046    ]
39047    [
39048
39049Returns a mutable buffer sequence representing writable bytes.
39050    ]
39051  ]
39052  [
39053    [[*[link beast.ref.boost__beast__basic_multi_buffer.reserve reserve]]
39054    ]
39055    [
39056
39057Guarantee a minimum capacity.
39058    ]
39059  ]
39060  [
39061    [[*[link beast.ref.boost__beast__basic_multi_buffer.shrink_to_fit shrink_to_fit]]
39062    ]
39063    [
39064
39065Reallocate the buffer to fit the readable bytes exactly.
39066    ]
39067  ]
39068  [
39069    [[*[link beast.ref.boost__beast__basic_multi_buffer.size size]]
39070    ]
39071    [
39072
39073Returns the number of readable bytes.
39074    ]
39075  ]
39076  [
39077    [[*[link beast.ref.boost__beast__basic_multi_buffer._basic_multi_buffer ~basic_multi_buffer]]
39078    ]
39079    [
39080
39081Destructor.
39082    ]
39083  ]
39084]
39085[heading Friends]
39086[table [[Name][Description]]
39087  [
39088    [[*[link beast.ref.boost__beast__basic_multi_buffer.swap swap]]
39089    ]
39090    [
39091
39092Exchange two dynamic buffers.
39093    ]
39094  ]
39095]
39096A dynamic buffer encapsulates memory storage that may be automatically resized as required, where the memory is divided into two regions: readable bytes followed by writable bytes. These memory regions are internal to the dynamic buffer, but direct access to the elements is provided to permit them to be efficiently used with I/O operations.
39097The implementation uses a sequence of one or more byte arrays of varying sizes to represent the readable and writable bytes. Additional byte array objects are appended to the sequence to accommodate changes in the desired size. The behavior and implementation of this container is most similar to `std::deque`.
39098Objects of this type meet the requirements of ['DynamicBuffer] and have the following additional properties:
39099
39100* A mutable buffer sequence representing the readable bytes is returned by [link beast.ref.boost__beast__basic_multi_buffer.data `data`] when `this` is non-const.
39101
39102* Buffer sequences representing the readable and writable bytes, returned by [link beast.ref.boost__beast__basic_multi_buffer.data `data`] and [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`], may have length greater than one.
39103
39104* A configurable maximum size may be set upon construction and adjusted afterwards. Calls to [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] that would exceed this size will throw `std::length_error`.
39105
39106* Sequences previously obtained using [link beast.ref.boost__beast__basic_multi_buffer.data `data`] remain valid after calls to [link beast.ref.boost__beast__basic_multi_buffer.prepare `prepare`] or [link beast.ref.boost__beast__basic_multi_buffer.commit `commit`].
39107
39108[heading Template Parameters]
39109[table [[Type][Description]]
39110  [
39111    [`Allocator`
39112    ]
39113    [
39114The allocator to use for managing memory.
39115    ]
39116  ]
39117]
39118[heading Description]
39119
39120
39121[endsect]
39122
39123[section:boost__beast__lowest_layer_type lowest_layer_type]
39124[indexterm1 lowest_layer_type]
39125
39126
39127A trait to determine the lowest layer type of a stack of stream layers.
39128[heading Synopsis]
39129Defined in header [include_file boost/beast/core/stream_traits.hpp]
39130
39131```
39132template<
39133    class T>
39134using lowest_layer_type = ``['see-below]``;
39135```
39136
39137[heading Description]
39138If `t.next_layer()` is well-defined for an object `t` of type `T`, then `lowest_layer_type<T>` will be an alias for `lowest_layer_type<decltype(t.next_layer())>`, otherwise it will be the type `std::remove_reference<T>`.
39139
39140[heading Parameters]
39141[table [[Name][Description]]
39142  [
39143    [`T`
39144    ]
39145    [
39146The type to determine the lowest layer type of.
39147    ]
39148  ]
39149]
39150[heading Return Value]
39151The type of the lowest layer.
39152
39153
39154[endsect]
39155
39156[section:boost__beast__executor_type executor_type]
39157[indexterm1 executor_type]
39158
39159
39160A trait to determine the return type of get_executor.
39161[heading Synopsis]
39162Defined in header [include_file boost/beast/core/stream_traits.hpp]
39163
39164```
39165template<
39166    class T>
39167using executor_type = ``['see-below]``;
39168```
39169
39170[heading Description]
39171This type alias will be the type of values returned by by calling member `get_exector` on an object of type `T&`.
39172
39173[heading Parameters]
39174[table [[Name][Description]]
39175  [
39176    [`T`
39177    ]
39178    [
39179The type to query
39180    ]
39181  ]
39182]
39183[heading Return Value]
39184The type of values returned from `get_executor`.
39185
39186
39187[endsect]
39188
39189[section:boost__beast__has_get_executor has_get_executor]
39190[indexterm1 has_get_executor]
39191
39192
39193Determine if `T` has the `get_executor` member function.
39194[heading Synopsis]
39195Defined in header [include_file boost/beast/core/stream_traits.hpp]
39196
39197```
39198template<
39199    class T>
39200using has_get_executor = ``['see-below]``;
39201```
39202
39203[heading Description]
39204Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` has the member function with the correct signature, else type will be `std::false_type`.
39205
39206[heading Example]
39207
39208Use with tag dispatching:
39209
39210```
39211template<class T>
39212void maybe_hello(T const& t, std::true_type)
39213{
39214    net::post(
39215        t.get_executor(),
39216        []
39217        {
39218            std::cout << "Hello, world!" << std::endl;
39219        });
39220}
39221
39222template<class T>
39223void maybe_hello(T const&, std::false_type)
39224{
39225    // T does not have get_executor
39226}
39227
39228template<class T>
39229void maybe_hello(T const& t)
39230{
39231    maybe_hello(t, has_get_executor<T>{});
39232}
39233```
39234
39235Use with `static_assert`:
39236
39237```
39238struct stream
39239{
39240    using executor_type = net::io_context::executor_type;
39241    executor_type get_executor() noexcept;
39242};
39243
39244static_assert(has_get_executor<stream>::value, "Missing get_executor member");
39245```
39246
39247
39248
39249[endsect]
39250
39251[section:boost__beast__is_sync_read_stream is_sync_read_stream]
39252[indexterm1 is_sync_read_stream]
39253
39254
39255Determine if at type meets the requirements of ['SyncReadStream].
39256[heading Synopsis]
39257Defined in header [include_file boost/beast/core/stream_traits.hpp]
39258
39259```
39260template<
39261    class T>
39262using is_sync_read_stream = ``['see-below]``;
39263```
39264
39265[heading Description]
39266Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, else the type will be `std::false_type`.
39267
39268[heading Example]
39269
39270Use with `static_assert`:
39271```
39272template<class SyncReadStream>
39273void f(SyncReadStream& stream)
39274{
39275    static_assert(is_sync_read_stream<SyncReadStream>::value,
39276        "SyncReadStream type requirements not met");
39277...
39278```
39279
39280Use with `std::enable_if` (SFINAE):
39281```
39282template<class SyncReadStream>
39283typename std::enable_if<is_sync_read_stream<SyncReadStream>::value>::type
39284f(SyncReadStream& stream);
39285```
39286
39287
39288
39289[endsect]
39290
39291[section:boost__beast__is_sync_write_stream is_sync_write_stream]
39292[indexterm1 is_sync_write_stream]
39293
39294
39295Determine if `T` meets the requirements of ['SyncWriteStream].
39296[heading Synopsis]
39297Defined in header [include_file boost/beast/core/stream_traits.hpp]
39298
39299```
39300template<
39301    class T>
39302using is_sync_write_stream = ``['see-below]``;
39303```
39304
39305[heading Description]
39306Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, else the type will be `std::false_type`.
39307
39308[heading Example]
39309
39310Use with `static_assert`:
39311
39312```
39313template<class SyncReadStream>
39314void f(SyncReadStream& stream)
39315{
39316    static_assert(is_sync_read_stream<SyncReadStream>::value,
39317        "SyncReadStream type requirements not met");
39318...
39319```
39320
39321Use with `std::enable_if` (SFINAE):
39322
39323```
39324template<class SyncReadStream>
39325typename std::enable_if<is_sync_read_stream<SyncReadStream>::value>::type
39326f(SyncReadStream& stream);
39327```
39328
39329
39330
39331[endsect]
39332
39333[section:boost__beast__is_sync_stream is_sync_stream]
39334[indexterm1 is_sync_stream]
39335
39336
39337Determine if `T` meets the requirements of [*SyncStream].
39338[heading Synopsis]
39339Defined in header [include_file boost/beast/core/stream_traits.hpp]
39340
39341```
39342template<
39343    class T>
39344using is_sync_stream = ``['see-below]``;
39345```
39346
39347[heading Description]
39348Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, else the type will be `std::false_type`.
39349
39350[heading Example]
39351
39352Use with `static_assert`:
39353
39354```
39355template<class SyncStream>
39356void f(SyncStream& stream)
39357{
39358    static_assert(is_sync_stream<SyncStream>::value,
39359        "SyncStream type requirements not met");
39360...
39361```
39362
39363Use with `std::enable_if` (SFINAE):
39364
39365```
39366template<class SyncStream>
39367typename std::enable_if<is_sync_stream<SyncStream>::value>::type
39368f(SyncStream& stream);
39369```
39370
39371
39372
39373[endsect]
39374
39375[section:boost__beast__is_async_read_stream is_async_read_stream]
39376[indexterm1 is_async_read_stream]
39377
39378
39379Determine if `T` meets the requirements of ['AsyncReadStream].
39380[heading Synopsis]
39381Defined in header [include_file boost/beast/core/stream_traits.hpp]
39382
39383```
39384template<
39385    class T>
39386using is_async_read_stream = ``['see-below]``;
39387```
39388
39389[heading Description]
39390Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, else the type will be `std::false_type`.
39391
39392[heading Example]
39393
39394Use with `static_assert`:
39395
39396```
39397template<class AsyncReadStream>
39398void f(AsyncReadStream& stream)
39399{
39400    static_assert(is_async_read_stream<AsyncReadStream>::value,
39401        "AsyncReadStream type requirements not met");
39402...
39403```
39404
39405Use with `std::enable_if` (SFINAE):
39406
39407```
39408template<class AsyncReadStream>
39409typename std::enable_if<is_async_read_stream<AsyncReadStream>::value>::type
39410f(AsyncReadStream& stream);
39411```
39412
39413
39414
39415[endsect]
39416
39417[section:boost__beast__is_async_write_stream is_async_write_stream]
39418[indexterm1 is_async_write_stream]
39419
39420
39421Determine if `T` meets the requirements of ['AsyncWriteStream].
39422[heading Synopsis]
39423Defined in header [include_file boost/beast/core/stream_traits.hpp]
39424
39425```
39426template<
39427    class T>
39428using is_async_write_stream = ``['see-below]``;
39429```
39430
39431[heading Description]
39432Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, else the type will be `std::false_type`.
39433
39434[heading Example]
39435
39436Use with `static_assert`:
39437
39438```
39439template<class AsyncWriteStream>
39440void f(AsyncWriteStream& stream)
39441{
39442    static_assert(is_async_write_stream<AsyncWriteStream>::value,
39443        "AsyncWriteStream type requirements not met");
39444...
39445```
39446
39447Use with `std::enable_if` (SFINAE):
39448
39449```
39450template<class AsyncWriteStream>
39451typename std::enable_if<is_async_write_stream<AsyncWriteStream>::value>::type
39452f(AsyncWriteStream& stream);
39453```
39454
39455
39456
39457[endsect]
39458
39459[section:boost__beast__is_async_stream is_async_stream]
39460[indexterm1 is_async_stream]
39461
39462
39463Determine if `T` meets the requirements of [*AsyncStream].
39464[heading Synopsis]
39465Defined in header [include_file boost/beast/core/stream_traits.hpp]
39466
39467```
39468template<
39469    class T>
39470using is_async_stream = ``['see-below]``;
39471```
39472
39473[heading Description]
39474Metafunctions are used to perform compile time checking of template types. This type will be `std::true_type` if `T` meets the requirements, else the type will be `std::false_type`.
39475
39476[heading Example]
39477
39478Use with `static_assert`:
39479
39480```
39481template<class AsyncStream>
39482void f(AsyncStream& stream)
39483{
39484    static_assert(is_async_stream<AsyncStream>::value,
39485        "AsyncStream type requirements not met");
39486...
39487```
39488
39489Use with `std::enable_if` (SFINAE):
39490
39491```
39492template<class AsyncStream>
39493typename std::enable_if<is_async_stream<AsyncStream>::value>::type
39494f(AsyncStream& stream);
39495```
39496
39497
39498
39499[endsect]
39500
39501[section:boost__beast__string_view string_view]
39502[indexterm1 string_view]
39503
39504
39505The type of string view used by the library.
39506[heading Synopsis]
39507Defined in header [include_file boost/beast/core/string_type.hpp]
39508
39509```
39510using string_view = boost::string_view;
39511```
39512
39513[heading Description]
39514
39515
39516[endsect]
39517
39518[section:boost__beast__basic_string_view basic_string_view]
39519[indexterm1 basic_string_view]
39520
39521
39522The type of `basic_string_view` used by the library.
39523[heading Synopsis]
39524Defined in header [include_file boost/beast/core/string_type.hpp]
39525
39526```
39527template<
39528    class CharT,
39529    class Traits>
39530using basic_string_view = boost::basic_string_view< CharT, Traits >;
39531```
39532
39533[heading Description]
39534
39535
39536[endsect]
39537
39538[section:boost__beast__tcp_stream tcp_stream]
39539[indexterm1 tcp_stream]
39540
39541
39542A TCP/IP stream socket with timeouts and a polymorphic executor.
39543[heading Synopsis]
39544Defined in header [include_file boost/beast/core/tcp_stream.hpp]
39545
39546```
39547using tcp_stream = basic_stream< net::ip::tcp, net::any_io_executor, unlimited_rate_policy >;
39548```
39549
39550[heading Types]
39551[table [[Name][Description]]
39552  [
39553    [[*[link beast.ref.boost__beast__basic_stream.endpoint_type endpoint_type]]
39554    ]
39555    [
39556
39557The endpoint type.
39558    ]
39559  ]
39560  [
39561    [[*[link beast.ref.boost__beast__basic_stream.executor_type executor_type]]
39562    ]
39563    [
39564
39565The type of the executor associated with the stream.
39566    ]
39567  ]
39568  [
39569    [[*[link beast.ref.boost__beast__basic_stream.protocol_type protocol_type]]
39570    ]
39571    [
39572
39573The protocol type.
39574    ]
39575  ]
39576  [
39577    [[*[link beast.ref.boost__beast__basic_stream__rebind_executor rebind_executor]]
39578    ]
39579    [
39580
39581Rebinds the stream type to another executor.
39582    ]
39583  ]
39584  [
39585    [[*[link beast.ref.boost__beast__basic_stream.socket_type socket_type]]
39586    ]
39587    [
39588
39589The type of the underlying socket.
39590    ]
39591  ]
39592]
39593[heading Member Functions]
39594[table [[Name][Description]]
39595  [
39596    [[*[link beast.ref.boost__beast__basic_stream.async_connect async_connect]]
39597    ]
39598    [
39599
39600Connect the stream to the specified endpoint asynchronously.
39601
39602Establishes a connection by trying each endpoint in a sequence asynchronously.
39603    ]
39604  ]
39605  [
39606    [[*[link beast.ref.boost__beast__basic_stream.async_read_some async_read_some]]
39607    ]
39608    [
39609
39610Read some data asynchronously.
39611    ]
39612  ]
39613  [
39614    [[*[link beast.ref.boost__beast__basic_stream.async_write_some async_write_some]]
39615    ]
39616    [
39617
39618Write some data asynchronously.
39619    ]
39620  ]
39621  [
39622    [[*[link beast.ref.boost__beast__basic_stream.basic_stream basic_stream]]
39623    ]
39624    [
39625
39626Constructor.
39627
39628Move constructor.
39629    ]
39630  ]
39631  [
39632    [[*[link beast.ref.boost__beast__basic_stream.cancel cancel]]
39633    ]
39634    [
39635
39636Cancel all asynchronous operations associated with the socket.
39637    ]
39638  ]
39639  [
39640    [[*[link beast.ref.boost__beast__basic_stream.close close]]
39641    ]
39642    [
39643
39644Close the timed stream.
39645    ]
39646  ]
39647  [
39648    [[*[link beast.ref.boost__beast__basic_stream.connect connect]]
39649    ]
39650    [
39651
39652Connect the stream to the specified endpoint.
39653
39654Establishes a connection by trying each endpoint in a sequence.
39655    ]
39656  ]
39657  [
39658    [[*[link beast.ref.boost__beast__basic_stream.expires_after expires_after]]
39659    ]
39660    [
39661
39662Set the timeout for the next logical operation.
39663    ]
39664  ]
39665  [
39666    [[*[link beast.ref.boost__beast__basic_stream.expires_at expires_at]]
39667    ]
39668    [
39669
39670Set the timeout for the next logical operation.
39671    ]
39672  ]
39673  [
39674    [[*[link beast.ref.boost__beast__basic_stream.expires_never expires_never]]
39675    ]
39676    [
39677
39678Disable the timeout for the next logical operation.
39679    ]
39680  ]
39681  [
39682    [[*[link beast.ref.boost__beast__basic_stream.get_executor get_executor]]
39683    ]
39684    [
39685
39686Get the executor associated with the object.
39687    ]
39688  ]
39689  [
39690    [[*[link beast.ref.boost__beast__basic_stream.operator_eq_ operator=]]
39691    ]
39692    [
39693
39694Move assignment (deleted).
39695    ]
39696  ]
39697  [
39698    [[*[link beast.ref.boost__beast__basic_stream.rate_policy rate_policy]]
39699    ]
39700    [
39701
39702Returns the rate policy associated with the object.
39703    ]
39704  ]
39705  [
39706    [[*[link beast.ref.boost__beast__basic_stream.read_some read_some]]
39707    ]
39708    [
39709
39710Read some data.
39711    ]
39712  ]
39713  [
39714    [[*[link beast.ref.boost__beast__basic_stream.release_socket release_socket]]
39715    ]
39716    [
39717
39718Release ownership of the underlying socket.
39719    ]
39720  ]
39721  [
39722    [[*[link beast.ref.boost__beast__basic_stream.socket socket]]
39723    ]
39724    [
39725
39726Return a reference to the underlying socket.
39727    ]
39728  ]
39729  [
39730    [[*[link beast.ref.boost__beast__basic_stream.write_some write_some]]
39731    ]
39732    [
39733
39734Write some data.
39735    ]
39736  ]
39737  [
39738    [[*[link beast.ref.boost__beast__basic_stream._basic_stream ~basic_stream]]
39739    ]
39740    [
39741
39742Destructor.
39743    ]
39744  ]
39745]
39746This stream wraps a `net::basic_stream_socket` to provide the following features:
39747
39748* An ['Executor] may be associated with the stream, which will be used to invoke any completion handlers which do not already have an associated executor. This achieves support for [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1322r0.html [P1322R0] Networking TS enhancement to enable custom I/O executors].
39749
39750* Timeouts may be specified for each logical asynchronous operation performing any reading, writing, or connecting.
39751
39752* A ['RatePolicy] may be associated with the stream, to implement rate limiting through the policy's interface.
39753
39754Although the stream supports multiple concurrent outstanding asynchronous operations, the stream object is not thread-safe. The caller is responsible for ensuring that the stream is accessed from only one thread at a time. This includes the times when the stream, and its underlying socket, are accessed by the networking implementation. To meet this thread safety requirement, all asynchronous operations must be performed by the stream within the same implicit strand (only one thread `net::io_context::run`) or within the same explicit strand, such as an instance of `net::strand`.
39755Completion handlers with explicit associated executors (such as those arising from use of `net::bind_executor`) will be invoked by the stream using the associated executor. Otherwise, the completion handler will be invoked by the executor associated with the stream upon construction. The type of executor used with this stream must meet the following requirements:
39756
39757* Function objects submitted to the executor shall never run concurrently with each other.
39758
39759The executor type `net::strand` meets these requirements. Use of a strand as the executor in the stream class template offers an additional notational convenience: the strand does not need to be specified in each individual initiating function call.
39760Unlike other stream wrappers, the underlying socket is accessed through the [link beast.ref.boost__beast__basic_stream.socket `socket`] member function instead of `next_layer`. This causes the [link beast.ref.boost__beast__basic_stream `basic_stream`] to be returned in calls to [link beast.ref.boost__beast__get_lowest_layer `get_lowest_layer`].
39761
39762[heading Usage]
39763
39764To use this stream declare an instance of the class. Then, before each logical operation for which a timeout is desired, call [link beast.ref.boost__beast__basic_stream.expires_after `expires_after`] with a duration, or call [link beast.ref.boost__beast__basic_stream.expires_at `expires_at`] with a time point. Alternatively, call [link beast.ref.boost__beast__basic_stream.expires_never `expires_never`] to disable the timeout for subsequent logical operations. A logical operation is any series of one or more direct or indirect calls to the timeout stream's asynchronous read, asynchronous write, or asynchronous connect functions.
39765When a timeout is set and a mixed operation is performed (one that includes both reads and writes, for example) the timeout applies to all of the intermediate asynchronous operations used in the enclosing operation. This allows timeouts to be applied to stream algorithms which were not written specifically to allow for timeouts, when those algorithms are passed a timeout stream with a timeout set.
39766When a timeout occurs the socket will be closed, canceling any pending I/O operations. The completion handlers for these canceled operations will be invoked with the error [link beast.ref.boost__beast__error `beast::error::timeout`].
39767
39768[heading Examples]
39769
39770This function reads an HTTP request with a timeout, then sends the HTTP response with a different timeout.
39771
39772```
39773void process_http_1 (tcp_stream& stream, net::yield_context yield)
39774{
39775    flat_buffer buffer;
39776    http::request<http::empty_body> req;
39777
39778    // Read the request, with a 15 second timeout
39779    stream.expires_after(std::chrono::seconds(15));
39780    http::async_read(stream, buffer, req, yield);
39781
39782    // Calculate the response
39783    http::response<http::string_body> res = make_response(req);
39784
39785    // Send the response, with a 30 second timeout.
39786    stream.expires_after (std::chrono::seconds(30));
39787    http::async_write (stream, res, yield);
39788}
39789```
39790
39791The example above could be expressed using a single timeout with a simple modification. The function that follows first reads an HTTP request then sends the HTTP response, with a single timeout that applies to the entire combined operation of reading and writing:
39792
39793```
39794void process_http_2 (tcp_stream& stream, net::yield_context yield)
39795{
39796    flat_buffer buffer;
39797    http::request<http::empty_body> req;
39798
39799    // Require that the read and write combined take no longer than 30 seconds
39800    stream.expires_after(std::chrono::seconds(30));
39801
39802    http::async_read(stream, buffer, req, yield);
39803
39804    http::response<http::string_body> res = make_response(req);
39805    http::async_write (stream, res, yield);
39806}
39807```
39808
39809Some stream algorithms, such as `ssl::stream::async_handshake` perform both reads and writes. A timeout set before calling the initiating function of such composite stream algorithms will apply to the entire composite operation. For example, a timeout may be set on performing the SSL handshake thusly:
39810
39811```
39812void do_ssl_handshake (net::ssl::stream<tcp_stream>& stream, net::yield_context yield)
39813{
39814    // Require that the SSL handshake take no longer than 10 seconds
39815    stream.expires_after(std::chrono::seconds(10));
39816
39817    stream.async_handshake(net::ssl::stream_base::client, yield);
39818}
39819```
39820
39821
39822[heading Blocking I/O]
39823
39824Synchronous functions behave identically as that of the wrapped `net::basic_stream_socket`. Timeouts are not available when performing blocking calls.
39825
39826[heading Template Parameters]
39827[table [[Type][Description]]
39828  [
39829    [`Protocol`
39830    ]
39831    [
39832A type meeting the requirements of ['Protocol] representing the protocol the protocol to use for the basic stream socket. A common choice is `net::ip::tcp`.
39833    ]
39834  ]
39835  [
39836    [`Executor`
39837    ]
39838    [
39839A type meeting the requirements of ['Executor] to be used for submitting all completion handlers which do not already have an associated executor. If this type is omitted, the default of `net::any_io_executor` will be used.
39840    ]
39841  ]
39842]
39843[heading Thread Safety]
39844
39845['Distinct objects]: Safe.
39846
39847
39848['Shared objects]: Unsafe. The application must also ensure that all asynchronous operations are performed within the same implicit or explicit strand.
39849[heading See Also]
39850
39851* [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1322r0.html [P1322R0] Networking TS enhancement to enable custom I/O executors].
39852
39853This rate policy object does not apply any rate limit.
39854
39855* ['RatePolicy]
39856
39857[heading See Also]
39858[link beast.ref.boost__beast__basic_stream `beast::basic_stream`], [link beast.ref.boost__beast__tcp_stream `beast::tcp_stream`]
39859[heading Description]
39860
39861[heading See Also]
39862[link beast.ref.boost__beast__basic_stream `basic_stream`]
39863
39864
39865[endsect]
39866
39867[section:boost__beast__allocate_stable allocate_stable]
39868[indexterm1 allocate_stable]
39869
39870
39871Allocate a temporary object to hold stable asynchronous operation state.
39872[heading Synopsis]
39873Defined in header [include_file boost/beast/core/async_base.hpp]
39874
39875```
39876template<
39877    class State,
39878    class __Handler__,
39879    class __Executor1__,
39880    class __Allocator__,
39881    class... Args>
39882State&
39883allocate_stable(
39884    stable_async_base< Handler, Executor1, Allocator >& base,
39885    Args&&... args);
39886```
39887
39888[heading Description]
39889The object will be destroyed just before the completion handler is invoked, or when the base is destroyed.
39890
39891[heading Template Parameters]
39892[table [[Type][Description]]
39893  [
39894    [`State`
39895    ]
39896    [
39897The type of object to allocate.
39898    ]
39899  ]
39900]
39901[heading Parameters]
39902[table [[Name][Description]]
39903  [
39904    [`base`
39905    ]
39906    [
39907The helper to allocate from.
39908    ]
39909  ]
39910  [
39911    [`args`
39912    ]
39913    [
39914An optional list of parameters to forward to the constructor of the object being allocated.
39915    ]
39916  ]
39917]
39918[heading See Also]
39919[link beast.ref.boost__beast__stable_async_base `stable_async_base`]
39920
39921
39922[endsect]
39923
39924[section:boost__beast__bind_handler bind_handler]
39925[indexterm1 bind_handler]
39926
39927
39928Bind parameters to a completion handler, creating a new handler.
39929[heading Synopsis]
39930Defined in header [include_file boost/beast/core/bind_handler.hpp]
39931
39932```
39933template<
39934    class __Handler__,
39935    class... Args>
39936``['implementation-defined]``
39937bind_handler(
39938    Handler&& handler,
39939    Args&&... args);
39940```
39941
39942[heading Description]
39943This function creates a new handler which, when invoked, calls the original handler with the list of bound arguments. Any parameters passed in the invocation will be substituted for placeholders present in the list of bound arguments. Parameters which are not matched to placeholders are silently discarded.
39944The passed handler and arguments are forwarded into the returned handler, whose associated allocator and associated executor will will be the same as those of the original handler.
39945
39946[heading Example]
39947
39948This function posts the invocation of the specified completion handler with bound arguments:
39949
39950```
39951template <class AsyncReadStream, class ReadHandler>
39952void
39953signal_aborted (AsyncReadStream& stream, ReadHandler&& handler)
39954{
39955    net::post(
39956        stream.get_executor(),
39957        bind_handler (std::forward <ReadHandler> (handler),
39958            net::error::operation_aborted, 0));
39959}
39960```
39961
39962
39963[heading Parameters]
39964[table [[Name][Description]]
39965  [
39966    [`handler`
39967    ]
39968    [
39969The handler to wrap. The implementation takes ownership of the handler by performing a decay-copy.
39970    ]
39971  ]
39972  [
39973    [`args`
39974    ]
39975    [
39976A list of arguments to bind to the handler. The arguments are forwarded into the returned object. These arguments may include placeholders, which will operate in a fashion identical to a call to `std::bind`.
39977    ]
39978  ]
39979]
39980
39981
39982[endsect]
39983
39984[section:boost__beast__bind_front_handler bind_front_handler]
39985[indexterm1 bind_front_handler]
39986
39987
39988Bind parameters to a completion handler, creating a new handler.
39989[heading Synopsis]
39990Defined in header [include_file boost/beast/core/bind_handler.hpp]
39991
39992```
39993template<
39994    class __Handler__,
39995    class... Args>
39996``['implementation-defined]``
39997bind_front_handler(
39998    Handler&& handler,
39999    Args&&... args);
40000```
40001
40002[heading Description]
40003This function creates a new handler which, when invoked, calls the original handler with the list of bound arguments. Any parameters passed in the invocation will be forwarded in the parameter list after the bound arguments.
40004The passed handler and arguments are forwarded into the returned handler, whose associated allocator and associated executor will will be the same as those of the original handler.
40005
40006[heading Example]
40007
40008This function posts the invocation of the specified completion handler with bound arguments:
40009
40010```
40011template <class AsyncReadStream, class ReadHandler>
40012void
40013signal_eof (AsyncReadStream& stream, ReadHandler&& handler)
40014{
40015    net::post(
40016        stream.get_executor(),
40017        bind_front_handler (std::forward<ReadHandler> (handler),
40018            net::error::eof, 0));
40019}
40020```
40021
40022
40023[heading Parameters]
40024[table [[Name][Description]]
40025  [
40026    [`handler`
40027    ]
40028    [
40029The handler to wrap. The implementation takes ownership of the handler by performing a decay-copy.
40030    ]
40031  ]
40032  [
40033    [`args`
40034    ]
40035    [
40036A list of arguments to bind to the handler. The arguments are forwarded into the returned object.
40037    ]
40038  ]
40039]
40040
40041
40042[endsect]
40043
40044[section:boost__beast__buffer_bytes buffer_bytes]
40045[indexterm1 buffer_bytes]
40046
40047
40048Return the total number of bytes in a buffer or buffer sequence.
40049[heading Synopsis]
40050Defined in header [include_file boost/beast/core/buffer_traits.hpp]
40051
40052```
40053template<
40054    class __BufferSequence__>
40055std::size_t
40056buffer_bytes(
40057    BufferSequence const& buffers);
40058```
40059
40060[heading Description]
40061This function returns the total number of bytes in a buffer, buffer sequence, or object convertible to a buffer. Specifically it may be passed:
40062
40063* A ['ConstBufferSequence] or ['MutableBufferSequence]
40064
40065* A `net::const_buffer` or `net::mutable_buffer`
40066
40067* An object convertible to `net::const_buffer`
40068
40069This function is designed as an easier-to-use replacement for `net::buffer_size`. It recognizes customization points found through argument-dependent lookup. The call `beast::buffer_bytes(b)` is equivalent to performing:
40070```
40071using net::buffer_size;
40072return buffer_size(b);
40073```
40074
40075In addition this handles types which are convertible to `net::const_buffer`; these are not handled by `net::buffer_size`.
40076
40077[heading Parameters]
40078[table [[Name][Description]]
40079  [
40080    [`buffers`
40081    ]
40082    [
40083The buffer or buffer sequence to calculate the size of.
40084    ]
40085  ]
40086]
40087[heading Return Value]
40088The total number of bytes in the buffer or sequence.
40089
40090
40091[endsect]
40092
40093[section:boost__beast__buffers_cat buffers_cat]
40094[indexterm1 buffers_cat]
40095
40096
40097Concatenate 1 or more buffer sequences.
40098[heading Synopsis]
40099Defined in header [include_file boost/beast/core/buffers_cat.hpp]
40100
40101```
40102template<
40103    class... __BufferSequence__>
40104buffers_cat_view< BufferSequence... >
40105buffers_cat(
40106    BufferSequence const&... buffers);
40107```
40108
40109[heading Description]
40110
40111This function returns a constant or mutable buffer sequence which, when iterated, efficiently concatenates the input buffer sequences. Copies of the arguments passed will be made; however, the returned object does not take ownership of the underlying memory. The application is still responsible for managing the lifetime of the referenced memory.
40112[heading Parameters]
40113[table [[Name][Description]]
40114  [
40115    [`buffers`
40116    ]
40117    [
40118The list of buffer sequences to concatenate.
40119    ]
40120  ]
40121]
40122[heading Return Value]
40123A new buffer sequence that represents the concatenation of the input buffer sequences. This buffer sequence will be a ['MutableBufferSequence] if each of the passed buffer sequences is also a ['MutableBufferSequence]; otherwise the returned buffer sequence will be a ['ConstBufferSequence].
40124[heading See Also]
40125[link beast.ref.boost__beast__buffers_cat_view `buffers_cat_view`]
40126
40127
40128[endsect]
40129
40130[section:boost__beast__buffers_prefix buffers_prefix]
40131[indexterm1 buffers_prefix]
40132
40133
40134Returns a prefix of a constant or mutable buffer sequence.
40135[heading Synopsis]
40136Defined in header [include_file boost/beast/core/buffers_prefix.hpp]
40137
40138```
40139template<
40140    class __BufferSequence__>
40141buffers_prefix_view< BufferSequence >
40142buffers_prefix(
40143    std::size_t size,
40144    BufferSequence const& buffers);
40145```
40146
40147[heading Description]
40148The returned buffer sequence points to the same memory as the passed buffer sequence, but with a size that is equal to or smaller. No memory allocations are performed; the resulting sequence is calculated as a lazy range.
40149
40150[heading Parameters]
40151[table [[Name][Description]]
40152  [
40153    [`size`
40154    ]
40155    [
40156The maximum size of the returned buffer sequence in bytes. If this is greater than or equal to the size of the passed buffer sequence, the result will have the same size as the original buffer sequence.
40157    ]
40158  ]
40159  [
40160    [`buffers`
40161    ]
40162    [
40163An object whose type meets the requirements of ['BufferSequence]. The returned value will maintain a copy of the passed buffers for its lifetime; however, ownership of the underlying memory is not transferred.
40164    ]
40165  ]
40166]
40167[heading Return Value]
40168A constant buffer sequence that represents the prefix of the original buffer sequence. If the original buffer sequence also meets the requirements of ['MutableBufferSequence], then the returned value will also be a mutable buffer sequence.
40169
40170
40171[endsect]
40172
40173[section:boost__beast__buffers_front buffers_front]
40174[indexterm1 buffers_front]
40175
40176
40177Returns the first buffer in a buffer sequence.
40178[heading Synopsis]
40179Defined in header [include_file boost/beast/core/buffers_prefix.hpp]
40180
40181```
40182template<
40183    class __BufferSequence__>
40184buffers_type< BufferSequence >
40185buffers_front(
40186    BufferSequence const& buffers);
40187```
40188
40189[heading Description]
40190This returns the first buffer in the buffer sequence. If the buffer sequence is an empty range, the returned buffer will have a zero buffer size.
40191
40192[heading Parameters]
40193[table [[Name][Description]]
40194  [
40195    [`buffers`
40196    ]
40197    [
40198The buffer sequence. If the sequence is mutable, the returned buffer sequence will also be mutable. Otherwise, the returned buffer sequence will be constant.
40199    ]
40200  ]
40201]
40202
40203
40204[endsect]
40205
40206[section:boost__beast__buffers_range buffers_range]
40207[indexterm1 buffers_range]
40208
40209
40210Returns an iterable range representing a buffer sequence.
40211[heading Synopsis]
40212Defined in header [include_file boost/beast/core/buffers_range.hpp]
40213
40214```
40215template<
40216    class __BufferSequence__>
40217``['implementation-defined]``
40218buffers_range(
40219    BufferSequence const& buffers);
40220```
40221
40222[heading Description]
40223This function returns an iterable range representing the passed buffer sequence. The values obtained when iterating the range will be `net::const_buffer`, unless the underlying buffer sequence is a ['MutableBufferSequence], in which case the value obtained when iterating will be a `net::mutable_buffer`.
40224
40225[heading Example]
40226
40227The following function returns the total number of bytes in the specified buffer sequence. A copy of the buffer sequence is maintained for the lifetime of the range object:
40228
40229```
40230template <class BufferSequence>
40231std::size_t buffer_sequence_size (BufferSequence const& buffers)
40232{
40233    std::size_t size = 0;
40234    for (auto const buffer : buffers_range (buffers))
40235        size += buffer.size();
40236    return size;
40237}
40238```
40239
40240
40241[heading Parameters]
40242[table [[Name][Description]]
40243  [
40244    [`buffers`
40245    ]
40246    [
40247The buffer sequence to adapt into a range. The range object returned from this function will contain a copy of the passed buffer sequence.
40248    ]
40249  ]
40250]
40251[heading Return Value]
40252An object of unspecified type which meets the requirements of ['ConstBufferSequence]. If `buffers` is a mutable buffer sequence, the returned object will also meet the requirements of ['MutableBufferSequence].
40253[heading See Also]
40254[link beast.ref.boost__beast__buffers_range_ref `buffers_range_ref`]
40255
40256
40257[endsect]
40258
40259[section:boost__beast__buffers_range_ref buffers_range_ref]
40260[indexterm1 buffers_range_ref]
40261
40262
40263Returns an iterable range representing a buffer sequence.
40264[heading Synopsis]
40265Defined in header [include_file boost/beast/core/buffers_range.hpp]
40266
40267```
40268template<
40269    class __BufferSequence__>
40270``['implementation-defined]``
40271buffers_range_ref(
40272    BufferSequence const& buffers);
40273```
40274
40275[heading Description]
40276This function returns an iterable range representing the passed buffer sequence. The values obtained when iterating the range will be `net::const_buffer`, unless the underlying buffer sequence is a ['MutableBufferSequence], in which case the value obtained when iterating will be a `net::mutable_buffer`.
40277
40278[heading Example]
40279
40280The following function returns the total number of bytes in the specified buffer sequence. A reference to the original buffers is maintained for the lifetime of the range object:
40281
40282```
40283template <class BufferSequence>
40284std::size_t buffer_sequence_size_ref (BufferSequence const& buffers)
40285{
40286    std::size_t size = 0;
40287    for (auto const buffer : buffers_range_ref (buffers))
40288        size += buffer.size();
40289    return size;
40290}
40291```
40292
40293
40294[heading Parameters]
40295[table [[Name][Description]]
40296  [
40297    [`buffers`
40298    ]
40299    [
40300The buffer sequence to adapt into a range. The range returned from this function will maintain a reference to these buffers. The application is responsible for ensuring that the lifetime of the referenced buffers extends until the range object is destroyed.
40301    ]
40302  ]
40303]
40304[heading Return Value]
40305An object of unspecified type which meets the requirements of ['ConstBufferSequence]. If `buffers` is a mutable buffer sequence, the returned object will also meet the requirements of ['MutableBufferSequence].
40306[heading See Also]
40307[link beast.ref.boost__beast__buffers_range `buffers_range`]
40308
40309
40310[endsect]
40311
40312[section:boost__beast__buffers_to_string buffers_to_string]
40313[indexterm1 buffers_to_string]
40314
40315
40316Return a string representing the contents of a buffer sequence.
40317[heading Synopsis]
40318Defined in header [include_file boost/beast/core/buffers_to_string.hpp]
40319
40320```
40321template<
40322    class __ConstBufferSequence__>
40323std::string
40324buffers_to_string(
40325    ConstBufferSequence const& buffers);
40326```
40327
40328[heading Description]
40329This function returns a string representing an entire buffer sequence. Nulls and unprintable characters in the buffer sequence are inserted to the resulting string as-is. No character conversions are performed.
40330
40331[heading Parameters]
40332[table [[Name][Description]]
40333  [
40334    [`buffers`
40335    ]
40336    [
40337The buffer sequence to convert
40338    ]
40339  ]
40340]
40341[heading Example]
40342
40343This function writes a buffer sequence converted to a string to `std::cout`.
40344
40345```
40346template<class ConstBufferSequence>
40347void print(ConstBufferSequence const& buffers)
40348{
40349    std::cout << buffers_to_string(buffers) << std::endl;
40350}
40351```
40352
40353
40354
40355[endsect]
40356
40357[section:boost__beast__detect_ssl detect_ssl]
40358[indexterm1 detect_ssl]
40359
40360
40361Detect a TLS client handshake on a stream.
40362[heading Synopsis]
40363Defined in header [include_file boost/beast/core/detect_ssl.hpp]
40364
40365```
40366template<
40367    class __SyncReadStream__,
40368    class __DynamicBuffer__>
40369bool
40370detect_ssl(
40371    SyncReadStream& stream,
40372    DynamicBuffer& buffer,
40373    error_code& ec);
40374```
40375
40376[heading Description]
40377This function reads from a stream to determine if a client handshake message is being received.
40378The call blocks until one of the following is true:
40379
40380* A TLS client opening handshake is detected,
40381
40382* The received data is invalid for a TLS client handshake, or
40383
40384* An error occurs.
40385
40386The algorithm, known as a ['composed operation], is implemented in terms of calls to the next layer's `read_some` function.
40387Bytes read from the stream will be stored in the passed dynamic buffer, which may be used to perform the TLS handshake if the detector returns true, or be otherwise consumed by the caller based on the expected protocol.
40388
40389[heading Parameters]
40390[table [[Name][Description]]
40391  [
40392    [`stream`
40393    ]
40394    [
40395The stream to read from. This type must meet the requirements of ['SyncReadStream].
40396    ]
40397  ]
40398  [
40399    [`buffer`
40400    ]
40401    [
40402The dynamic buffer to use. This type must meet the requirements of ['DynamicBuffer].
40403    ]
40404  ]
40405  [
40406    [`ec`
40407    ]
40408    [
40409Set to the error if any occurred.
40410    ]
40411  ]
40412]
40413[heading Return Value]
40414`true` if the buffer contains a TLS client handshake and no error occurred, otherwise `false`.
40415
40416
40417[endsect]
40418
40419[section:boost__beast__async_detect_ssl async_detect_ssl]
40420[indexterm1 async_detect_ssl]
40421
40422
40423Detect a TLS/SSL handshake asynchronously on a stream.
40424[heading Synopsis]
40425Defined in header [include_file boost/beast/core/detect_ssl.hpp]
40426
40427```
40428template<
40429    class __AsyncReadStream__,
40430    class __DynamicBuffer__,
40431    class __CompletionToken__ = net::default_completion_token_t<beast::executor_type<AsyncReadStream>>>
40432``__deduced__``
40433async_detect_ssl(
40434    AsyncReadStream& stream,
40435    DynamicBuffer& buffer,
40436    CompletionToken&& token = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type beast::executor_type]``< AsyncReadStream >>{});
40437```
40438
40439[heading Description]
40440This function reads asynchronously from a stream to determine if a client handshake message is being received.
40441This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
40442
40443* A TLS client opening handshake is detected,
40444
40445* The received data is invalid for a TLS client handshake, or
40446
40447* An error occurs.
40448
40449The algorithm, known as a ['composed asynchronous operation], is implemented in terms of calls to the next layer's `async_read_some` function. The program must ensure that no other calls to `async_read_some` are performed until this operation completes.
40450Bytes read from the stream will be stored in the passed dynamic buffer, which may be used to perform the TLS handshake if the detector returns true, or be otherwise consumed by the caller based on the expected protocol.
40451
40452[heading Parameters]
40453[table [[Name][Description]]
40454  [
40455    [`stream`
40456    ]
40457    [
40458The stream to read from. This type must meet the requirements of ['AsyncReadStream].
40459    ]
40460  ]
40461  [
40462    [`buffer`
40463    ]
40464    [
40465The dynamic buffer to use. This type must meet the requirements of ['DynamicBuffer].
40466    ]
40467  ]
40468  [
40469    [`token`
40470    ]
40471    [
40472
40473The completion token used to determine the method used to provide the result of the asynchronous operation. If this is a completion handler, the implementation takes ownership of the handler by performing a decay-copy, and the equivalent function signature of the handler must be:
40474```
40475void handler(
40476    error_code const& error,    // Set to the error, if any
40477    bool result                 // The result of the detector
40478);
40479```
40480
40481Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
40482    ]
40483  ]
40484]
40485
40486
40487[endsect]
40488
40489[section:boost__beast__generic_category generic_category]
40490[indexterm1 generic_category]
40491
40492
40493A function to return the generic error category used by the library.
40494[heading Synopsis]
40495Defined in header [include_file boost/beast/core/error.hpp]
40496
40497```
40498error_category const&
40499generic_category();
40500```
40501
40502[heading Description]
40503
40504
40505[endsect]
40506
40507[section:boost__beast__system_category system_category]
40508[indexterm1 system_category]
40509
40510
40511A function to return the system error category used by the library.
40512[heading Synopsis]
40513Defined in header [include_file boost/beast/core/error.hpp]
40514
40515```
40516error_category const&
40517system_category();
40518```
40519
40520[heading Description]
40521
40522
40523[endsect]
40524
40525[section:boost__beast__make_printable make_printable]
40526[indexterm1 make_printable]
40527
40528
40529Helper to permit a buffer sequence to be printed to a std::ostream.
40530[heading Synopsis]
40531Defined in header [include_file boost/beast/core/make_printable.hpp]
40532
40533```
40534template<
40535    class __ConstBufferSequence__>
40536``['implementation-defined]``
40537make_printable(
40538    ConstBufferSequence const& buffers);
40539```
40540
40541[heading Description]
40542This function is used to wrap a buffer sequence to allow it to be interpreted as characters and written to a `std::ostream` such as `std::cout`. No character translation is performed; unprintable and null characters will be transferred as-is to the output stream.
40543
40544[heading Example]
40545
40546This function prints the size and contents of a buffer sequence to standard output:
40547```
40548template <class ConstBufferSequence>
40549void
40550print (ConstBufferSequence const& buffers)
40551{
40552    std::cout <<
40553        "Buffer size: " << buffer_bytes(buffers) << " bytes\n"
40554        "Buffer data: '" << make_printable(buffers) << "'\n";
40555}
40556```
40557
40558[heading Parameters]
40559[table [[Name][Description]]
40560  [
40561    [`buffers`
40562    ]
40563    [
40564An object meeting the requirements of ['ConstBufferSequence] to be streamed. The implementation will make a copy of this object. Ownership of the underlying memory is not transferred, the application is still responsible for managing its lifetime.
40565    ]
40566  ]
40567]
40568
40569
40570[endsect]
40571
40572[section:boost__beast__ostream ostream]
40573[indexterm1 ostream]
40574
40575
40576Return an output stream that formats values into a ['DynamicBuffer].
40577[heading Synopsis]
40578Defined in header [include_file boost/beast/core/ostream.hpp]
40579
40580```
40581template<
40582    class __DynamicBuffer__>
40583``['implementation-defined]``
40584ostream(
40585    DynamicBuffer& buffer);
40586```
40587
40588[heading Description]
40589This function wraps the caller provided ['DynamicBuffer] into a `std::ostream` derived class, to allow `operator<<` stream style formatting operations.
40590
40591[heading Example]
40592
40593```
40594ostream(buffer) << "Hello, world!" << std::endl;
40595```
40596
40597[heading Remarks]
40598Calling members of the underlying buffer before the output stream is destroyed results in undefined behavior.
40599[heading Parameters]
40600[table [[Name][Description]]
40601  [
40602    [`buffer`
40603    ]
40604    [
40605An object meeting the requirements of ['DynamicBuffer] into which the formatted output will be placed.
40606    ]
40607  ]
40608]
40609[heading Return Value]
40610An object derived from `std::ostream` which redirects output The wrapped dynamic buffer is not modified, a copy is made instead. Ownership of the underlying memory is not transferred, the application is still responsible for managing its lifetime. The caller is responsible for ensuring the dynamic buffer is not destroyed for the lifetime of the output stream.
40611
40612
40613[endsect]
40614
40615[section:boost__beast__buffers buffers]
40616[indexterm1 buffers]
40617
40618
40619[heading Synopsis]
40620Defined in header [include_file boost/beast/core/ostream.hpp]
40621
40622```
40623template<
40624    class T>
40625void
40626buffers(
40627    T const&);
40628```
40629
40630[heading Description]
40631
40632
40633[endsect]
40634
40635[section:boost__beast__read_size read_size]
40636[indexterm1 read_size]
40637
40638
40639Returns a natural read size.
40640[heading Synopsis]
40641Defined in header [include_file boost/beast/core/read_size.hpp]
40642
40643```
40644template<
40645    class __DynamicBuffer__>
40646std::size_t
40647read_size(
40648    DynamicBuffer& buffer,
40649    std::size_t max_size);
40650```
40651
40652[heading Description]
40653This function inspects the capacity, size, and maximum size of the dynamic buffer. Then it computes a natural read size given the passed-in upper limit. It favors a read size that does not require a reallocation, subject to a reasonable minimum to avoid tiny reads.
40654
40655[heading Parameters]
40656[table [[Name][Description]]
40657  [
40658    [`buffer`
40659    ]
40660    [
40661The dynamic buffer to inspect.
40662    ]
40663  ]
40664  [
40665    [`max_size`
40666    ]
40667    [
40668An upper limit on the returned value.
40669    ]
40670  ]
40671]
40672[heading Remarks]
40673If the buffer is already at its maximum size, zero is returned.
40674
40675
40676[endsect]
40677
40678[section:boost__beast__read_size_or_throw read_size_or_throw]
40679[indexterm1 read_size_or_throw]
40680
40681
40682Returns a natural read size or throw if the buffer is full.
40683[heading Synopsis]
40684Defined in header [include_file boost/beast/core/read_size.hpp]
40685
40686```
40687template<
40688    class __DynamicBuffer__>
40689std::size_t
40690read_size_or_throw(
40691    DynamicBuffer& buffer,
40692    std::size_t max_size);
40693```
40694
40695[heading Description]
40696This function inspects the capacity, size, and maximum size of the dynamic buffer. Then it computes a natural read size given the passed-in upper limit. It favors a read size that does not require a reallocation, subject to a reasonable minimum to avoid tiny reads.
40697
40698[heading Parameters]
40699[table [[Name][Description]]
40700  [
40701    [`buffer`
40702    ]
40703    [
40704The dynamic buffer to inspect.
40705    ]
40706  ]
40707  [
40708    [`max_size`
40709    ]
40710    [
40711An upper limit on the returned value.
40712    ]
40713  ]
40714]
40715[heading Exceptions]
40716[table [[Type][Thrown On]]
40717  [
40718    [`std::length_error`
40719    ]
40720    [
40721if `max_size > 0` and the buffer is full.
40722    ]
40723  ]
40724]
40725
40726
40727[endsect]
40728
40729[section:boost__beast__operator_plus_ operator+]
40730[indexterm1 operator+]
40731
40732
40733```
40734template<
40735    std::size_t N,
40736    std::size_t M,
40737    class CharT,
40738    class Traits>
40739void
40740``[link beast.ref.boost__beast__operator_plus_.overload1 operator+]``(
40741    static_string< N, CharT, Traits >const&,
40742    static_string< M, CharT, Traits >const&);
40743  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_plus_.overload1 `more...`]]``
40744
40745template<
40746    std::size_t N,
40747    class CharT,
40748    class Traits>
40749void
40750``[link beast.ref.boost__beast__operator_plus_.overload2 operator+]``(
40751    CharT const*,
40752    static_string< N, CharT, Traits >const&);
40753  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_plus_.overload2 `more...`]]``
40754
40755template<
40756    std::size_t N,
40757    class CharT,
40758    class Traits>
40759void
40760``[link beast.ref.boost__beast__operator_plus_.overload3 operator+]``(
40761    CharT,
40762    static_string< N, CharT, Traits > const&);
40763  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_plus_.overload3 `more...`]]``
40764
40765template<
40766    std::size_t N,
40767    class CharT,
40768    class Traits>
40769void
40770``[link beast.ref.boost__beast__operator_plus_.overload4 operator+]``(
40771    static_string< N, CharT, Traits > const&,
40772    CharT const*);
40773  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_plus_.overload4 `more...`]]``
40774
40775template<
40776    std::size_t N,
40777    class CharT,
40778    class Traits>
40779void
40780``[link beast.ref.boost__beast__operator_plus_.overload5 operator+]``(
40781    static_string< N, CharT, Traits > const&,
40782    CharT);
40783  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_plus_.overload5 `more...`]]``
40784```
40785
40786[section:overload1 operator+ (1 of 5 overloads)]
40787
40788[heading Synopsis]
40789Defined in header [include_file boost/beast/core/static_string.hpp]
40790
40791```
40792template<
40793    std::size_t N,
40794    std::size_t M,
40795    class CharT,
40796    class Traits>
40797void
40798operator+(
40799    static_string< N, CharT, Traits >const&,
40800    static_string< M, CharT, Traits >const&);
40801```
40802
40803[heading Description]
40804
40805
40806[endsect]
40807
40808[section:overload2 operator+ (2 of 5 overloads)]
40809
40810[heading Synopsis]
40811Defined in header [include_file boost/beast/core/static_string.hpp]
40812
40813```
40814template<
40815    std::size_t N,
40816    class CharT,
40817    class Traits>
40818void
40819operator+(
40820    CharT const*,
40821    static_string< N, CharT, Traits >const&);
40822```
40823
40824[heading Description]
40825
40826
40827[endsect]
40828
40829[section:overload3 operator+ (3 of 5 overloads)]
40830
40831[heading Synopsis]
40832Defined in header [include_file boost/beast/core/static_string.hpp]
40833
40834```
40835template<
40836    std::size_t N,
40837    class CharT,
40838    class Traits>
40839void
40840operator+(
40841    CharT,
40842    static_string< N, CharT, Traits > const&);
40843```
40844
40845[heading Description]
40846
40847
40848[endsect]
40849
40850[section:overload4 operator+ (4 of 5 overloads)]
40851
40852[heading Synopsis]
40853Defined in header [include_file boost/beast/core/static_string.hpp]
40854
40855```
40856template<
40857    std::size_t N,
40858    class CharT,
40859    class Traits>
40860void
40861operator+(
40862    static_string< N, CharT, Traits > const&,
40863    CharT const*);
40864```
40865
40866[heading Description]
40867
40868
40869[endsect]
40870
40871[section:overload5 operator+ (5 of 5 overloads)]
40872
40873[heading Synopsis]
40874Defined in header [include_file boost/beast/core/static_string.hpp]
40875
40876```
40877template<
40878    std::size_t N,
40879    class CharT,
40880    class Traits>
40881void
40882operator+(
40883    static_string< N, CharT, Traits > const&,
40884    CharT);
40885```
40886
40887[heading Description]
40888
40889
40890[endsect]
40891
40892
40893[endsect]
40894
40895[section:boost__beast__operator_eq__eq_ operator==]
40896[indexterm1 operator==]
40897
40898
40899```
40900template<
40901    std::size_t N,
40902    std::size_t M,
40903    class CharT,
40904    class Traits>
40905bool
40906``[link beast.ref.boost__beast__operator_eq__eq_.overload1 operator==]``(
40907    static_string< N, CharT, Traits > const& lhs,
40908    static_string< M, CharT, Traits > const& rhs);
40909  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_eq__eq_.overload1 `more...`]]``
40910
40911template<
40912    std::size_t N,
40913    class CharT,
40914    class Traits>
40915bool
40916``[link beast.ref.boost__beast__operator_eq__eq_.overload2 operator==]``(
40917    CharT const* lhs,
40918    static_string< N, CharT, Traits > const& rhs);
40919  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_eq__eq_.overload2 `more...`]]``
40920
40921template<
40922    std::size_t N,
40923    class CharT,
40924    class Traits>
40925bool
40926``[link beast.ref.boost__beast__operator_eq__eq_.overload3 operator==]``(
40927    static_string< N, CharT, Traits > const& lhs,
40928    CharT const* rhs);
40929  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_eq__eq_.overload3 `more...`]]``
40930```
40931
40932[section:overload1 operator== (1 of 3 overloads)]
40933
40934[heading Synopsis]
40935Defined in header [include_file boost/beast/core/static_string.hpp]
40936
40937```
40938template<
40939    std::size_t N,
40940    std::size_t M,
40941    class CharT,
40942    class Traits>
40943bool
40944operator==(
40945    static_string< N, CharT, Traits > const& lhs,
40946    static_string< M, CharT, Traits > const& rhs);
40947```
40948
40949[heading Description]
40950
40951
40952[endsect]
40953
40954[section:overload2 operator== (2 of 3 overloads)]
40955
40956[heading Synopsis]
40957Defined in header [include_file boost/beast/core/static_string.hpp]
40958
40959```
40960template<
40961    std::size_t N,
40962    class CharT,
40963    class Traits>
40964bool
40965operator==(
40966    CharT const* lhs,
40967    static_string< N, CharT, Traits > const& rhs);
40968```
40969
40970[heading Description]
40971
40972
40973[endsect]
40974
40975[section:overload3 operator== (3 of 3 overloads)]
40976
40977[heading Synopsis]
40978Defined in header [include_file boost/beast/core/static_string.hpp]
40979
40980```
40981template<
40982    std::size_t N,
40983    class CharT,
40984    class Traits>
40985bool
40986operator==(
40987    static_string< N, CharT, Traits > const& lhs,
40988    CharT const* rhs);
40989```
40990
40991[heading Description]
40992
40993
40994[endsect]
40995
40996
40997[endsect]
40998
40999[section:boost__beast__operator_not__eq_ operator!=]
41000[indexterm1 operator!=]
41001
41002
41003```
41004template<
41005    std::size_t N,
41006    std::size_t M,
41007    class CharT,
41008    class Traits>
41009bool
41010``[link beast.ref.boost__beast__operator_not__eq_.overload1 operator!=]``(
41011    static_string< N, CharT, Traits > const& lhs,
41012    static_string< M, CharT, Traits > const& rhs);
41013  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_not__eq_.overload1 `more...`]]``
41014
41015template<
41016    std::size_t N,
41017    class CharT,
41018    class Traits>
41019bool
41020``[link beast.ref.boost__beast__operator_not__eq_.overload2 operator!=]``(
41021    CharT const* lhs,
41022    static_string< N, CharT, Traits > const& rhs);
41023  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_not__eq_.overload2 `more...`]]``
41024
41025template<
41026    std::size_t N,
41027    class CharT,
41028    class Traits>
41029bool
41030``[link beast.ref.boost__beast__operator_not__eq_.overload3 operator!=]``(
41031    static_string< N, CharT, Traits > const& lhs,
41032    CharT const* rhs);
41033  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_not__eq_.overload3 `more...`]]``
41034```
41035
41036[section:overload1 operator!= (1 of 3 overloads)]
41037
41038[heading Synopsis]
41039Defined in header [include_file boost/beast/core/static_string.hpp]
41040
41041```
41042template<
41043    std::size_t N,
41044    std::size_t M,
41045    class CharT,
41046    class Traits>
41047bool
41048operator!=(
41049    static_string< N, CharT, Traits > const& lhs,
41050    static_string< M, CharT, Traits > const& rhs);
41051```
41052
41053[heading Description]
41054
41055
41056[endsect]
41057
41058[section:overload2 operator!= (2 of 3 overloads)]
41059
41060[heading Synopsis]
41061Defined in header [include_file boost/beast/core/static_string.hpp]
41062
41063```
41064template<
41065    std::size_t N,
41066    class CharT,
41067    class Traits>
41068bool
41069operator!=(
41070    CharT const* lhs,
41071    static_string< N, CharT, Traits > const& rhs);
41072```
41073
41074[heading Description]
41075
41076
41077[endsect]
41078
41079[section:overload3 operator!= (3 of 3 overloads)]
41080
41081[heading Synopsis]
41082Defined in header [include_file boost/beast/core/static_string.hpp]
41083
41084```
41085template<
41086    std::size_t N,
41087    class CharT,
41088    class Traits>
41089bool
41090operator!=(
41091    static_string< N, CharT, Traits > const& lhs,
41092    CharT const* rhs);
41093```
41094
41095[heading Description]
41096
41097
41098[endsect]
41099
41100
41101[endsect]
41102
41103[section:boost__beast__operator_lt_ operator<]
41104[indexterm1 operator<]
41105
41106
41107```
41108template<
41109    std::size_t N,
41110    std::size_t M,
41111    class CharT,
41112    class Traits>
41113bool
41114``[link beast.ref.boost__beast__operator_lt_.overload1 operator<]``(
41115    static_string< N, CharT, Traits > const& lhs,
41116    static_string< M, CharT, Traits > const& rhs);
41117  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_lt_.overload1 `more...`]]``
41118
41119template<
41120    std::size_t N,
41121    class CharT,
41122    class Traits>
41123bool
41124``[link beast.ref.boost__beast__operator_lt_.overload2 operator<]``(
41125    CharT const* lhs,
41126    static_string< N, CharT, Traits > const& rhs);
41127  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_lt_.overload2 `more...`]]``
41128
41129template<
41130    std::size_t N,
41131    class CharT,
41132    class Traits>
41133bool
41134``[link beast.ref.boost__beast__operator_lt_.overload3 operator<]``(
41135    static_string< N, CharT, Traits > const& lhs,
41136    CharT const* rhs);
41137  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_lt_.overload3 `more...`]]``
41138```
41139
41140[section:overload1 operator< (1 of 3 overloads)]
41141
41142[heading Synopsis]
41143Defined in header [include_file boost/beast/core/static_string.hpp]
41144
41145```
41146template<
41147    std::size_t N,
41148    std::size_t M,
41149    class CharT,
41150    class Traits>
41151bool
41152operator<(
41153    static_string< N, CharT, Traits > const& lhs,
41154    static_string< M, CharT, Traits > const& rhs);
41155```
41156
41157[heading Description]
41158
41159
41160[endsect]
41161
41162[section:overload2 operator< (2 of 3 overloads)]
41163
41164[heading Synopsis]
41165Defined in header [include_file boost/beast/core/static_string.hpp]
41166
41167```
41168template<
41169    std::size_t N,
41170    class CharT,
41171    class Traits>
41172bool
41173operator<(
41174    CharT const* lhs,
41175    static_string< N, CharT, Traits > const& rhs);
41176```
41177
41178[heading Description]
41179
41180
41181[endsect]
41182
41183[section:overload3 operator< (3 of 3 overloads)]
41184
41185[heading Synopsis]
41186Defined in header [include_file boost/beast/core/static_string.hpp]
41187
41188```
41189template<
41190    std::size_t N,
41191    class CharT,
41192    class Traits>
41193bool
41194operator<(
41195    static_string< N, CharT, Traits > const& lhs,
41196    CharT const* rhs);
41197```
41198
41199[heading Description]
41200
41201
41202[endsect]
41203
41204
41205[endsect]
41206
41207[section:boost__beast__operator_lt__eq_ operator<=]
41208[indexterm1 operator<=]
41209
41210
41211```
41212template<
41213    std::size_t N,
41214    std::size_t M,
41215    class CharT,
41216    class Traits>
41217bool
41218``[link beast.ref.boost__beast__operator_lt__eq_.overload1 operator<=]``(
41219    static_string< N, CharT, Traits > const& lhs,
41220    static_string< M, CharT, Traits > const& rhs);
41221  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_lt__eq_.overload1 `more...`]]``
41222
41223template<
41224    std::size_t N,
41225    class CharT,
41226    class Traits>
41227bool
41228``[link beast.ref.boost__beast__operator_lt__eq_.overload2 operator<=]``(
41229    CharT const* lhs,
41230    static_string< N, CharT, Traits > const& rhs);
41231  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_lt__eq_.overload2 `more...`]]``
41232
41233template<
41234    std::size_t N,
41235    class CharT,
41236    class Traits>
41237bool
41238``[link beast.ref.boost__beast__operator_lt__eq_.overload3 operator<=]``(
41239    static_string< N, CharT, Traits > const& lhs,
41240    CharT const* rhs);
41241  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_lt__eq_.overload3 `more...`]]``
41242```
41243
41244[section:overload1 operator<= (1 of 3 overloads)]
41245
41246[heading Synopsis]
41247Defined in header [include_file boost/beast/core/static_string.hpp]
41248
41249```
41250template<
41251    std::size_t N,
41252    std::size_t M,
41253    class CharT,
41254    class Traits>
41255bool
41256operator<=(
41257    static_string< N, CharT, Traits > const& lhs,
41258    static_string< M, CharT, Traits > const& rhs);
41259```
41260
41261[heading Description]
41262
41263
41264[endsect]
41265
41266[section:overload2 operator<= (2 of 3 overloads)]
41267
41268[heading Synopsis]
41269Defined in header [include_file boost/beast/core/static_string.hpp]
41270
41271```
41272template<
41273    std::size_t N,
41274    class CharT,
41275    class Traits>
41276bool
41277operator<=(
41278    CharT const* lhs,
41279    static_string< N, CharT, Traits > const& rhs);
41280```
41281
41282[heading Description]
41283
41284
41285[endsect]
41286
41287[section:overload3 operator<= (3 of 3 overloads)]
41288
41289[heading Synopsis]
41290Defined in header [include_file boost/beast/core/static_string.hpp]
41291
41292```
41293template<
41294    std::size_t N,
41295    class CharT,
41296    class Traits>
41297bool
41298operator<=(
41299    static_string< N, CharT, Traits > const& lhs,
41300    CharT const* rhs);
41301```
41302
41303[heading Description]
41304
41305
41306[endsect]
41307
41308
41309[endsect]
41310
41311[section:boost__beast__operator_gt_ operator>]
41312[indexterm1 operator>]
41313
41314
41315```
41316template<
41317    std::size_t N,
41318    std::size_t M,
41319    class CharT,
41320    class Traits>
41321bool
41322``[link beast.ref.boost__beast__operator_gt_.overload1 operator>]``(
41323    static_string< N, CharT, Traits > const& lhs,
41324    static_string< M, CharT, Traits > const& rhs);
41325  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_gt_.overload1 `more...`]]``
41326
41327template<
41328    std::size_t N,
41329    class CharT,
41330    class Traits>
41331bool
41332``[link beast.ref.boost__beast__operator_gt_.overload2 operator>]``(
41333    CharT const* lhs,
41334    static_string< N, CharT, Traits > const& rhs);
41335  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_gt_.overload2 `more...`]]``
41336
41337template<
41338    std::size_t N,
41339    class CharT,
41340    class Traits>
41341bool
41342``[link beast.ref.boost__beast__operator_gt_.overload3 operator>]``(
41343    static_string< N, CharT, Traits > const& lhs,
41344    CharT const* rhs);
41345  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_gt_.overload3 `more...`]]``
41346```
41347
41348[section:overload1 operator> (1 of 3 overloads)]
41349
41350[heading Synopsis]
41351Defined in header [include_file boost/beast/core/static_string.hpp]
41352
41353```
41354template<
41355    std::size_t N,
41356    std::size_t M,
41357    class CharT,
41358    class Traits>
41359bool
41360operator>(
41361    static_string< N, CharT, Traits > const& lhs,
41362    static_string< M, CharT, Traits > const& rhs);
41363```
41364
41365[heading Description]
41366
41367
41368[endsect]
41369
41370[section:overload2 operator> (2 of 3 overloads)]
41371
41372[heading Synopsis]
41373Defined in header [include_file boost/beast/core/static_string.hpp]
41374
41375```
41376template<
41377    std::size_t N,
41378    class CharT,
41379    class Traits>
41380bool
41381operator>(
41382    CharT const* lhs,
41383    static_string< N, CharT, Traits > const& rhs);
41384```
41385
41386[heading Description]
41387
41388
41389[endsect]
41390
41391[section:overload3 operator> (3 of 3 overloads)]
41392
41393[heading Synopsis]
41394Defined in header [include_file boost/beast/core/static_string.hpp]
41395
41396```
41397template<
41398    std::size_t N,
41399    class CharT,
41400    class Traits>
41401bool
41402operator>(
41403    static_string< N, CharT, Traits > const& lhs,
41404    CharT const* rhs);
41405```
41406
41407[heading Description]
41408
41409
41410[endsect]
41411
41412
41413[endsect]
41414
41415[section:boost__beast__operator_gt__eq_ operator>=]
41416[indexterm1 operator>=]
41417
41418
41419```
41420template<
41421    std::size_t N,
41422    std::size_t M,
41423    class CharT,
41424    class Traits>
41425bool
41426``[link beast.ref.boost__beast__operator_gt__eq_.overload1 operator>=]``(
41427    static_string< N, CharT, Traits > const& lhs,
41428    static_string< M, CharT, Traits > const& rhs);
41429  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_gt__eq_.overload1 `more...`]]``
41430
41431template<
41432    std::size_t N,
41433    class CharT,
41434    class Traits>
41435bool
41436``[link beast.ref.boost__beast__operator_gt__eq_.overload2 operator>=]``(
41437    CharT const* lhs,
41438    static_string< N, CharT, Traits > const& rhs);
41439  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_gt__eq_.overload2 `more...`]]``
41440
41441template<
41442    std::size_t N,
41443    class CharT,
41444    class Traits>
41445bool
41446``[link beast.ref.boost__beast__operator_gt__eq_.overload3 operator>=]``(
41447    static_string< N, CharT, Traits > const& lhs,
41448    CharT const* rhs);
41449  ``[''''&raquo;''' [link beast.ref.boost__beast__operator_gt__eq_.overload3 `more...`]]``
41450```
41451
41452[section:overload1 operator>= (1 of 3 overloads)]
41453
41454[heading Synopsis]
41455Defined in header [include_file boost/beast/core/static_string.hpp]
41456
41457```
41458template<
41459    std::size_t N,
41460    std::size_t M,
41461    class CharT,
41462    class Traits>
41463bool
41464operator>=(
41465    static_string< N, CharT, Traits > const& lhs,
41466    static_string< M, CharT, Traits > const& rhs);
41467```
41468
41469[heading Description]
41470
41471
41472[endsect]
41473
41474[section:overload2 operator>= (2 of 3 overloads)]
41475
41476[heading Synopsis]
41477Defined in header [include_file boost/beast/core/static_string.hpp]
41478
41479```
41480template<
41481    std::size_t N,
41482    class CharT,
41483    class Traits>
41484bool
41485operator>=(
41486    CharT const* lhs,
41487    static_string< N, CharT, Traits > const& rhs);
41488```
41489
41490[heading Description]
41491
41492
41493[endsect]
41494
41495[section:overload3 operator>= (3 of 3 overloads)]
41496
41497[heading Synopsis]
41498Defined in header [include_file boost/beast/core/static_string.hpp]
41499
41500```
41501template<
41502    std::size_t N,
41503    class CharT,
41504    class Traits>
41505bool
41506operator>=(
41507    static_string< N, CharT, Traits > const& lhs,
41508    CharT const* rhs);
41509```
41510
41511[heading Description]
41512
41513
41514[endsect]
41515
41516
41517[endsect]
41518
41519[section:boost__beast__swap swap]
41520[indexterm1 swap]
41521
41522
41523```
41524template<
41525    std::size_t N,
41526    class CharT,
41527    class Traits>
41528void
41529``[link beast.ref.boost__beast__swap.overload1 swap]``(
41530    static_string< N, CharT, Traits >& lhs,
41531    static_string< N, CharT, Traits >& rhs);
41532  ``[''''&raquo;''' [link beast.ref.boost__beast__swap.overload1 `more...`]]``
41533
41534template<
41535    std::size_t N,
41536    std::size_t M,
41537    class CharT,
41538    class Traits>
41539void
41540``[link beast.ref.boost__beast__swap.overload2 swap]``(
41541    static_string< N, CharT, Traits >& lhs,
41542    static_string< M, CharT, Traits >& rhs);
41543  ``[''''&raquo;''' [link beast.ref.boost__beast__swap.overload2 `more...`]]``
41544```
41545
41546[section:overload1 swap (1 of 2 overloads)]
41547
41548[heading Synopsis]
41549Defined in header [include_file boost/beast/core/static_string.hpp]
41550
41551```
41552template<
41553    std::size_t N,
41554    class CharT,
41555    class Traits>
41556void
41557swap(
41558    static_string< N, CharT, Traits >& lhs,
41559    static_string< N, CharT, Traits >& rhs);
41560```
41561
41562[heading Description]
41563
41564
41565[endsect]
41566
41567[section:overload2 swap (2 of 2 overloads)]
41568
41569[heading Synopsis]
41570Defined in header [include_file boost/beast/core/static_string.hpp]
41571
41572```
41573template<
41574    std::size_t N,
41575    std::size_t M,
41576    class CharT,
41577    class Traits>
41578void
41579swap(
41580    static_string< N, CharT, Traits >& lhs,
41581    static_string< M, CharT, Traits >& rhs);
41582```
41583
41584[heading Description]
41585
41586
41587[endsect]
41588
41589
41590[endsect]
41591
41592[section:boost__beast__operator_lt__lt_ operator<<]
41593[indexterm1 operator<<]
41594
41595
41596[heading Synopsis]
41597Defined in header [include_file boost/beast/core/static_string.hpp]
41598
41599```
41600template<
41601    std::size_t N,
41602    class CharT,
41603    class Traits>
41604std::basic_ostream< CharT, Traits >&
41605operator<<(
41606    std::basic_ostream< CharT, Traits >& os,
41607    static_string< N, CharT, Traits > const& str);
41608```
41609
41610[heading Description]
41611
41612
41613[endsect]
41614
41615[section:boost__beast__to_static_string to_static_string]
41616[indexterm1 to_static_string]
41617
41618
41619Returns a static string representing an integer as a decimal.
41620[heading Synopsis]
41621Defined in header [include_file boost/beast/core/static_string.hpp]
41622
41623```
41624template<
41625    class Integer>
41626static_string< detail::max_digits(sizeof(Integer))>
41627to_static_string(
41628    Integer x);
41629```
41630
41631[heading Description]
41632
41633[heading Parameters]
41634[table [[Name][Description]]
41635  [
41636    [`x`
41637    ]
41638    [
41639The signed or unsigned integer to convert. This must be an integral type.
41640    ]
41641  ]
41642]
41643[heading Return Value]
41644A [link beast.ref.boost__beast__static_string `static_string`] with an implementation defined maximum size large enough to hold the longest possible decimal representation of any integer of the given type.
41645
41646
41647[endsect]
41648
41649[section:boost__beast__get_lowest_layer get_lowest_layer]
41650[indexterm1 get_lowest_layer]
41651
41652
41653Return the lowest layer in a stack of stream layers.
41654[heading Synopsis]
41655Defined in header [include_file boost/beast/core/stream_traits.hpp]
41656
41657```
41658template<
41659    class T>
41660lowest_layer_type< T >&
41661get_lowest_layer(
41662    T& t);
41663```
41664
41665[heading Description]
41666If `t.next_layer()` is well-defined, returns `get_lowest_layer(t.next_layer())`. Otherwise, it returns `t`.
41667A stream layer is an object of class type which wraps another object through composition, and meets some or all of the named requirements of the wrapped type while optionally changing behavior. Examples of stream layers include `net::ssl::stream` or [link beast.ref.boost__beast__websocket__stream `beast::websocket::stream`]. The owner of a stream layer can interact directly with the wrapper, by passing it to stream algorithms. Or, the owner can obtain a reference to the wrapped object by calling `next_layer()` and accessing its members. This is necessary when it is desired to access functionality in the next layer which is not available in the wrapper. For example, [link beast.ref.boost__beast__websocket__stream `websocket::stream`] permits reading and writing, but in order to establish the underlying connection, members of the wrapped stream (such as `connect`) must be invoked directly.
41668Usually the last object in the chain of composition is the concrete socket object (for example, a `net::basic_socket` or a class derived from it). The function [link beast.ref.boost__beast__get_lowest_layer `get_lowest_layer`] exists to easily obtain the concrete socket when it is desired to perform an action that is not prescribed by a named requirement, such as changing a socket option, cancelling all pending asynchronous I/O, or closing the socket (perhaps by using [link beast.ref.boost__beast__close_socket `close_socket`]).
41669
41670[heading Example]
41671
41672```
41673// Set non-blocking mode on a stack of stream
41674// layers with a regular socket at the lowest layer.
41675template <class Stream>
41676void set_non_blocking (Stream& stream)
41677{
41678    error_code ec;
41679    // A compile error here means your lowest layer is not the right type!
41680    get_lowest_layer(stream).non_blocking(true, ec);
41681    if(ec)
41682        throw system_error{ec};
41683}
41684```
41685
41686[heading Parameters]
41687[table [[Name][Description]]
41688  [
41689    [`t`
41690    ]
41691    [
41692The layer in a stack of layered objects for which the lowest layer is returned.
41693    ]
41694  ]
41695]
41696[heading See Also]
41697[link beast.ref.boost__beast__close_socket `close_socket`], [link beast.ref.boost__beast__lowest_layer_type `lowest_layer_type`]
41698
41699
41700[endsect]
41701
41702[section:boost__beast__beast_close_socket beast_close_socket]
41703[indexterm1 beast_close_socket]
41704
41705
41706Default socket close function.
41707[heading Synopsis]
41708Defined in header [include_file boost/beast/core/stream_traits.hpp]
41709
41710```
41711template<
41712    class __Protocol__,
41713    class __Executor__>
41714void
41715beast_close_socket(
41716    net::basic_socket< Protocol, Executor >& sock);
41717```
41718
41719[heading Description]
41720This function is not meant to be called directly. Instead, it is called automatically when using [link beast.ref.boost__beast__close_socket `close_socket`]. To enable closure of user-defined types or classes derived from a particular user-defined type, this function should be overloaded in the corresponding namespace for the type in question.
41721
41722[heading See Also]
41723[link beast.ref.boost__beast__close_socket `close_socket`]
41724
41725
41726[endsect]
41727
41728[section:boost__beast__close_socket close_socket]
41729[indexterm1 close_socket]
41730
41731
41732Close a socket or socket-like object.
41733[heading Synopsis]
41734Defined in header [include_file boost/beast/core/stream_traits.hpp]
41735
41736```
41737template<
41738    class Socket>
41739void
41740close_socket(
41741    Socket& sock);
41742```
41743
41744[heading Description]
41745This function attempts to close an object representing a socket. In this context, a socket is an object for which an unqualified call to the function `void beast_close_socket(Socket&)` is well-defined. The function `beast_close_socket` is a ['customization point], allowing user-defined types to provide an algorithm for performing the close operation by overloading this function for the type in question.
41746Since the customization point is a function call, the normal rules for finding the correct overload are applied including the rules for argument-dependent lookup ("ADL"). This permits classes derived from a type for which a customization is provided to inherit the customization point.
41747An overload for the networking class template `net::basic_socket` is provided, which implements the close algorithm for all socket-like objects (hence the name of this customization point). When used in conjunction with [link beast.ref.boost__beast__get_lowest_layer `get_lowest_layer`], a generic algorithm operating on a layered stream can perform a closure of the underlying socket without knowing the exact list of concrete types.
41748
41749[heading Example 1]
41750
41751The following generic function synchronously sends a message on the stream, then closes the socket.
41752```
41753template <class WriteStream>
41754void hello_and_close (WriteStream& stream)
41755{
41756    net::write(stream, net::const_buffer("Hello, world!", 13));
41757    close_socket(get_lowest_layer(stream));
41758}
41759```
41760
41761To enable closure of user defined types, it is necessary to provide an overload of the function `beast_close_socket` for the type.
41762
41763[heading Example 2]
41764
41765The following code declares a user-defined type which contains a private socket, and provides an overload of the customization point which closes the private socket.
41766```
41767class my_socket
41768{
41769    net::ip::tcp::socket sock_;
41770
41771public:
41772    my_socket(net::io_context& ioc)
41773        : sock_(ioc)
41774    {
41775    }
41776
41777    friend void beast_close_socket(my_socket& s)
41778    {
41779        error_code ec;
41780        s.sock_.close(ec);
41781        // ignore the error
41782    }
41783};
41784```
41785
41786[heading Parameters]
41787[table [[Name][Description]]
41788  [
41789    [`sock`
41790    ]
41791    [
41792The socket to close. If the customization point is not defined for the type of this object, or one of its base classes, then a compiler error results.
41793    ]
41794  ]
41795]
41796[heading See Also]
41797[link beast.ref.boost__beast__beast_close_socket `beast_close_socket`]
41798
41799
41800[endsect]
41801
41802[section:boost__beast__iequals iequals]
41803[indexterm1 iequals]
41804
41805
41806Returns `true` if two strings are equal, using a case-insensitive comparison.
41807[heading Synopsis]
41808Defined in header [include_file boost/beast/core/string.hpp]
41809
41810```
41811bool
41812iequals(
41813    beast::string_view lhs,
41814    beast::string_view rhs);
41815```
41816
41817[heading Description]
41818The case-comparison operation is defined only for low-ASCII characters.
41819
41820[heading Parameters]
41821[table [[Name][Description]]
41822  [
41823    [`lhs`
41824    ]
41825    [
41826The string on the left side of the equality
41827    ]
41828  ]
41829  [
41830    [`rhs`
41831    ]
41832    [
41833The string on the right side of the equality
41834    ]
41835  ]
41836]
41837
41838
41839[endsect]
41840
41841[section:boost__beast__teardown teardown]
41842[indexterm1 teardown]
41843
41844
41845Tear down a `net::ssl::stream`.
41846[heading Synopsis]
41847Defined in header [include_file boost/beast/websocket/ssl.hpp]
41848
41849```
41850template<
41851    class __SyncStream__>
41852void
41853teardown(
41854    role_type role,
41855    net::ssl::stream< SyncStream >& stream,
41856    error_code& ec);
41857```
41858
41859[heading Description]
41860This tears down a connection. The implementation will call the overload of this function based on the `Stream` parameter used to consruct the socket. When `Stream` is a user defined type, and not a `net::ip::tcp::socket` or any `net::ssl::stream`, callers are responsible for providing a suitable overload of this function.
41861
41862[heading Parameters]
41863[table [[Name][Description]]
41864  [
41865    [`role`
41866    ]
41867    [
41868The role of the local endpoint
41869    ]
41870  ]
41871  [
41872    [`stream`
41873    ]
41874    [
41875The stream to tear down.
41876    ]
41877  ]
41878  [
41879    [`ec`
41880    ]
41881    [
41882Set to the error if any occurred.
41883    ]
41884  ]
41885]
41886
41887
41888[endsect]
41889
41890[section:boost__beast__async_teardown async_teardown]
41891[indexterm1 async_teardown]
41892
41893
41894Start tearing down a `net::ssl::stream`.
41895[heading Synopsis]
41896Defined in header [include_file boost/beast/websocket/ssl.hpp]
41897
41898```
41899template<
41900    class __AsyncStream__,
41901    class TeardownHandler>
41902void
41903async_teardown(
41904    role_type role,
41905    net::ssl::stream< AsyncStream >& stream,
41906    TeardownHandler&& handler);
41907```
41908
41909[heading Description]
41910This begins tearing down a connection asynchronously. The implementation will call the overload of this function based on the `Stream` parameter used to consruct the socket. When `Stream` is a user defined type, and not a `net::ip::tcp::socket` or any `net::ssl::stream`, callers are responsible for providing a suitable overload of this function.
41911
41912[heading Parameters]
41913[table [[Name][Description]]
41914  [
41915    [`role`
41916    ]
41917    [
41918The role of the local endpoint
41919    ]
41920  ]
41921  [
41922    [`stream`
41923    ]
41924    [
41925The stream to tear down.
41926    ]
41927  ]
41928  [
41929    [`handler`
41930    ]
41931    [
41932
41933The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
41934```
41935void handler(
41936    error_code const& error // result of operation
41937);
41938```
41939
41940Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
41941    ]
41942  ]
41943]
41944
41945
41946[endsect]
41947
41948[section:boost__beast__http__error http::error]
41949[indexterm1 http::error]
41950
41951
41952Error codes returned from HTTP algorithms and operations.
41953[heading Synopsis]
41954Defined in header [include_file boost/beast/http/error.hpp]
41955
41956```
41957enum error
41958```
41959
41960[heading Values]
41961[table [[Name][Description]]
41962  [
41963    [`end_of_stream`
41964    ]
41965    [
41966
41967The end of the stream was reached.
41968
41969This error is returned when attempting to read HTTP data,
41970and the stream returns the error `net::error::eof`
41971before any octets corresponding to a new HTTP message have
41972been received.
41973
41974    ]
41975  ]
41976  [
41977    [`partial_message`
41978    ]
41979    [
41980
41981The incoming message is incomplete.
41982
41983This happens when the end of stream is reached during
41984parsing and some octets have been received, but not the
41985entire message.
41986
41987    ]
41988  ]
41989  [
41990    [`need_more`
41991    ]
41992    [
41993
41994Additional buffers are required.
41995
41996This error is returned during parsing when additional
41997octets are needed. The caller should append more data
41998to the existing buffer and retry the parse operaetion.
41999
42000    ]
42001  ]
42002  [
42003    [`unexpected_body`
42004    ]
42005    [
42006
42007An unexpected body was encountered during parsing.
42008
42009This error is returned when attempting to parse body
42010octets into a message container which has the
42011@ref empty_body body type.
42012
42013@see empty_body
42014
42015    ]
42016  ]
42017  [
42018    [`need_buffer`
42019    ]
42020    [
42021
42022Additional buffers are required.
42023
42024This error is returned under the following conditions:
42025
42026@li During serialization when using @ref buffer_body.
42027The caller should update the body to point to a new
42028buffer or indicate that there are no more octets in
42029the body.
42030
42031@li During parsing when using @ref buffer_body.
42032The caller should update the body to point to a new
42033storage area to receive additional body octets.
42034
42035    ]
42036  ]
42037  [
42038    [`end_of_chunk`
42039    ]
42040    [
42041
42042The end of a chunk was reached.
42043
42044    ]
42045  ]
42046  [
42047    [`buffer_overflow`
42048    ]
42049    [
42050
42051Buffer maximum exceeded.
42052
42053This error is returned when reading HTTP content
42054into a dynamic buffer, and the operation would
42055exceed the maximum size of the buffer.
42056
42057    ]
42058  ]
42059  [
42060    [`header_limit`
42061    ]
42062    [
42063
42064Header limit exceeded.
42065
42066The parser detected an incoming message header which
42067exceeded a configured limit.
42068
42069    ]
42070  ]
42071  [
42072    [`body_limit`
42073    ]
42074    [
42075
42076Body limit exceeded.
42077
42078The parser detected an incoming message body which
42079exceeded a configured limit.
42080
42081    ]
42082  ]
42083  [
42084    [`bad_alloc`
42085    ]
42086    [
42087
42088A memory allocation failed.
42089
42090When basic_fields throws std::bad_alloc, it is
42091converted into this error by @ref parser.
42092
42093    ]
42094  ]
42095  [
42096    [`bad_line_ending`
42097    ]
42098    [
42099
42100The line ending was malformed.
42101
42102    ]
42103  ]
42104  [
42105    [`bad_method`
42106    ]
42107    [
42108
42109The method is invalid.
42110
42111    ]
42112  ]
42113  [
42114    [`bad_target`
42115    ]
42116    [
42117
42118The request-target is invalid.
42119
42120    ]
42121  ]
42122  [
42123    [`bad_version`
42124    ]
42125    [
42126
42127The HTTP-version is invalid.
42128
42129    ]
42130  ]
42131  [
42132    [`bad_status`
42133    ]
42134    [
42135
42136The status-code is invalid.
42137
42138    ]
42139  ]
42140  [
42141    [`bad_reason`
42142    ]
42143    [
42144
42145The reason-phrase is invalid.
42146
42147    ]
42148  ]
42149  [
42150    [`bad_field`
42151    ]
42152    [
42153
42154The field name is invalid.
42155
42156    ]
42157  ]
42158  [
42159    [`bad_value`
42160    ]
42161    [
42162
42163The field value is invalid.
42164
42165    ]
42166  ]
42167  [
42168    [`bad_content_length`
42169    ]
42170    [
42171
42172The Content-Length is invalid.
42173
42174    ]
42175  ]
42176  [
42177    [`bad_transfer_encoding`
42178    ]
42179    [
42180
42181The Transfer-Encoding is invalid.
42182
42183    ]
42184  ]
42185  [
42186    [`bad_chunk`
42187    ]
42188    [
42189
42190The chunk syntax is invalid.
42191
42192    ]
42193  ]
42194  [
42195    [`bad_chunk_extension`
42196    ]
42197    [
42198
42199The chunk extension is invalid.
42200
42201    ]
42202  ]
42203  [
42204    [`bad_obs_fold`
42205    ]
42206    [
42207
42208An obs-fold exceeded an internal limit.
42209
42210    ]
42211  ]
42212  [
42213    [`stale_parser`
42214    ]
42215    [
42216
42217The parser is stale.
42218
42219This happens when attempting to re-use a parser that has
42220already completed parsing a message. Programs must construct
42221a new parser for each message. This can be easily done by
42222storing the parser in an boost or std::optional container.
42223
42224    ]
42225  ]
42226  [
42227    [`short_read`
42228    ]
42229    [
42230
42231The message body is shorter than expected.
42232
42233This error is returned by @ref file_body when an unexpected
42234unexpected end-of-file condition is encountered while trying
42235to read from the file.
42236
42237    ]
42238  ]
42239]
42240[heading Description]
42241
42242
42243[endsect]
42244
42245[section:boost__beast__http__field http::field]
42246[indexterm1 http::field]
42247
42248
42249[heading Synopsis]
42250Defined in header [include_file boost/beast/http/field.hpp]
42251
42252```
42253enum field
42254```
42255
42256[heading Values]
42257[table [[Name][Description]]
42258  [
42259    [`unknown`
42260    ]
42261    [
42262
42263
42264    ]
42265  ]
42266  [
42267    [`a_im`
42268    ]
42269    [
42270
42271
42272    ]
42273  ]
42274  [
42275    [`accept`
42276    ]
42277    [
42278
42279
42280    ]
42281  ]
42282  [
42283    [`accept_additions`
42284    ]
42285    [
42286
42287
42288    ]
42289  ]
42290  [
42291    [`accept_charset`
42292    ]
42293    [
42294
42295
42296    ]
42297  ]
42298  [
42299    [`accept_datetime`
42300    ]
42301    [
42302
42303
42304    ]
42305  ]
42306  [
42307    [`accept_encoding`
42308    ]
42309    [
42310
42311
42312    ]
42313  ]
42314  [
42315    [`accept_features`
42316    ]
42317    [
42318
42319
42320    ]
42321  ]
42322  [
42323    [`accept_language`
42324    ]
42325    [
42326
42327
42328    ]
42329  ]
42330  [
42331    [`accept_patch`
42332    ]
42333    [
42334
42335
42336    ]
42337  ]
42338  [
42339    [`accept_post`
42340    ]
42341    [
42342
42343
42344    ]
42345  ]
42346  [
42347    [`accept_ranges`
42348    ]
42349    [
42350
42351
42352    ]
42353  ]
42354  [
42355    [`access_control`
42356    ]
42357    [
42358
42359
42360    ]
42361  ]
42362  [
42363    [`access_control_allow_credentials`
42364    ]
42365    [
42366
42367
42368    ]
42369  ]
42370  [
42371    [`access_control_allow_headers`
42372    ]
42373    [
42374
42375
42376    ]
42377  ]
42378  [
42379    [`access_control_allow_methods`
42380    ]
42381    [
42382
42383
42384    ]
42385  ]
42386  [
42387    [`access_control_allow_origin`
42388    ]
42389    [
42390
42391
42392    ]
42393  ]
42394  [
42395    [`access_control_expose_headers`
42396    ]
42397    [
42398
42399
42400    ]
42401  ]
42402  [
42403    [`access_control_max_age`
42404    ]
42405    [
42406
42407
42408    ]
42409  ]
42410  [
42411    [`access_control_request_headers`
42412    ]
42413    [
42414
42415
42416    ]
42417  ]
42418  [
42419    [`access_control_request_method`
42420    ]
42421    [
42422
42423
42424    ]
42425  ]
42426  [
42427    [`age`
42428    ]
42429    [
42430
42431
42432    ]
42433  ]
42434  [
42435    [`allow`
42436    ]
42437    [
42438
42439
42440    ]
42441  ]
42442  [
42443    [`alpn`
42444    ]
42445    [
42446
42447
42448    ]
42449  ]
42450  [
42451    [`also_control`
42452    ]
42453    [
42454
42455
42456    ]
42457  ]
42458  [
42459    [`alt_svc`
42460    ]
42461    [
42462
42463
42464    ]
42465  ]
42466  [
42467    [`alt_used`
42468    ]
42469    [
42470
42471
42472    ]
42473  ]
42474  [
42475    [`alternate_recipient`
42476    ]
42477    [
42478
42479
42480    ]
42481  ]
42482  [
42483    [`alternates`
42484    ]
42485    [
42486
42487
42488    ]
42489  ]
42490  [
42491    [`apparently_to`
42492    ]
42493    [
42494
42495
42496    ]
42497  ]
42498  [
42499    [`apply_to_redirect_ref`
42500    ]
42501    [
42502
42503
42504    ]
42505  ]
42506  [
42507    [`approved`
42508    ]
42509    [
42510
42511
42512    ]
42513  ]
42514  [
42515    [`archive`
42516    ]
42517    [
42518
42519
42520    ]
42521  ]
42522  [
42523    [`archived_at`
42524    ]
42525    [
42526
42527
42528    ]
42529  ]
42530  [
42531    [`article_names`
42532    ]
42533    [
42534
42535
42536    ]
42537  ]
42538  [
42539    [`article_updates`
42540    ]
42541    [
42542
42543
42544    ]
42545  ]
42546  [
42547    [`authentication_control`
42548    ]
42549    [
42550
42551
42552    ]
42553  ]
42554  [
42555    [`authentication_info`
42556    ]
42557    [
42558
42559
42560    ]
42561  ]
42562  [
42563    [`authentication_results`
42564    ]
42565    [
42566
42567
42568    ]
42569  ]
42570  [
42571    [`authorization`
42572    ]
42573    [
42574
42575
42576    ]
42577  ]
42578  [
42579    [`auto_submitted`
42580    ]
42581    [
42582
42583
42584    ]
42585  ]
42586  [
42587    [`autoforwarded`
42588    ]
42589    [
42590
42591
42592    ]
42593  ]
42594  [
42595    [`autosubmitted`
42596    ]
42597    [
42598
42599
42600    ]
42601  ]
42602  [
42603    [`base`
42604    ]
42605    [
42606
42607
42608    ]
42609  ]
42610  [
42611    [`bcc`
42612    ]
42613    [
42614
42615
42616    ]
42617  ]
42618  [
42619    [`body`
42620    ]
42621    [
42622
42623
42624    ]
42625  ]
42626  [
42627    [`c_ext`
42628    ]
42629    [
42630
42631
42632    ]
42633  ]
42634  [
42635    [`c_man`
42636    ]
42637    [
42638
42639
42640    ]
42641  ]
42642  [
42643    [`c_opt`
42644    ]
42645    [
42646
42647
42648    ]
42649  ]
42650  [
42651    [`c_pep`
42652    ]
42653    [
42654
42655
42656    ]
42657  ]
42658  [
42659    [`c_pep_info`
42660    ]
42661    [
42662
42663
42664    ]
42665  ]
42666  [
42667    [`cache_control`
42668    ]
42669    [
42670
42671
42672    ]
42673  ]
42674  [
42675    [`caldav_timezones`
42676    ]
42677    [
42678
42679
42680    ]
42681  ]
42682  [
42683    [`cancel_key`
42684    ]
42685    [
42686
42687
42688    ]
42689  ]
42690  [
42691    [`cancel_lock`
42692    ]
42693    [
42694
42695
42696    ]
42697  ]
42698  [
42699    [`cc`
42700    ]
42701    [
42702
42703
42704    ]
42705  ]
42706  [
42707    [`close`
42708    ]
42709    [
42710
42711
42712    ]
42713  ]
42714  [
42715    [`comments`
42716    ]
42717    [
42718
42719
42720    ]
42721  ]
42722  [
42723    [`compliance`
42724    ]
42725    [
42726
42727
42728    ]
42729  ]
42730  [
42731    [`connection`
42732    ]
42733    [
42734
42735
42736    ]
42737  ]
42738  [
42739    [`content_alternative`
42740    ]
42741    [
42742
42743
42744    ]
42745  ]
42746  [
42747    [`content_base`
42748    ]
42749    [
42750
42751
42752    ]
42753  ]
42754  [
42755    [`content_description`
42756    ]
42757    [
42758
42759
42760    ]
42761  ]
42762  [
42763    [`content_disposition`
42764    ]
42765    [
42766
42767
42768    ]
42769  ]
42770  [
42771    [`content_duration`
42772    ]
42773    [
42774
42775
42776    ]
42777  ]
42778  [
42779    [`content_encoding`
42780    ]
42781    [
42782
42783
42784    ]
42785  ]
42786  [
42787    [`content_features`
42788    ]
42789    [
42790
42791
42792    ]
42793  ]
42794  [
42795    [`content_id`
42796    ]
42797    [
42798
42799
42800    ]
42801  ]
42802  [
42803    [`content_identifier`
42804    ]
42805    [
42806
42807
42808    ]
42809  ]
42810  [
42811    [`content_language`
42812    ]
42813    [
42814
42815
42816    ]
42817  ]
42818  [
42819    [`content_length`
42820    ]
42821    [
42822
42823
42824    ]
42825  ]
42826  [
42827    [`content_location`
42828    ]
42829    [
42830
42831
42832    ]
42833  ]
42834  [
42835    [`content_md5`
42836    ]
42837    [
42838
42839
42840    ]
42841  ]
42842  [
42843    [`content_range`
42844    ]
42845    [
42846
42847
42848    ]
42849  ]
42850  [
42851    [`content_return`
42852    ]
42853    [
42854
42855
42856    ]
42857  ]
42858  [
42859    [`content_script_type`
42860    ]
42861    [
42862
42863
42864    ]
42865  ]
42866  [
42867    [`content_style_type`
42868    ]
42869    [
42870
42871
42872    ]
42873  ]
42874  [
42875    [`content_transfer_encoding`
42876    ]
42877    [
42878
42879
42880    ]
42881  ]
42882  [
42883    [`content_type`
42884    ]
42885    [
42886
42887
42888    ]
42889  ]
42890  [
42891    [`content_version`
42892    ]
42893    [
42894
42895
42896    ]
42897  ]
42898  [
42899    [`control`
42900    ]
42901    [
42902
42903
42904    ]
42905  ]
42906  [
42907    [`conversion`
42908    ]
42909    [
42910
42911
42912    ]
42913  ]
42914  [
42915    [`conversion_with_loss`
42916    ]
42917    [
42918
42919
42920    ]
42921  ]
42922  [
42923    [`cookie`
42924    ]
42925    [
42926
42927
42928    ]
42929  ]
42930  [
42931    [`cookie2`
42932    ]
42933    [
42934
42935
42936    ]
42937  ]
42938  [
42939    [`cost`
42940    ]
42941    [
42942
42943
42944    ]
42945  ]
42946  [
42947    [`dasl`
42948    ]
42949    [
42950
42951
42952    ]
42953  ]
42954  [
42955    [`date`
42956    ]
42957    [
42958
42959
42960    ]
42961  ]
42962  [
42963    [`date_received`
42964    ]
42965    [
42966
42967
42968    ]
42969  ]
42970  [
42971    [`dav`
42972    ]
42973    [
42974
42975
42976    ]
42977  ]
42978  [
42979    [`default_style`
42980    ]
42981    [
42982
42983
42984    ]
42985  ]
42986  [
42987    [`deferred_delivery`
42988    ]
42989    [
42990
42991
42992    ]
42993  ]
42994  [
42995    [`delivery_date`
42996    ]
42997    [
42998
42999
43000    ]
43001  ]
43002  [
43003    [`delta_base`
43004    ]
43005    [
43006
43007
43008    ]
43009  ]
43010  [
43011    [`depth`
43012    ]
43013    [
43014
43015
43016    ]
43017  ]
43018  [
43019    [`derived_from`
43020    ]
43021    [
43022
43023
43024    ]
43025  ]
43026  [
43027    [`destination`
43028    ]
43029    [
43030
43031
43032    ]
43033  ]
43034  [
43035    [`differential_id`
43036    ]
43037    [
43038
43039
43040    ]
43041  ]
43042  [
43043    [`digest`
43044    ]
43045    [
43046
43047
43048    ]
43049  ]
43050  [
43051    [`discarded_x400_ipms_extensions`
43052    ]
43053    [
43054
43055
43056    ]
43057  ]
43058  [
43059    [`discarded_x400_mts_extensions`
43060    ]
43061    [
43062
43063
43064    ]
43065  ]
43066  [
43067    [`disclose_recipients`
43068    ]
43069    [
43070
43071
43072    ]
43073  ]
43074  [
43075    [`disposition_notification_options`
43076    ]
43077    [
43078
43079
43080    ]
43081  ]
43082  [
43083    [`disposition_notification_to`
43084    ]
43085    [
43086
43087
43088    ]
43089  ]
43090  [
43091    [`distribution`
43092    ]
43093    [
43094
43095
43096    ]
43097  ]
43098  [
43099    [`dkim_signature`
43100    ]
43101    [
43102
43103
43104    ]
43105  ]
43106  [
43107    [`dl_expansion_history`
43108    ]
43109    [
43110
43111
43112    ]
43113  ]
43114  [
43115    [`downgraded_bcc`
43116    ]
43117    [
43118
43119
43120    ]
43121  ]
43122  [
43123    [`downgraded_cc`
43124    ]
43125    [
43126
43127
43128    ]
43129  ]
43130  [
43131    [`downgraded_disposition_notification_to`
43132    ]
43133    [
43134
43135
43136    ]
43137  ]
43138  [
43139    [`downgraded_final_recipient`
43140    ]
43141    [
43142
43143
43144    ]
43145  ]
43146  [
43147    [`downgraded_from`
43148    ]
43149    [
43150
43151
43152    ]
43153  ]
43154  [
43155    [`downgraded_in_reply_to`
43156    ]
43157    [
43158
43159
43160    ]
43161  ]
43162  [
43163    [`downgraded_mail_from`
43164    ]
43165    [
43166
43167
43168    ]
43169  ]
43170  [
43171    [`downgraded_message_id`
43172    ]
43173    [
43174
43175
43176    ]
43177  ]
43178  [
43179    [`downgraded_original_recipient`
43180    ]
43181    [
43182
43183
43184    ]
43185  ]
43186  [
43187    [`downgraded_rcpt_to`
43188    ]
43189    [
43190
43191
43192    ]
43193  ]
43194  [
43195    [`downgraded_references`
43196    ]
43197    [
43198
43199
43200    ]
43201  ]
43202  [
43203    [`downgraded_reply_to`
43204    ]
43205    [
43206
43207
43208    ]
43209  ]
43210  [
43211    [`downgraded_resent_bcc`
43212    ]
43213    [
43214
43215
43216    ]
43217  ]
43218  [
43219    [`downgraded_resent_cc`
43220    ]
43221    [
43222
43223
43224    ]
43225  ]
43226  [
43227    [`downgraded_resent_from`
43228    ]
43229    [
43230
43231
43232    ]
43233  ]
43234  [
43235    [`downgraded_resent_reply_to`
43236    ]
43237    [
43238
43239
43240    ]
43241  ]
43242  [
43243    [`downgraded_resent_sender`
43244    ]
43245    [
43246
43247
43248    ]
43249  ]
43250  [
43251    [`downgraded_resent_to`
43252    ]
43253    [
43254
43255
43256    ]
43257  ]
43258  [
43259    [`downgraded_return_path`
43260    ]
43261    [
43262
43263
43264    ]
43265  ]
43266  [
43267    [`downgraded_sender`
43268    ]
43269    [
43270
43271
43272    ]
43273  ]
43274  [
43275    [`downgraded_to`
43276    ]
43277    [
43278
43279
43280    ]
43281  ]
43282  [
43283    [`ediint_features`
43284    ]
43285    [
43286
43287
43288    ]
43289  ]
43290  [
43291    [`eesst_version`
43292    ]
43293    [
43294
43295
43296    ]
43297  ]
43298  [
43299    [`encoding`
43300    ]
43301    [
43302
43303
43304    ]
43305  ]
43306  [
43307    [`encrypted`
43308    ]
43309    [
43310
43311
43312    ]
43313  ]
43314  [
43315    [`errors_to`
43316    ]
43317    [
43318
43319
43320    ]
43321  ]
43322  [
43323    [`etag`
43324    ]
43325    [
43326
43327
43328    ]
43329  ]
43330  [
43331    [`expect`
43332    ]
43333    [
43334
43335
43336    ]
43337  ]
43338  [
43339    [`expires`
43340    ]
43341    [
43342
43343
43344    ]
43345  ]
43346  [
43347    [`expiry_date`
43348    ]
43349    [
43350
43351
43352    ]
43353  ]
43354  [
43355    [`ext`
43356    ]
43357    [
43358
43359
43360    ]
43361  ]
43362  [
43363    [`followup_to`
43364    ]
43365    [
43366
43367
43368    ]
43369  ]
43370  [
43371    [`forwarded`
43372    ]
43373    [
43374
43375
43376    ]
43377  ]
43378  [
43379    [`from`
43380    ]
43381    [
43382
43383
43384    ]
43385  ]
43386  [
43387    [`generate_delivery_report`
43388    ]
43389    [
43390
43391
43392    ]
43393  ]
43394  [
43395    [`getprofile`
43396    ]
43397    [
43398
43399
43400    ]
43401  ]
43402  [
43403    [`hobareg`
43404    ]
43405    [
43406
43407
43408    ]
43409  ]
43410  [
43411    [`host`
43412    ]
43413    [
43414
43415
43416    ]
43417  ]
43418  [
43419    [`http2_settings`
43420    ]
43421    [
43422
43423
43424    ]
43425  ]
43426  [
43427    [`if_`
43428    ]
43429    [
43430
43431
43432    ]
43433  ]
43434  [
43435    [`if_match`
43436    ]
43437    [
43438
43439
43440    ]
43441  ]
43442  [
43443    [`if_modified_since`
43444    ]
43445    [
43446
43447
43448    ]
43449  ]
43450  [
43451    [`if_none_match`
43452    ]
43453    [
43454
43455
43456    ]
43457  ]
43458  [
43459    [`if_range`
43460    ]
43461    [
43462
43463
43464    ]
43465  ]
43466  [
43467    [`if_schedule_tag_match`
43468    ]
43469    [
43470
43471
43472    ]
43473  ]
43474  [
43475    [`if_unmodified_since`
43476    ]
43477    [
43478
43479
43480    ]
43481  ]
43482  [
43483    [`im`
43484    ]
43485    [
43486
43487
43488    ]
43489  ]
43490  [
43491    [`importance`
43492    ]
43493    [
43494
43495
43496    ]
43497  ]
43498  [
43499    [`in_reply_to`
43500    ]
43501    [
43502
43503
43504    ]
43505  ]
43506  [
43507    [`incomplete_copy`
43508    ]
43509    [
43510
43511
43512    ]
43513  ]
43514  [
43515    [`injection_date`
43516    ]
43517    [
43518
43519
43520    ]
43521  ]
43522  [
43523    [`injection_info`
43524    ]
43525    [
43526
43527
43528    ]
43529  ]
43530  [
43531    [`jabber_id`
43532    ]
43533    [
43534
43535
43536    ]
43537  ]
43538  [
43539    [`keep_alive`
43540    ]
43541    [
43542
43543
43544    ]
43545  ]
43546  [
43547    [`keywords`
43548    ]
43549    [
43550
43551
43552    ]
43553  ]
43554  [
43555    [`label`
43556    ]
43557    [
43558
43559
43560    ]
43561  ]
43562  [
43563    [`language`
43564    ]
43565    [
43566
43567
43568    ]
43569  ]
43570  [
43571    [`last_modified`
43572    ]
43573    [
43574
43575
43576    ]
43577  ]
43578  [
43579    [`latest_delivery_time`
43580    ]
43581    [
43582
43583
43584    ]
43585  ]
43586  [
43587    [`lines`
43588    ]
43589    [
43590
43591
43592    ]
43593  ]
43594  [
43595    [`link`
43596    ]
43597    [
43598
43599
43600    ]
43601  ]
43602  [
43603    [`list_archive`
43604    ]
43605    [
43606
43607
43608    ]
43609  ]
43610  [
43611    [`list_help`
43612    ]
43613    [
43614
43615
43616    ]
43617  ]
43618  [
43619    [`list_id`
43620    ]
43621    [
43622
43623
43624    ]
43625  ]
43626  [
43627    [`list_owner`
43628    ]
43629    [
43630
43631
43632    ]
43633  ]
43634  [
43635    [`list_post`
43636    ]
43637    [
43638
43639
43640    ]
43641  ]
43642  [
43643    [`list_subscribe`
43644    ]
43645    [
43646
43647
43648    ]
43649  ]
43650  [
43651    [`list_unsubscribe`
43652    ]
43653    [
43654
43655
43656    ]
43657  ]
43658  [
43659    [`list_unsubscribe_post`
43660    ]
43661    [
43662
43663
43664    ]
43665  ]
43666  [
43667    [`location`
43668    ]
43669    [
43670
43671
43672    ]
43673  ]
43674  [
43675    [`lock_token`
43676    ]
43677    [
43678
43679
43680    ]
43681  ]
43682  [
43683    [`man`
43684    ]
43685    [
43686
43687
43688    ]
43689  ]
43690  [
43691    [`max_forwards`
43692    ]
43693    [
43694
43695
43696    ]
43697  ]
43698  [
43699    [`memento_datetime`
43700    ]
43701    [
43702
43703
43704    ]
43705  ]
43706  [
43707    [`message_context`
43708    ]
43709    [
43710
43711
43712    ]
43713  ]
43714  [
43715    [`message_id`
43716    ]
43717    [
43718
43719
43720    ]
43721  ]
43722  [
43723    [`message_type`
43724    ]
43725    [
43726
43727
43728    ]
43729  ]
43730  [
43731    [`meter`
43732    ]
43733    [
43734
43735
43736    ]
43737  ]
43738  [
43739    [`method_check`
43740    ]
43741    [
43742
43743
43744    ]
43745  ]
43746  [
43747    [`method_check_expires`
43748    ]
43749    [
43750
43751
43752    ]
43753  ]
43754  [
43755    [`mime_version`
43756    ]
43757    [
43758
43759
43760    ]
43761  ]
43762  [
43763    [`mmhs_acp127_message_identifier`
43764    ]
43765    [
43766
43767
43768    ]
43769  ]
43770  [
43771    [`mmhs_authorizing_users`
43772    ]
43773    [
43774
43775
43776    ]
43777  ]
43778  [
43779    [`mmhs_codress_message_indicator`
43780    ]
43781    [
43782
43783
43784    ]
43785  ]
43786  [
43787    [`mmhs_copy_precedence`
43788    ]
43789    [
43790
43791
43792    ]
43793  ]
43794  [
43795    [`mmhs_exempted_address`
43796    ]
43797    [
43798
43799
43800    ]
43801  ]
43802  [
43803    [`mmhs_extended_authorisation_info`
43804    ]
43805    [
43806
43807
43808    ]
43809  ]
43810  [
43811    [`mmhs_handling_instructions`
43812    ]
43813    [
43814
43815
43816    ]
43817  ]
43818  [
43819    [`mmhs_message_instructions`
43820    ]
43821    [
43822
43823
43824    ]
43825  ]
43826  [
43827    [`mmhs_message_type`
43828    ]
43829    [
43830
43831
43832    ]
43833  ]
43834  [
43835    [`mmhs_originator_plad`
43836    ]
43837    [
43838
43839
43840    ]
43841  ]
43842  [
43843    [`mmhs_originator_reference`
43844    ]
43845    [
43846
43847
43848    ]
43849  ]
43850  [
43851    [`mmhs_other_recipients_indicator_cc`
43852    ]
43853    [
43854
43855
43856    ]
43857  ]
43858  [
43859    [`mmhs_other_recipients_indicator_to`
43860    ]
43861    [
43862
43863
43864    ]
43865  ]
43866  [
43867    [`mmhs_primary_precedence`
43868    ]
43869    [
43870
43871
43872    ]
43873  ]
43874  [
43875    [`mmhs_subject_indicator_codes`
43876    ]
43877    [
43878
43879
43880    ]
43881  ]
43882  [
43883    [`mt_priority`
43884    ]
43885    [
43886
43887
43888    ]
43889  ]
43890  [
43891    [`negotiate`
43892    ]
43893    [
43894
43895
43896    ]
43897  ]
43898  [
43899    [`newsgroups`
43900    ]
43901    [
43902
43903
43904    ]
43905  ]
43906  [
43907    [`nntp_posting_date`
43908    ]
43909    [
43910
43911
43912    ]
43913  ]
43914  [
43915    [`nntp_posting_host`
43916    ]
43917    [
43918
43919
43920    ]
43921  ]
43922  [
43923    [`non_compliance`
43924    ]
43925    [
43926
43927
43928    ]
43929  ]
43930  [
43931    [`obsoletes`
43932    ]
43933    [
43934
43935
43936    ]
43937  ]
43938  [
43939    [`opt`
43940    ]
43941    [
43942
43943
43944    ]
43945  ]
43946  [
43947    [`optional`
43948    ]
43949    [
43950
43951
43952    ]
43953  ]
43954  [
43955    [`optional_www_authenticate`
43956    ]
43957    [
43958
43959
43960    ]
43961  ]
43962  [
43963    [`ordering_type`
43964    ]
43965    [
43966
43967
43968    ]
43969  ]
43970  [
43971    [`organization`
43972    ]
43973    [
43974
43975
43976    ]
43977  ]
43978  [
43979    [`origin`
43980    ]
43981    [
43982
43983
43984    ]
43985  ]
43986  [
43987    [`original_encoded_information_types`
43988    ]
43989    [
43990
43991
43992    ]
43993  ]
43994  [
43995    [`original_from`
43996    ]
43997    [
43998
43999
44000    ]
44001  ]
44002  [
44003    [`original_message_id`
44004    ]
44005    [
44006
44007
44008    ]
44009  ]
44010  [
44011    [`original_recipient`
44012    ]
44013    [
44014
44015
44016    ]
44017  ]
44018  [
44019    [`original_sender`
44020    ]
44021    [
44022
44023
44024    ]
44025  ]
44026  [
44027    [`original_subject`
44028    ]
44029    [
44030
44031
44032    ]
44033  ]
44034  [
44035    [`originator_return_address`
44036    ]
44037    [
44038
44039
44040    ]
44041  ]
44042  [
44043    [`overwrite`
44044    ]
44045    [
44046
44047
44048    ]
44049  ]
44050  [
44051    [`p3p`
44052    ]
44053    [
44054
44055
44056    ]
44057  ]
44058  [
44059    [`path`
44060    ]
44061    [
44062
44063
44064    ]
44065  ]
44066  [
44067    [`pep`
44068    ]
44069    [
44070
44071
44072    ]
44073  ]
44074  [
44075    [`pep_info`
44076    ]
44077    [
44078
44079
44080    ]
44081  ]
44082  [
44083    [`pics_label`
44084    ]
44085    [
44086
44087
44088    ]
44089  ]
44090  [
44091    [`position`
44092    ]
44093    [
44094
44095
44096    ]
44097  ]
44098  [
44099    [`posting_version`
44100    ]
44101    [
44102
44103
44104    ]
44105  ]
44106  [
44107    [`pragma`
44108    ]
44109    [
44110
44111
44112    ]
44113  ]
44114  [
44115    [`prefer`
44116    ]
44117    [
44118
44119
44120    ]
44121  ]
44122  [
44123    [`preference_applied`
44124    ]
44125    [
44126
44127
44128    ]
44129  ]
44130  [
44131    [`prevent_nondelivery_report`
44132    ]
44133    [
44134
44135
44136    ]
44137  ]
44138  [
44139    [`priority`
44140    ]
44141    [
44142
44143
44144    ]
44145  ]
44146  [
44147    [`privicon`
44148    ]
44149    [
44150
44151
44152    ]
44153  ]
44154  [
44155    [`profileobject`
44156    ]
44157    [
44158
44159
44160    ]
44161  ]
44162  [
44163    [`protocol`
44164    ]
44165    [
44166
44167
44168    ]
44169  ]
44170  [
44171    [`protocol_info`
44172    ]
44173    [
44174
44175
44176    ]
44177  ]
44178  [
44179    [`protocol_query`
44180    ]
44181    [
44182
44183
44184    ]
44185  ]
44186  [
44187    [`protocol_request`
44188    ]
44189    [
44190
44191
44192    ]
44193  ]
44194  [
44195    [`proxy_authenticate`
44196    ]
44197    [
44198
44199
44200    ]
44201  ]
44202  [
44203    [`proxy_authentication_info`
44204    ]
44205    [
44206
44207
44208    ]
44209  ]
44210  [
44211    [`proxy_authorization`
44212    ]
44213    [
44214
44215
44216    ]
44217  ]
44218  [
44219    [`proxy_connection`
44220    ]
44221    [
44222
44223
44224    ]
44225  ]
44226  [
44227    [`proxy_features`
44228    ]
44229    [
44230
44231
44232    ]
44233  ]
44234  [
44235    [`proxy_instruction`
44236    ]
44237    [
44238
44239
44240    ]
44241  ]
44242  [
44243    [`public_`
44244    ]
44245    [
44246
44247
44248    ]
44249  ]
44250  [
44251    [`public_key_pins`
44252    ]
44253    [
44254
44255
44256    ]
44257  ]
44258  [
44259    [`public_key_pins_report_only`
44260    ]
44261    [
44262
44263
44264    ]
44265  ]
44266  [
44267    [`range`
44268    ]
44269    [
44270
44271
44272    ]
44273  ]
44274  [
44275    [`received`
44276    ]
44277    [
44278
44279
44280    ]
44281  ]
44282  [
44283    [`received_spf`
44284    ]
44285    [
44286
44287
44288    ]
44289  ]
44290  [
44291    [`redirect_ref`
44292    ]
44293    [
44294
44295
44296    ]
44297  ]
44298  [
44299    [`references`
44300    ]
44301    [
44302
44303
44304    ]
44305  ]
44306  [
44307    [`referer`
44308    ]
44309    [
44310
44311
44312    ]
44313  ]
44314  [
44315    [`referer_root`
44316    ]
44317    [
44318
44319
44320    ]
44321  ]
44322  [
44323    [`relay_version`
44324    ]
44325    [
44326
44327
44328    ]
44329  ]
44330  [
44331    [`reply_by`
44332    ]
44333    [
44334
44335
44336    ]
44337  ]
44338  [
44339    [`reply_to`
44340    ]
44341    [
44342
44343
44344    ]
44345  ]
44346  [
44347    [`require_recipient_valid_since`
44348    ]
44349    [
44350
44351
44352    ]
44353  ]
44354  [
44355    [`resent_bcc`
44356    ]
44357    [
44358
44359
44360    ]
44361  ]
44362  [
44363    [`resent_cc`
44364    ]
44365    [
44366
44367
44368    ]
44369  ]
44370  [
44371    [`resent_date`
44372    ]
44373    [
44374
44375
44376    ]
44377  ]
44378  [
44379    [`resent_from`
44380    ]
44381    [
44382
44383
44384    ]
44385  ]
44386  [
44387    [`resent_message_id`
44388    ]
44389    [
44390
44391
44392    ]
44393  ]
44394  [
44395    [`resent_reply_to`
44396    ]
44397    [
44398
44399
44400    ]
44401  ]
44402  [
44403    [`resent_sender`
44404    ]
44405    [
44406
44407
44408    ]
44409  ]
44410  [
44411    [`resent_to`
44412    ]
44413    [
44414
44415
44416    ]
44417  ]
44418  [
44419    [`resolution_hint`
44420    ]
44421    [
44422
44423
44424    ]
44425  ]
44426  [
44427    [`resolver_location`
44428    ]
44429    [
44430
44431
44432    ]
44433  ]
44434  [
44435    [`retry_after`
44436    ]
44437    [
44438
44439
44440    ]
44441  ]
44442  [
44443    [`return_path`
44444    ]
44445    [
44446
44447
44448    ]
44449  ]
44450  [
44451    [`safe`
44452    ]
44453    [
44454
44455
44456    ]
44457  ]
44458  [
44459    [`schedule_reply`
44460    ]
44461    [
44462
44463
44464    ]
44465  ]
44466  [
44467    [`schedule_tag`
44468    ]
44469    [
44470
44471
44472    ]
44473  ]
44474  [
44475    [`sec_fetch_dest`
44476    ]
44477    [
44478
44479
44480    ]
44481  ]
44482  [
44483    [`sec_fetch_mode`
44484    ]
44485    [
44486
44487
44488    ]
44489  ]
44490  [
44491    [`sec_fetch_site`
44492    ]
44493    [
44494
44495
44496    ]
44497  ]
44498  [
44499    [`sec_fetch_user`
44500    ]
44501    [
44502
44503
44504    ]
44505  ]
44506  [
44507    [`sec_websocket_accept`
44508    ]
44509    [
44510
44511
44512    ]
44513  ]
44514  [
44515    [`sec_websocket_extensions`
44516    ]
44517    [
44518
44519
44520    ]
44521  ]
44522  [
44523    [`sec_websocket_key`
44524    ]
44525    [
44526
44527
44528    ]
44529  ]
44530  [
44531    [`sec_websocket_protocol`
44532    ]
44533    [
44534
44535
44536    ]
44537  ]
44538  [
44539    [`sec_websocket_version`
44540    ]
44541    [
44542
44543
44544    ]
44545  ]
44546  [
44547    [`security_scheme`
44548    ]
44549    [
44550
44551
44552    ]
44553  ]
44554  [
44555    [`see_also`
44556    ]
44557    [
44558
44559
44560    ]
44561  ]
44562  [
44563    [`sender`
44564    ]
44565    [
44566
44567
44568    ]
44569  ]
44570  [
44571    [`sensitivity`
44572    ]
44573    [
44574
44575
44576    ]
44577  ]
44578  [
44579    [`server`
44580    ]
44581    [
44582
44583
44584    ]
44585  ]
44586  [
44587    [`set_cookie`
44588    ]
44589    [
44590
44591
44592    ]
44593  ]
44594  [
44595    [`set_cookie2`
44596    ]
44597    [
44598
44599
44600    ]
44601  ]
44602  [
44603    [`setprofile`
44604    ]
44605    [
44606
44607
44608    ]
44609  ]
44610  [
44611    [`sio_label`
44612    ]
44613    [
44614
44615
44616    ]
44617  ]
44618  [
44619    [`sio_label_history`
44620    ]
44621    [
44622
44623
44624    ]
44625  ]
44626  [
44627    [`slug`
44628    ]
44629    [
44630
44631
44632    ]
44633  ]
44634  [
44635    [`soapaction`
44636    ]
44637    [
44638
44639
44640    ]
44641  ]
44642  [
44643    [`solicitation`
44644    ]
44645    [
44646
44647
44648    ]
44649  ]
44650  [
44651    [`status_uri`
44652    ]
44653    [
44654
44655
44656    ]
44657  ]
44658  [
44659    [`strict_transport_security`
44660    ]
44661    [
44662
44663
44664    ]
44665  ]
44666  [
44667    [`subject`
44668    ]
44669    [
44670
44671
44672    ]
44673  ]
44674  [
44675    [`subok`
44676    ]
44677    [
44678
44679
44680    ]
44681  ]
44682  [
44683    [`subst`
44684    ]
44685    [
44686
44687
44688    ]
44689  ]
44690  [
44691    [`summary`
44692    ]
44693    [
44694
44695
44696    ]
44697  ]
44698  [
44699    [`supersedes`
44700    ]
44701    [
44702
44703
44704    ]
44705  ]
44706  [
44707    [`surrogate_capability`
44708    ]
44709    [
44710
44711
44712    ]
44713  ]
44714  [
44715    [`surrogate_control`
44716    ]
44717    [
44718
44719
44720    ]
44721  ]
44722  [
44723    [`tcn`
44724    ]
44725    [
44726
44727
44728    ]
44729  ]
44730  [
44731    [`te`
44732    ]
44733    [
44734
44735
44736    ]
44737  ]
44738  [
44739    [`timeout`
44740    ]
44741    [
44742
44743
44744    ]
44745  ]
44746  [
44747    [`title`
44748    ]
44749    [
44750
44751
44752    ]
44753  ]
44754  [
44755    [`to`
44756    ]
44757    [
44758
44759
44760    ]
44761  ]
44762  [
44763    [`topic`
44764    ]
44765    [
44766
44767
44768    ]
44769  ]
44770  [
44771    [`trailer`
44772    ]
44773    [
44774
44775
44776    ]
44777  ]
44778  [
44779    [`transfer_encoding`
44780    ]
44781    [
44782
44783
44784    ]
44785  ]
44786  [
44787    [`ttl`
44788    ]
44789    [
44790
44791
44792    ]
44793  ]
44794  [
44795    [`ua_color`
44796    ]
44797    [
44798
44799
44800    ]
44801  ]
44802  [
44803    [`ua_media`
44804    ]
44805    [
44806
44807
44808    ]
44809  ]
44810  [
44811    [`ua_pixels`
44812    ]
44813    [
44814
44815
44816    ]
44817  ]
44818  [
44819    [`ua_resolution`
44820    ]
44821    [
44822
44823
44824    ]
44825  ]
44826  [
44827    [`ua_windowpixels`
44828    ]
44829    [
44830
44831
44832    ]
44833  ]
44834  [
44835    [`upgrade`
44836    ]
44837    [
44838
44839
44840    ]
44841  ]
44842  [
44843    [`urgency`
44844    ]
44845    [
44846
44847
44848    ]
44849  ]
44850  [
44851    [`uri`
44852    ]
44853    [
44854
44855
44856    ]
44857  ]
44858  [
44859    [`user_agent`
44860    ]
44861    [
44862
44863
44864    ]
44865  ]
44866  [
44867    [`variant_vary`
44868    ]
44869    [
44870
44871
44872    ]
44873  ]
44874  [
44875    [`vary`
44876    ]
44877    [
44878
44879
44880    ]
44881  ]
44882  [
44883    [`vbr_info`
44884    ]
44885    [
44886
44887
44888    ]
44889  ]
44890  [
44891    [`version`
44892    ]
44893    [
44894
44895
44896    ]
44897  ]
44898  [
44899    [`via`
44900    ]
44901    [
44902
44903
44904    ]
44905  ]
44906  [
44907    [`want_digest`
44908    ]
44909    [
44910
44911
44912    ]
44913  ]
44914  [
44915    [`warning`
44916    ]
44917    [
44918
44919
44920    ]
44921  ]
44922  [
44923    [`www_authenticate`
44924    ]
44925    [
44926
44927
44928    ]
44929  ]
44930  [
44931    [`x_archived_at`
44932    ]
44933    [
44934
44935
44936    ]
44937  ]
44938  [
44939    [`x_device_accept`
44940    ]
44941    [
44942
44943
44944    ]
44945  ]
44946  [
44947    [`x_device_accept_charset`
44948    ]
44949    [
44950
44951
44952    ]
44953  ]
44954  [
44955    [`x_device_accept_encoding`
44956    ]
44957    [
44958
44959
44960    ]
44961  ]
44962  [
44963    [`x_device_accept_language`
44964    ]
44965    [
44966
44967
44968    ]
44969  ]
44970  [
44971    [`x_device_user_agent`
44972    ]
44973    [
44974
44975
44976    ]
44977  ]
44978  [
44979    [`x_frame_options`
44980    ]
44981    [
44982
44983
44984    ]
44985  ]
44986  [
44987    [`x_mittente`
44988    ]
44989    [
44990
44991
44992    ]
44993  ]
44994  [
44995    [`x_pgp_sig`
44996    ]
44997    [
44998
44999
45000    ]
45001  ]
45002  [
45003    [`x_ricevuta`
45004    ]
45005    [
45006
45007
45008    ]
45009  ]
45010  [
45011    [`x_riferimento_message_id`
45012    ]
45013    [
45014
45015
45016    ]
45017  ]
45018  [
45019    [`x_tiporicevuta`
45020    ]
45021    [
45022
45023
45024    ]
45025  ]
45026  [
45027    [`x_trasporto`
45028    ]
45029    [
45030
45031
45032    ]
45033  ]
45034  [
45035    [`x_verificasicurezza`
45036    ]
45037    [
45038
45039
45040    ]
45041  ]
45042  [
45043    [`x400_content_identifier`
45044    ]
45045    [
45046
45047
45048    ]
45049  ]
45050  [
45051    [`x400_content_return`
45052    ]
45053    [
45054
45055
45056    ]
45057  ]
45058  [
45059    [`x400_content_type`
45060    ]
45061    [
45062
45063
45064    ]
45065  ]
45066  [
45067    [`x400_mts_identifier`
45068    ]
45069    [
45070
45071
45072    ]
45073  ]
45074  [
45075    [`x400_originator`
45076    ]
45077    [
45078
45079
45080    ]
45081  ]
45082  [
45083    [`x400_received`
45084    ]
45085    [
45086
45087
45088    ]
45089  ]
45090  [
45091    [`x400_recipients`
45092    ]
45093    [
45094
45095
45096    ]
45097  ]
45098  [
45099    [`x400_trace`
45100    ]
45101    [
45102
45103
45104    ]
45105  ]
45106  [
45107    [`xref`
45108    ]
45109    [
45110
45111
45112    ]
45113  ]
45114]
45115[heading Description]
45116
45117
45118[endsect]
45119
45120[section:boost__beast__http__status http::status]
45121[indexterm1 http::status]
45122
45123
45124[heading Synopsis]
45125Defined in header [include_file boost/beast/http/status.hpp]
45126
45127```
45128enum status
45129```
45130
45131[heading Values]
45132[table [[Name][Description]]
45133  [
45134    [`unknown`
45135    ]
45136    [
45137
45138An unknown status-code.
45139
45140This value indicates that the value for the status code
45141is not in the list of commonly recognized status codes.
45142Callers interested in the exactly value should use the
45143interface which provides the raw integer.
45144
45145    ]
45146  ]
45147  [
45148    [`continue_`
45149    ]
45150    [
45151
45152
45153    ]
45154  ]
45155  [
45156    [`switching_protocols`
45157    ]
45158    [
45159
45160Switching Protocols.
45161
45162This status indicates that a request to switch to a new
45163protocol was accepted and applied by the server. A successful
45164response to a WebSocket Upgrade HTTP request will have this
45165code.
45166
45167    ]
45168  ]
45169  [
45170    [`processing`
45171    ]
45172    [
45173
45174
45175    ]
45176  ]
45177  [
45178    [`ok`
45179    ]
45180    [
45181
45182
45183    ]
45184  ]
45185  [
45186    [`created`
45187    ]
45188    [
45189
45190
45191    ]
45192  ]
45193  [
45194    [`accepted`
45195    ]
45196    [
45197
45198
45199    ]
45200  ]
45201  [
45202    [`non_authoritative_information`
45203    ]
45204    [
45205
45206
45207    ]
45208  ]
45209  [
45210    [`no_content`
45211    ]
45212    [
45213
45214
45215    ]
45216  ]
45217  [
45218    [`reset_content`
45219    ]
45220    [
45221
45222
45223    ]
45224  ]
45225  [
45226    [`partial_content`
45227    ]
45228    [
45229
45230
45231    ]
45232  ]
45233  [
45234    [`multi_status`
45235    ]
45236    [
45237
45238
45239    ]
45240  ]
45241  [
45242    [`already_reported`
45243    ]
45244    [
45245
45246
45247    ]
45248  ]
45249  [
45250    [`im_used`
45251    ]
45252    [
45253
45254
45255    ]
45256  ]
45257  [
45258    [`multiple_choices`
45259    ]
45260    [
45261
45262
45263    ]
45264  ]
45265  [
45266    [`moved_permanently`
45267    ]
45268    [
45269
45270
45271    ]
45272  ]
45273  [
45274    [`found`
45275    ]
45276    [
45277
45278
45279    ]
45280  ]
45281  [
45282    [`see_other`
45283    ]
45284    [
45285
45286
45287    ]
45288  ]
45289  [
45290    [`not_modified`
45291    ]
45292    [
45293
45294
45295    ]
45296  ]
45297  [
45298    [`use_proxy`
45299    ]
45300    [
45301
45302
45303    ]
45304  ]
45305  [
45306    [`temporary_redirect`
45307    ]
45308    [
45309
45310
45311    ]
45312  ]
45313  [
45314    [`permanent_redirect`
45315    ]
45316    [
45317
45318
45319    ]
45320  ]
45321  [
45322    [`bad_request`
45323    ]
45324    [
45325
45326
45327    ]
45328  ]
45329  [
45330    [`unauthorized`
45331    ]
45332    [
45333
45334
45335    ]
45336  ]
45337  [
45338    [`payment_required`
45339    ]
45340    [
45341
45342
45343    ]
45344  ]
45345  [
45346    [`forbidden`
45347    ]
45348    [
45349
45350
45351    ]
45352  ]
45353  [
45354    [`not_found`
45355    ]
45356    [
45357
45358
45359    ]
45360  ]
45361  [
45362    [`method_not_allowed`
45363    ]
45364    [
45365
45366
45367    ]
45368  ]
45369  [
45370    [`not_acceptable`
45371    ]
45372    [
45373
45374
45375    ]
45376  ]
45377  [
45378    [`proxy_authentication_required`
45379    ]
45380    [
45381
45382
45383    ]
45384  ]
45385  [
45386    [`request_timeout`
45387    ]
45388    [
45389
45390
45391    ]
45392  ]
45393  [
45394    [`conflict`
45395    ]
45396    [
45397
45398
45399    ]
45400  ]
45401  [
45402    [`gone`
45403    ]
45404    [
45405
45406
45407    ]
45408  ]
45409  [
45410    [`length_required`
45411    ]
45412    [
45413
45414
45415    ]
45416  ]
45417  [
45418    [`precondition_failed`
45419    ]
45420    [
45421
45422
45423    ]
45424  ]
45425  [
45426    [`payload_too_large`
45427    ]
45428    [
45429
45430
45431    ]
45432  ]
45433  [
45434    [`uri_too_long`
45435    ]
45436    [
45437
45438
45439    ]
45440  ]
45441  [
45442    [`unsupported_media_type`
45443    ]
45444    [
45445
45446
45447    ]
45448  ]
45449  [
45450    [`range_not_satisfiable`
45451    ]
45452    [
45453
45454
45455    ]
45456  ]
45457  [
45458    [`expectation_failed`
45459    ]
45460    [
45461
45462
45463    ]
45464  ]
45465  [
45466    [`misdirected_request`
45467    ]
45468    [
45469
45470
45471    ]
45472  ]
45473  [
45474    [`unprocessable_entity`
45475    ]
45476    [
45477
45478
45479    ]
45480  ]
45481  [
45482    [`locked`
45483    ]
45484    [
45485
45486
45487    ]
45488  ]
45489  [
45490    [`failed_dependency`
45491    ]
45492    [
45493
45494
45495    ]
45496  ]
45497  [
45498    [`upgrade_required`
45499    ]
45500    [
45501
45502
45503    ]
45504  ]
45505  [
45506    [`precondition_required`
45507    ]
45508    [
45509
45510
45511    ]
45512  ]
45513  [
45514    [`too_many_requests`
45515    ]
45516    [
45517
45518
45519    ]
45520  ]
45521  [
45522    [`request_header_fields_too_large`
45523    ]
45524    [
45525
45526
45527    ]
45528  ]
45529  [
45530    [`connection_closed_without_response`
45531    ]
45532    [
45533
45534
45535    ]
45536  ]
45537  [
45538    [`unavailable_for_legal_reasons`
45539    ]
45540    [
45541
45542
45543    ]
45544  ]
45545  [
45546    [`client_closed_request`
45547    ]
45548    [
45549
45550
45551    ]
45552  ]
45553  [
45554    [`internal_server_error`
45555    ]
45556    [
45557
45558
45559    ]
45560  ]
45561  [
45562    [`not_implemented`
45563    ]
45564    [
45565
45566
45567    ]
45568  ]
45569  [
45570    [`bad_gateway`
45571    ]
45572    [
45573
45574
45575    ]
45576  ]
45577  [
45578    [`service_unavailable`
45579    ]
45580    [
45581
45582
45583    ]
45584  ]
45585  [
45586    [`gateway_timeout`
45587    ]
45588    [
45589
45590
45591    ]
45592  ]
45593  [
45594    [`http_version_not_supported`
45595    ]
45596    [
45597
45598
45599    ]
45600  ]
45601  [
45602    [`variant_also_negotiates`
45603    ]
45604    [
45605
45606
45607    ]
45608  ]
45609  [
45610    [`insufficient_storage`
45611    ]
45612    [
45613
45614
45615    ]
45616  ]
45617  [
45618    [`loop_detected`
45619    ]
45620    [
45621
45622
45623    ]
45624  ]
45625  [
45626    [`not_extended`
45627    ]
45628    [
45629
45630
45631    ]
45632  ]
45633  [
45634    [`network_authentication_required`
45635    ]
45636    [
45637
45638
45639    ]
45640  ]
45641  [
45642    [`network_connect_timeout_error`
45643    ]
45644    [
45645
45646
45647    ]
45648  ]
45649]
45650[heading Description]
45651
45652
45653[endsect]
45654
45655[section:boost__beast__http__status_class http::status_class]
45656[indexterm1 http::status_class]
45657
45658
45659Represents the class of a status-code.
45660[heading Synopsis]
45661Defined in header [include_file boost/beast/http/status.hpp]
45662
45663```
45664enum status_class
45665```
45666
45667[heading Values]
45668[table [[Name][Description]]
45669  [
45670    [`unknown`
45671    ]
45672    [
45673
45674Unknown status-class.
45675
45676    ]
45677  ]
45678  [
45679    [`informational`
45680    ]
45681    [
45682
45683The request was received, continuing processing.
45684
45685    ]
45686  ]
45687  [
45688    [`successful`
45689    ]
45690    [
45691
45692The request was successfully received, understood, and accepted.
45693
45694    ]
45695  ]
45696  [
45697    [`redirection`
45698    ]
45699    [
45700
45701Further action needs to be taken in order to complete the request.
45702
45703    ]
45704  ]
45705  [
45706    [`client_error`
45707    ]
45708    [
45709
45710The request contains bad syntax or cannot be fulfilled.
45711
45712    ]
45713  ]
45714  [
45715    [`server_error`
45716    ]
45717    [
45718
45719The server failed to fulfill an apparently valid request.
45720
45721    ]
45722  ]
45723]
45724[heading Description]
45725
45726
45727[endsect]
45728
45729[section:boost__beast__http__verb http::verb]
45730[indexterm1 http::verb]
45731
45732
45733HTTP request method verbs.
45734[heading Synopsis]
45735Defined in header [include_file boost/beast/http/verb.hpp]
45736
45737```
45738enum verb
45739```
45740
45741[heading Values]
45742[table [[Name][Description]]
45743  [
45744    [`unknown`
45745    ]
45746    [
45747
45748An unknown method.
45749
45750This value indicates that the request method string is not
45751one of the recognized verbs. Callers interested in the method
45752should use an interface which returns the original string.
45753
45754    ]
45755  ]
45756  [
45757    [`delete_`
45758    ]
45759    [
45760
45761The DELETE method deletes the specified resource.
45762
45763    ]
45764  ]
45765  [
45766    [`get`
45767    ]
45768    [
45769
45770The GET method requests a representation of the specified resource.
45771
45772Requests using GET should only retrieve data and should have no other effect.
45773
45774    ]
45775  ]
45776  [
45777    [`head`
45778    ]
45779    [
45780
45781The HEAD method asks for a response identical to that of a GET request, but without the response body.
45782
45783This is useful for retrieving meta-information written in response
45784headers, without having to transport the entire content.
45785
45786    ]
45787  ]
45788  [
45789    [`post`
45790    ]
45791    [
45792
45793The POST method requests that the server accept the entity enclosed in the request as a new subordinate of the web resource identified by the URI.
45794
45795The data POSTed might be, for example, an annotation for existing
45796resources; a message for a bulletin board, newsgroup, mailing list,
45797or comment thread; a block of data that is the result of submitting
45798a web form to a data-handling process; or an item to add to a database
45799
45800    ]
45801  ]
45802  [
45803    [`put`
45804    ]
45805    [
45806
45807The PUT method requests that the enclosed entity be stored under the supplied URI.
45808
45809If the URI refers to an already existing resource, it is modified;
45810if the URI does not point to an existing resource, then the server
45811can create the resource with that URI.
45812
45813    ]
45814  ]
45815  [
45816    [`connect`
45817    ]
45818    [
45819
45820The CONNECT method converts the request connection to a transparent TCP/IP tunnel.
45821
45822This is usually to facilitate SSL-encrypted communication (HTTPS)
45823through an unencrypted HTTP proxy.
45824
45825    ]
45826  ]
45827  [
45828    [`options`
45829    ]
45830    [
45831
45832The OPTIONS method returns the HTTP methods that the server supports for the specified URL.
45833
45834This can be used to check the functionality of a web server by requesting
45835'*' instead of a specific resource.
45836
45837    ]
45838  ]
45839  [
45840    [`trace`
45841    ]
45842    [
45843
45844The TRACE method echoes the received request so that a client can see what (if any) changes or additions have been made by intermediate servers.
45845
45846    ]
45847  ]
45848  [
45849    [`copy`
45850    ]
45851    [
45852
45853
45854    ]
45855  ]
45856  [
45857    [`lock`
45858    ]
45859    [
45860
45861
45862    ]
45863  ]
45864  [
45865    [`mkcol`
45866    ]
45867    [
45868
45869
45870    ]
45871  ]
45872  [
45873    [`move`
45874    ]
45875    [
45876
45877
45878    ]
45879  ]
45880  [
45881    [`propfind`
45882    ]
45883    [
45884
45885
45886    ]
45887  ]
45888  [
45889    [`proppatch`
45890    ]
45891    [
45892
45893
45894    ]
45895  ]
45896  [
45897    [`search`
45898    ]
45899    [
45900
45901
45902    ]
45903  ]
45904  [
45905    [`unlock`
45906    ]
45907    [
45908
45909
45910    ]
45911  ]
45912  [
45913    [`bind`
45914    ]
45915    [
45916
45917
45918    ]
45919  ]
45920  [
45921    [`rebind`
45922    ]
45923    [
45924
45925
45926    ]
45927  ]
45928  [
45929    [`unbind`
45930    ]
45931    [
45932
45933
45934    ]
45935  ]
45936  [
45937    [`acl`
45938    ]
45939    [
45940
45941
45942    ]
45943  ]
45944  [
45945    [`report`
45946    ]
45947    [
45948
45949
45950    ]
45951  ]
45952  [
45953    [`mkactivity`
45954    ]
45955    [
45956
45957
45958    ]
45959  ]
45960  [
45961    [`checkout`
45962    ]
45963    [
45964
45965
45966    ]
45967  ]
45968  [
45969    [`merge`
45970    ]
45971    [
45972
45973
45974    ]
45975  ]
45976  [
45977    [`msearch`
45978    ]
45979    [
45980
45981
45982    ]
45983  ]
45984  [
45985    [`notify`
45986    ]
45987    [
45988
45989
45990    ]
45991  ]
45992  [
45993    [`subscribe`
45994    ]
45995    [
45996
45997
45998    ]
45999  ]
46000  [
46001    [`unsubscribe`
46002    ]
46003    [
46004
46005
46006    ]
46007  ]
46008  [
46009    [`patch`
46010    ]
46011    [
46012
46013
46014    ]
46015  ]
46016  [
46017    [`purge`
46018    ]
46019    [
46020
46021
46022    ]
46023  ]
46024  [
46025    [`mkcalendar`
46026    ]
46027    [
46028
46029
46030    ]
46031  ]
46032  [
46033    [`link`
46034    ]
46035    [
46036
46037
46038    ]
46039  ]
46040  [
46041    [`unlink`
46042    ]
46043    [
46044
46045
46046    ]
46047  ]
46048]
46049[heading Description]
46050Each verb corresponds to a particular method string used in HTTP request messages.
46051
46052
46053[endsect]
46054
46055[section:boost__beast__http__chunk_extensions http::chunk_extensions]
46056[indexterm1 http::chunk_extensions]
46057
46058
46059A set of chunk extensions.
46060[heading Synopsis]
46061Defined in header [include_file boost/beast/http/chunk_encode.hpp]
46062
46063```
46064using chunk_extensions = basic_chunk_extensions< std::allocator< char > >;
46065```
46066
46067[heading Types]
46068[table [[Name][Description]]
46069  [
46070    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.value_type value_type]]
46071    ]
46072    [
46073
46074The type of value when iterating.
46075    ]
46076  ]
46077]
46078[heading Member Functions]
46079[table [[Name][Description]]
46080  [
46081    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.basic_chunk_extensions basic_chunk_extensions]]
46082    ]
46083    [
46084
46085Constructor.
46086    ]
46087  ]
46088  [
46089    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.begin begin]]
46090    ]
46091    [
46092
46093    ]
46094  ]
46095  [
46096    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.clear clear]]
46097    ]
46098    [
46099
46100Clear the chunk extensions.
46101    ]
46102  ]
46103  [
46104    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.end end]]
46105    ]
46106    [
46107
46108    ]
46109  ]
46110  [
46111    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.insert insert]]
46112    ]
46113    [
46114
46115Insert an extension name with an empty value.
46116
46117Insert an extension value.
46118    ]
46119  ]
46120  [
46121    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.parse parse]]
46122    ]
46123    [
46124
46125Parse a set of chunk extensions.
46126    ]
46127  ]
46128  [
46129    [[*[link beast.ref.boost__beast__http__basic_chunk_extensions.str str]]
46130    ]
46131    [
46132
46133Return the serialized representation of the chunk extension.
46134    ]
46135  ]
46136]
46137This container stores a set of chunk extensions suited for use with [link beast.ref.boost__beast__http__chunk_header `chunk_header`] and [link beast.ref.boost__beast__http__chunk_body `chunk_body`]. The container may be iterated to access the extensions in their structured form.
46138Meets the requirements of ChunkExtensions
46139[heading Description]
46140
46141
46142[endsect]
46143
46144[section:boost__beast__http__dynamic_body http::dynamic_body]
46145[indexterm1 http::dynamic_body]
46146
46147
46148A dynamic message body represented by a [link beast.ref.boost__beast__multi_buffer `multi_buffer`].
46149[heading Synopsis]
46150Defined in header [include_file boost/beast/http/dynamic_body.hpp]
46151
46152```
46153using dynamic_body = basic_dynamic_body< multi_buffer >;
46154```
46155
46156[heading Types]
46157[table [[Name][Description]]
46158  [
46159    [[*[link beast.ref.boost__beast__http__basic_dynamic_body.reader reader]]
46160    ]
46161    [
46162
46163The algorithm for parsing the body.
46164    ]
46165  ]
46166  [
46167    [[*[link beast.ref.boost__beast__http__basic_dynamic_body.value_type value_type]]
46168    ]
46169    [
46170
46171The type of container used for the body.
46172    ]
46173  ]
46174  [
46175    [[*[link beast.ref.boost__beast__http__basic_dynamic_body.writer writer]]
46176    ]
46177    [
46178
46179The algorithm for serializing the body.
46180    ]
46181  ]
46182]
46183[heading Static Members]
46184[table [[Name][Description]]
46185  [
46186    [[*[link beast.ref.boost__beast__http__basic_dynamic_body.size size]]
46187    ]
46188    [
46189
46190Returns the payload size of the body.
46191    ]
46192  ]
46193]
46194This body uses a ['DynamicBuffer] as a memory-based container for holding message payloads. Messages using this body type may be serialized and parsed.
46195[heading Description]
46196Meets the requirements of ['Body].
46197
46198
46199[endsect]
46200
46201[section:boost__beast__http__fields http::fields]
46202[indexterm1 http::fields]
46203
46204
46205A typical HTTP header fields container.
46206[heading Synopsis]
46207Defined in header [include_file boost/beast/http/fields.hpp]
46208
46209```
46210using fields = basic_fields< std::allocator< char > >;
46211```
46212
46213[heading Types]
46214[table [[Name][Description]]
46215  [
46216    [[*[link beast.ref.boost__beast__http__basic_fields.allocator_type allocator_type]]
46217    ]
46218    [
46219
46220The type of allocator used.
46221    ]
46222  ]
46223  [
46224    [[*[link beast.ref.boost__beast__http__basic_fields.const_iterator const_iterator]]
46225    ]
46226    [
46227
46228A constant iterator to the field sequence.
46229    ]
46230  ]
46231  [
46232    [[*[link beast.ref.boost__beast__http__basic_fields.iterator iterator]]
46233    ]
46234    [
46235
46236A constant iterator to the field sequence.
46237    ]
46238  ]
46239  [
46240    [[*[link beast.ref.boost__beast__http__basic_fields.key_compare key_compare]]
46241    ]
46242    [
46243
46244A strictly less predicate for comparing keys, using a case-insensitive comparison.
46245    ]
46246  ]
46247  [
46248    [[*[link beast.ref.boost__beast__http__basic_fields__value_type value_type]]
46249    ]
46250    [
46251
46252The type of element used to represent a field.
46253    ]
46254  ]
46255  [
46256    [[*[link beast.ref.boost__beast__http__basic_fields.writer writer]]
46257    ]
46258    [
46259
46260The algorithm used to serialize the header.
46261    ]
46262  ]
46263]
46264[heading Member Functions]
46265[table [[Name][Description]]
46266  [
46267    [[*[link beast.ref.boost__beast__http__basic_fields.at at]]
46268    ]
46269    [
46270
46271Returns the value for a field, or throws an exception.
46272    ]
46273  ]
46274  [
46275    [[*[link beast.ref.boost__beast__http__basic_fields.basic_fields basic_fields]]
46276    ]
46277    [
46278
46279Constructor.
46280
46281Move constructor.
46282
46283Copy constructor.
46284    ]
46285  ]
46286  [
46287    [[*[link beast.ref.boost__beast__http__basic_fields.begin begin]]
46288    ]
46289    [
46290
46291Return a const iterator to the beginning of the field sequence.
46292    ]
46293  ]
46294  [
46295    [[*[link beast.ref.boost__beast__http__basic_fields.cbegin cbegin]]
46296    ]
46297    [
46298
46299Return a const iterator to the beginning of the field sequence.
46300    ]
46301  ]
46302  [
46303    [[*[link beast.ref.boost__beast__http__basic_fields.cend cend]]
46304    ]
46305    [
46306
46307Return a const iterator to the end of the field sequence.
46308    ]
46309  ]
46310  [
46311    [[*[link beast.ref.boost__beast__http__basic_fields.clear clear]]
46312    ]
46313    [
46314
46315Remove all fields from the container.
46316    ]
46317  ]
46318  [
46319    [[*[link beast.ref.boost__beast__http__basic_fields.count count]]
46320    ]
46321    [
46322
46323Return the number of fields with the specified name.
46324    ]
46325  ]
46326  [
46327    [[*[link beast.ref.boost__beast__http__basic_fields.end end]]
46328    ]
46329    [
46330
46331Return a const iterator to the end of the field sequence.
46332    ]
46333  ]
46334  [
46335    [[*[link beast.ref.boost__beast__http__basic_fields.equal_range equal_range]]
46336    ]
46337    [
46338
46339Returns a range of iterators to the fields with the specified name.
46340    ]
46341  ]
46342  [
46343    [[*[link beast.ref.boost__beast__http__basic_fields.erase erase]]
46344    ]
46345    [
46346
46347Remove a field.
46348
46349Remove all fields with the specified name.
46350    ]
46351  ]
46352  [
46353    [[*[link beast.ref.boost__beast__http__basic_fields.find find]]
46354    ]
46355    [
46356
46357Returns an iterator to the case-insensitive matching field.
46358
46359Returns an iterator to the case-insensitive matching field name.
46360    ]
46361  ]
46362  [
46363    [[*[link beast.ref.boost__beast__http__basic_fields.get_allocator get_allocator]]
46364    ]
46365    [
46366
46367Return a copy of the allocator associated with the container.
46368    ]
46369  ]
46370  [
46371    [[*[link beast.ref.boost__beast__http__basic_fields.insert insert]]
46372    ]
46373    [
46374
46375Insert a field.
46376
46377    ]
46378  ]
46379  [
46380    [[*[link beast.ref.boost__beast__http__basic_fields.key_comp key_comp]]
46381    ]
46382    [
46383
46384Returns a copy of the key comparison function.
46385    ]
46386  ]
46387  [
46388    [[*[link beast.ref.boost__beast__http__basic_fields.operator_eq_ operator=]]
46389    ]
46390    [
46391
46392Move assignment.
46393
46394Copy assignment.
46395    ]
46396  ]
46397  [
46398    [[*[link beast.ref.boost__beast__http__basic_fields.operator_lb__rb_ operator\[\]]]
46399    ]
46400    [
46401
46402Returns the value for a field, or `""` if it does not exist.
46403
46404Returns the value for a case-insensitive matching header, or `""` if it does not exist.
46405    ]
46406  ]
46407  [
46408    [[*[link beast.ref.boost__beast__http__basic_fields.set set]]
46409    ]
46410    [
46411
46412Set a field value, removing any other instances of that field.
46413
46414    ]
46415  ]
46416  [
46417    [[*[link beast.ref.boost__beast__http__basic_fields.swap swap]]
46418    ]
46419    [
46420
46421Return a buffer sequence representing the trailers.
46422    ]
46423  ]
46424  [
46425    [[*[link beast.ref.boost__beast__http__basic_fields._basic_fields ~basic_fields]]
46426    ]
46427    [
46428
46429Destructor.
46430    ]
46431  ]
46432]
46433[heading Protected Member Functions]
46434[table [[Name][Description]]
46435  [
46436    [[*[link beast.ref.boost__beast__http__basic_fields.get_chunked_impl get_chunked_impl]]
46437    ]
46438    [
46439
46440Returns the chunked Transfer-Encoding setting.
46441    ]
46442  ]
46443  [
46444    [[*[link beast.ref.boost__beast__http__basic_fields.get_keep_alive_impl get_keep_alive_impl]]
46445    ]
46446    [
46447
46448Returns the keep-alive setting.
46449    ]
46450  ]
46451  [
46452    [[*[link beast.ref.boost__beast__http__basic_fields.get_method_impl get_method_impl]]
46453    ]
46454    [
46455
46456Returns the request-method string.
46457    ]
46458  ]
46459  [
46460    [[*[link beast.ref.boost__beast__http__basic_fields.get_reason_impl get_reason_impl]]
46461    ]
46462    [
46463
46464Returns the response reason-phrase string.
46465    ]
46466  ]
46467  [
46468    [[*[link beast.ref.boost__beast__http__basic_fields.get_target_impl get_target_impl]]
46469    ]
46470    [
46471
46472Returns the request-target string.
46473    ]
46474  ]
46475  [
46476    [[*[link beast.ref.boost__beast__http__basic_fields.has_content_length_impl has_content_length_impl]]
46477    ]
46478    [
46479
46480Returns `true` if the Content-Length field is present.
46481    ]
46482  ]
46483  [
46484    [[*[link beast.ref.boost__beast__http__basic_fields.set_chunked_impl set_chunked_impl]]
46485    ]
46486    [
46487
46488Adjusts the chunked Transfer-Encoding value.
46489    ]
46490  ]
46491  [
46492    [[*[link beast.ref.boost__beast__http__basic_fields.set_content_length_impl set_content_length_impl]]
46493    ]
46494    [
46495
46496Sets or clears the Content-Length field.
46497    ]
46498  ]
46499  [
46500    [[*[link beast.ref.boost__beast__http__basic_fields.set_keep_alive_impl set_keep_alive_impl]]
46501    ]
46502    [
46503
46504Adjusts the Connection field.
46505    ]
46506  ]
46507  [
46508    [[*[link beast.ref.boost__beast__http__basic_fields.set_method_impl set_method_impl]]
46509    ]
46510    [
46511
46512Set or clear the method string.
46513    ]
46514  ]
46515  [
46516    [[*[link beast.ref.boost__beast__http__basic_fields.set_reason_impl set_reason_impl]]
46517    ]
46518    [
46519
46520Set or clear the reason string.
46521    ]
46522  ]
46523  [
46524    [[*[link beast.ref.boost__beast__http__basic_fields.set_target_impl set_target_impl]]
46525    ]
46526    [
46527
46528Set or clear the target string.
46529    ]
46530  ]
46531]
46532[heading Friends]
46533[table [[Name][Description]]
46534  [
46535    [[*[link beast.ref.boost__beast__http__basic_fields.swap swap]]
46536    ]
46537    [
46538
46539Swap two field containers.
46540    ]
46541  ]
46542]
46543This container is designed to store the field value pairs that make up the fields and trailers in an HTTP message. Objects of this type are iterable, with each element holding the field name and field value.
46544Field names are stored as-is, but comparisons are case-insensitive. The container behaves as a `std::multiset`; there will be a separate value for each occurrence of the same field name. When the container is iterated the fields are presented in the order of insertion, with fields having the same name following each other consecutively.
46545Meets the requirements of ['Fields]
46546
46547[heading Template Parameters]
46548[table [[Type][Description]]
46549  [
46550    [`Allocator`
46551    ]
46552    [
46553The allocator to use.
46554    ]
46555  ]
46556]
46557[heading Description]
46558
46559
46560[endsect]
46561
46562[section:boost__beast__http__file_body http::file_body]
46563[indexterm1 http::file_body]
46564
46565
46566A message body represented by a file on the filesystem.
46567[heading Synopsis]
46568Defined in header [include_file boost/beast/http/file_body.hpp]
46569
46570```
46571using file_body = basic_file_body< file >;
46572```
46573
46574[heading Types]
46575[table [[Name][Description]]
46576  [
46577    [[*[link beast.ref.boost__beast__http__basic_file_body.file_type file_type]]
46578    ]
46579    [
46580
46581The type of File this body uses.
46582    ]
46583  ]
46584  [
46585    [[*[link beast.ref.boost__beast__http__basic_file_body__reader reader]]
46586    ]
46587    [
46588
46589Algorithm for storing buffers when parsing.
46590    ]
46591  ]
46592  [
46593    [[*[link beast.ref.boost__beast__http__basic_file_body__value_type value_type]]
46594    ]
46595    [
46596
46597The type of the [link beast.ref.boost__beast__http__message.body `message::body`] member.
46598    ]
46599  ]
46600  [
46601    [[*[link beast.ref.boost__beast__http__basic_file_body__writer writer]]
46602    ]
46603    [
46604
46605Algorithm for retrieving buffers when serializing.
46606    ]
46607  ]
46608]
46609[heading Static Members]
46610[table [[Name][Description]]
46611  [
46612    [[*[link beast.ref.boost__beast__http__basic_file_body.size size]]
46613    ]
46614    [
46615
46616Returns the size of the body.
46617    ]
46618  ]
46619]
46620Messages with this type have bodies represented by a file on the file system. When parsing a message using this body type, the data is stored in the file pointed to by the path, which must be writable. When serializing, the implementation will read the file and present those octets as the body content. This may be used to serve content from a directory as part of a web service.
46621
46622[heading Template Parameters]
46623[table [[Type][Description]]
46624  [
46625    [`File`
46626    ]
46627    [
46628The implementation to use for accessing files. This type must meet the requirements of ['File].
46629    ]
46630  ]
46631]
46632[heading Types]
46633[table [[Name][Description]]
46634  [
46635    [[*[link beast.ref.boost__beast__file.native_handle_type native_handle_type]]
46636    ]
46637    [
46638
46639The type of the underlying file handle.
46640    ]
46641  ]
46642]
46643[heading Member Functions]
46644[table [[Name][Description]]
46645  [
46646    [[*[link beast.ref.boost__beast__file.close close]]
46647    ]
46648    [
46649
46650Close the file if open.
46651    ]
46652  ]
46653  [
46654    [[*[link beast.ref.boost__beast__file.is_open is_open]]
46655    ]
46656    [
46657
46658Returns `true` if the file is open.
46659    ]
46660  ]
46661  [
46662    [[*[link beast.ref.boost__beast__file.native_handle native_handle]]
46663    ]
46664    [
46665
46666Returns the native handle associated with the file.
46667
46668Set the native handle associated with the file.
46669    ]
46670  ]
46671  [
46672    [[*[link beast.ref.boost__beast__file.open open]]
46673    ]
46674    [
46675
46676Open a file at the given path with the specified mode.
46677    ]
46678  ]
46679  [
46680    [[*[link beast.ref.boost__beast__file.pos pos]]
46681    ]
46682    [
46683
46684Return the current position in the open file.
46685    ]
46686  ]
46687  [
46688    [[*[link beast.ref.boost__beast__file.read read]]
46689    ]
46690    [
46691
46692Read from the open file.
46693    ]
46694  ]
46695  [
46696    [[*[link beast.ref.boost__beast__file.seek seek]]
46697    ]
46698    [
46699
46700Adjust the current position in the open file.
46701    ]
46702  ]
46703  [
46704    [[*[link beast.ref.boost__beast__file.size size]]
46705    ]
46706    [
46707
46708Return the size of the open file.
46709    ]
46710  ]
46711  [
46712    [[*[link beast.ref.boost__beast__file.write write]]
46713    ]
46714    [
46715
46716Write to the open file.
46717    ]
46718  ]
46719]
46720This alias is set to the best available implementation of ['File] given the platform and build settings.
46721[heading Description]
46722
46723
46724[endsect]
46725
46726[section:boost__beast__http__request_header http::request_header]
46727[indexterm1 http::request_header]
46728
46729
46730A typical HTTP request header.
46731[heading Synopsis]
46732Defined in header [include_file boost/beast/http/message.hpp]
46733
46734```
46735template<
46736    class __Fields__ = fields>
46737using request_header = header< true, Fields >;
46738```
46739
46740[heading Types]
46741[table [[Name][Description]]
46742  [
46743    [[*[link beast.ref.boost__beast__http__header.fields_type fields_type]]
46744    ]
46745    [
46746
46747The type representing the fields.
46748    ]
46749  ]
46750  [
46751    [[*[link beast.ref.boost__beast__http__header.is_request is_request]]
46752    ]
46753    [
46754
46755Indicates if the header is a request or response.
46756    ]
46757  ]
46758]
46759[heading Member Functions]
46760[table [[Name][Description]]
46761  [
46762    [[*[link beast.ref.boost__beast__http__header.header header]]
46763    ]
46764    [
46765
46766Constructor.
46767    ]
46768  ]
46769  [
46770    [[*[link beast.ref.boost__beast__http__header.method method]]
46771    ]
46772    [
46773
46774Return the request-method verb.
46775
46776Set the request-method.
46777    ]
46778  ]
46779  [
46780    [[*[link beast.ref.boost__beast__http__header.method_string method_string]]
46781    ]
46782    [
46783
46784Return the request-method as a string.
46785
46786Set the request-method.
46787    ]
46788  ]
46789  [
46790    [[*[link beast.ref.boost__beast__http__header.operator_eq_ operator=]]
46791    ]
46792    [
46793
46794Assignment.
46795    ]
46796  ]
46797  [
46798    [[*[link beast.ref.boost__beast__http__header.reason reason]]
46799    ]
46800    [
46801
46802Return the response reason-phrase.
46803
46804Set the response reason-phrase (deprecated)
46805    ]
46806  ]
46807  [
46808    [[*[link beast.ref.boost__beast__http__header.result result]]
46809    ]
46810    [
46811
46812The response status-code result.
46813
46814Set the response status-code.
46815
46816Set the response status-code as an integer.
46817    ]
46818  ]
46819  [
46820    [[*[link beast.ref.boost__beast__http__header.result_int result_int]]
46821    ]
46822    [
46823
46824The response status-code expressed as an integer.
46825    ]
46826  ]
46827  [
46828    [[*[link beast.ref.boost__beast__http__header.target target]]
46829    ]
46830    [
46831
46832Returns the request-target string.
46833
46834Set the request-target string.
46835    ]
46836  ]
46837  [
46838    [[*[link beast.ref.boost__beast__http__header.version version]]
46839    ]
46840    [
46841
46842Return the HTTP-version.
46843
46844Set the HTTP-version.
46845    ]
46846  ]
46847]
46848This container is derived from the `Fields` template type. To understand all of the members of this class it is necessary to view the declaration for the `Fields` type. When using the default fields container, those declarations are in [link beast.ref.boost__beast__http__fields `fields`].
46849Newly constructed header objects have version set to HTTP/1.1. Newly constructed response objects also have result code set to [link beast.ref.boost__beast__http__status `status::ok`].
46850A `header` includes the start-line and header-fields.
46851[heading Description]
46852
46853
46854[endsect]
46855
46856[section:boost__beast__http__response_header http::response_header]
46857[indexterm1 http::response_header]
46858
46859
46860A typical HTTP response header.
46861[heading Synopsis]
46862Defined in header [include_file boost/beast/http/message.hpp]
46863
46864```
46865template<
46866    class __Fields__ = fields>
46867using response_header = header< false, Fields >;
46868```
46869
46870[heading Types]
46871[table [[Name][Description]]
46872  [
46873    [[*[link beast.ref.boost__beast__http__header.fields_type fields_type]]
46874    ]
46875    [
46876
46877The type representing the fields.
46878    ]
46879  ]
46880  [
46881    [[*[link beast.ref.boost__beast__http__header.is_request is_request]]
46882    ]
46883    [
46884
46885Indicates if the header is a request or response.
46886    ]
46887  ]
46888]
46889[heading Member Functions]
46890[table [[Name][Description]]
46891  [
46892    [[*[link beast.ref.boost__beast__http__header.header header]]
46893    ]
46894    [
46895
46896Constructor.
46897    ]
46898  ]
46899  [
46900    [[*[link beast.ref.boost__beast__http__header.method method]]
46901    ]
46902    [
46903
46904Return the request-method verb.
46905
46906Set the request-method.
46907    ]
46908  ]
46909  [
46910    [[*[link beast.ref.boost__beast__http__header.method_string method_string]]
46911    ]
46912    [
46913
46914Return the request-method as a string.
46915
46916Set the request-method.
46917    ]
46918  ]
46919  [
46920    [[*[link beast.ref.boost__beast__http__header.operator_eq_ operator=]]
46921    ]
46922    [
46923
46924Assignment.
46925    ]
46926  ]
46927  [
46928    [[*[link beast.ref.boost__beast__http__header.reason reason]]
46929    ]
46930    [
46931
46932Return the response reason-phrase.
46933
46934Set the response reason-phrase (deprecated)
46935    ]
46936  ]
46937  [
46938    [[*[link beast.ref.boost__beast__http__header.result result]]
46939    ]
46940    [
46941
46942The response status-code result.
46943
46944Set the response status-code.
46945
46946Set the response status-code as an integer.
46947    ]
46948  ]
46949  [
46950    [[*[link beast.ref.boost__beast__http__header.result_int result_int]]
46951    ]
46952    [
46953
46954The response status-code expressed as an integer.
46955    ]
46956  ]
46957  [
46958    [[*[link beast.ref.boost__beast__http__header.target target]]
46959    ]
46960    [
46961
46962Returns the request-target string.
46963
46964Set the request-target string.
46965    ]
46966  ]
46967  [
46968    [[*[link beast.ref.boost__beast__http__header.version version]]
46969    ]
46970    [
46971
46972Return the HTTP-version.
46973
46974Set the HTTP-version.
46975    ]
46976  ]
46977]
46978This container is derived from the `Fields` template type. To understand all of the members of this class it is necessary to view the declaration for the `Fields` type. When using the default fields container, those declarations are in [link beast.ref.boost__beast__http__fields `fields`].
46979Newly constructed header objects have version set to HTTP/1.1. Newly constructed response objects also have result code set to [link beast.ref.boost__beast__http__status `status::ok`].
46980A `header` includes the start-line and header-fields.
46981[heading Description]
46982
46983
46984[endsect]
46985
46986[section:boost__beast__http__request http::request]
46987[indexterm1 http::request]
46988
46989
46990A typical HTTP request.
46991[heading Synopsis]
46992Defined in header [include_file boost/beast/http/message.hpp]
46993
46994```
46995template<
46996    class __Body__,
46997    class __Fields__ = fields>
46998using request = message< true, Body, Fields >;
46999```
47000
47001[heading Types]
47002[table [[Name][Description]]
47003  [
47004    [[*[link beast.ref.boost__beast__http__message.body_type body_type]]
47005    ]
47006    [
47007
47008The type providing the body traits.
47009    ]
47010  ]
47011  [
47012    [[*[link beast.ref.boost__beast__http__message.fields_type fields_type]]
47013    ]
47014    [
47015
47016The type representing the fields.
47017    ]
47018  ]
47019  [
47020    [[*[link beast.ref.boost__beast__http__message.header_type header_type]]
47021    ]
47022    [
47023
47024The base class used to hold the header portion of the message.
47025    ]
47026  ]
47027  [
47028    [[*[link beast.ref.boost__beast__http__message.is_request is_request]]
47029    ]
47030    [
47031
47032Indicates if the header is a request or response.
47033    ]
47034  ]
47035]
47036[heading Member Functions]
47037[table [[Name][Description]]
47038  [
47039    [[*[link beast.ref.boost__beast__http__message.base base]]
47040    ]
47041    [
47042
47043Returns the header portion of the message.
47044    ]
47045  ]
47046  [
47047    [[*[link beast.ref.boost__beast__http__message.body body]]
47048    ]
47049    [
47050
47051Returns the body.
47052    ]
47053  ]
47054  [
47055    [[*[link beast.ref.boost__beast__http__message.chunked chunked]]
47056    ]
47057    [
47058
47059Returns `true` if the chunked Transfer-Encoding is specified.
47060
47061Set or clear the chunked Transfer-Encoding.
47062    ]
47063  ]
47064  [
47065    [[*[link beast.ref.boost__beast__http__message.content_length content_length]]
47066    ]
47067    [
47068
47069Set or clear the Content-Length field.
47070    ]
47071  ]
47072  [
47073    [[*[link beast.ref.boost__beast__http__message.has_content_length has_content_length]]
47074    ]
47075    [
47076
47077Returns `true` if the Content-Length field is present.
47078    ]
47079  ]
47080  [
47081    [[*[link beast.ref.boost__beast__http__message.keep_alive keep_alive]]
47082    ]
47083    [
47084
47085Returns `true` if the message semantics indicate keep-alive.
47086
47087Set the keep-alive message semantic option.
47088    ]
47089  ]
47090  [
47091    [[*[link beast.ref.boost__beast__http__message.message message]]
47092    ]
47093    [
47094
47095Constructor.
47096
47097Construct a message.
47098    ]
47099  ]
47100  [
47101    [[*[link beast.ref.boost__beast__http__message.method method]]
47102    ]
47103    [
47104
47105Return the request-method verb.
47106
47107Set the request-method.
47108    ]
47109  ]
47110  [
47111    [[*[link beast.ref.boost__beast__http__message.method_string method_string]]
47112    ]
47113    [
47114
47115Return the request-method as a string.
47116
47117Set the request-method.
47118    ]
47119  ]
47120  [
47121    [[*[link beast.ref.boost__beast__http__message.need_eof need_eof]]
47122    ]
47123    [
47124
47125Returns `true` if the message semantics require an end of file.
47126    ]
47127  ]
47128  [
47129    [[*[link beast.ref.boost__beast__http__message.operator_eq_ operator=]]
47130    ]
47131    [
47132
47133Assignment.
47134    ]
47135  ]
47136  [
47137    [[*[link beast.ref.boost__beast__http__message.payload_size payload_size]]
47138    ]
47139    [
47140
47141Returns the payload size of the body in octets if possible.
47142    ]
47143  ]
47144  [
47145    [[*[link beast.ref.boost__beast__http__message.prepare_payload prepare_payload]]
47146    ]
47147    [
47148
47149Prepare the message payload fields for the body.
47150    ]
47151  ]
47152  [
47153    [[*[link beast.ref.boost__beast__http__message.reason reason]]
47154    ]
47155    [
47156
47157Return the response reason-phrase.
47158
47159Set the response reason-phrase (deprecated)
47160    ]
47161  ]
47162  [
47163    [[*[link beast.ref.boost__beast__http__message.result result]]
47164    ]
47165    [
47166
47167The response status-code result.
47168
47169Set the response status-code.
47170
47171Set the response status-code as an integer.
47172    ]
47173  ]
47174  [
47175    [[*[link beast.ref.boost__beast__http__message.result_int result_int]]
47176    ]
47177    [
47178
47179The response status-code expressed as an integer.
47180    ]
47181  ]
47182  [
47183    [[*[link beast.ref.boost__beast__http__message.target target]]
47184    ]
47185    [
47186
47187Returns the request-target string.
47188
47189Set the request-target string.
47190    ]
47191  ]
47192  [
47193    [[*[link beast.ref.boost__beast__http__message.version version]]
47194    ]
47195    [
47196
47197Return the HTTP-version.
47198
47199Set the HTTP-version.
47200    ]
47201  ]
47202]
47203This container is derived from the `Fields` template type. To understand all of the members of this class it is necessary to view the declaration for the `Fields` type. When using the default fields container, those declarations are in [link beast.ref.boost__beast__http__fields `fields`].
47204A message can be a request or response, depending on the `isRequest` template argument value. Requests and responses have different types; functions may be overloaded based on the type if desired.
47205The `Body` template argument type determines the model used to read or write the content body of the message.
47206Newly constructed messages objects have version set to HTTP/1.1. Newly constructed response objects also have result code set to [link beast.ref.boost__beast__http__status `status::ok`].
47207
47208[heading Template Parameters]
47209[table [[Type][Description]]
47210  [
47211    [`isRequest`
47212    ]
47213    [
47214`true` if this represents a request, or `false` if this represents a response. Some class data members are conditionally present depending on this value.
47215    ]
47216  ]
47217  [
47218    [`Body`
47219    ]
47220    [
47221A type meeting the requirements of Body.
47222    ]
47223  ]
47224  [
47225    [`Fields`
47226    ]
47227    [
47228The type of container used to hold the field value pairs.
47229    ]
47230  ]
47231]
47232[heading Description]
47233
47234
47235[endsect]
47236
47237[section:boost__beast__http__response http::response]
47238[indexterm1 http::response]
47239
47240
47241A typical HTTP response.
47242[heading Synopsis]
47243Defined in header [include_file boost/beast/http/message.hpp]
47244
47245```
47246template<
47247    class __Body__,
47248    class __Fields__ = fields>
47249using response = message< false, Body, Fields >;
47250```
47251
47252[heading Types]
47253[table [[Name][Description]]
47254  [
47255    [[*[link beast.ref.boost__beast__http__message.body_type body_type]]
47256    ]
47257    [
47258
47259The type providing the body traits.
47260    ]
47261  ]
47262  [
47263    [[*[link beast.ref.boost__beast__http__message.fields_type fields_type]]
47264    ]
47265    [
47266
47267The type representing the fields.
47268    ]
47269  ]
47270  [
47271    [[*[link beast.ref.boost__beast__http__message.header_type header_type]]
47272    ]
47273    [
47274
47275The base class used to hold the header portion of the message.
47276    ]
47277  ]
47278  [
47279    [[*[link beast.ref.boost__beast__http__message.is_request is_request]]
47280    ]
47281    [
47282
47283Indicates if the header is a request or response.
47284    ]
47285  ]
47286]
47287[heading Member Functions]
47288[table [[Name][Description]]
47289  [
47290    [[*[link beast.ref.boost__beast__http__message.base base]]
47291    ]
47292    [
47293
47294Returns the header portion of the message.
47295    ]
47296  ]
47297  [
47298    [[*[link beast.ref.boost__beast__http__message.body body]]
47299    ]
47300    [
47301
47302Returns the body.
47303    ]
47304  ]
47305  [
47306    [[*[link beast.ref.boost__beast__http__message.chunked chunked]]
47307    ]
47308    [
47309
47310Returns `true` if the chunked Transfer-Encoding is specified.
47311
47312Set or clear the chunked Transfer-Encoding.
47313    ]
47314  ]
47315  [
47316    [[*[link beast.ref.boost__beast__http__message.content_length content_length]]
47317    ]
47318    [
47319
47320Set or clear the Content-Length field.
47321    ]
47322  ]
47323  [
47324    [[*[link beast.ref.boost__beast__http__message.has_content_length has_content_length]]
47325    ]
47326    [
47327
47328Returns `true` if the Content-Length field is present.
47329    ]
47330  ]
47331  [
47332    [[*[link beast.ref.boost__beast__http__message.keep_alive keep_alive]]
47333    ]
47334    [
47335
47336Returns `true` if the message semantics indicate keep-alive.
47337
47338Set the keep-alive message semantic option.
47339    ]
47340  ]
47341  [
47342    [[*[link beast.ref.boost__beast__http__message.message message]]
47343    ]
47344    [
47345
47346Constructor.
47347
47348Construct a message.
47349    ]
47350  ]
47351  [
47352    [[*[link beast.ref.boost__beast__http__message.method method]]
47353    ]
47354    [
47355
47356Return the request-method verb.
47357
47358Set the request-method.
47359    ]
47360  ]
47361  [
47362    [[*[link beast.ref.boost__beast__http__message.method_string method_string]]
47363    ]
47364    [
47365
47366Return the request-method as a string.
47367
47368Set the request-method.
47369    ]
47370  ]
47371  [
47372    [[*[link beast.ref.boost__beast__http__message.need_eof need_eof]]
47373    ]
47374    [
47375
47376Returns `true` if the message semantics require an end of file.
47377    ]
47378  ]
47379  [
47380    [[*[link beast.ref.boost__beast__http__message.operator_eq_ operator=]]
47381    ]
47382    [
47383
47384Assignment.
47385    ]
47386  ]
47387  [
47388    [[*[link beast.ref.boost__beast__http__message.payload_size payload_size]]
47389    ]
47390    [
47391
47392Returns the payload size of the body in octets if possible.
47393    ]
47394  ]
47395  [
47396    [[*[link beast.ref.boost__beast__http__message.prepare_payload prepare_payload]]
47397    ]
47398    [
47399
47400Prepare the message payload fields for the body.
47401    ]
47402  ]
47403  [
47404    [[*[link beast.ref.boost__beast__http__message.reason reason]]
47405    ]
47406    [
47407
47408Return the response reason-phrase.
47409
47410Set the response reason-phrase (deprecated)
47411    ]
47412  ]
47413  [
47414    [[*[link beast.ref.boost__beast__http__message.result result]]
47415    ]
47416    [
47417
47418The response status-code result.
47419
47420Set the response status-code.
47421
47422Set the response status-code as an integer.
47423    ]
47424  ]
47425  [
47426    [[*[link beast.ref.boost__beast__http__message.result_int result_int]]
47427    ]
47428    [
47429
47430The response status-code expressed as an integer.
47431    ]
47432  ]
47433  [
47434    [[*[link beast.ref.boost__beast__http__message.target target]]
47435    ]
47436    [
47437
47438Returns the request-target string.
47439
47440Set the request-target string.
47441    ]
47442  ]
47443  [
47444    [[*[link beast.ref.boost__beast__http__message.version version]]
47445    ]
47446    [
47447
47448Return the HTTP-version.
47449
47450Set the HTTP-version.
47451    ]
47452  ]
47453]
47454This container is derived from the `Fields` template type. To understand all of the members of this class it is necessary to view the declaration for the `Fields` type. When using the default fields container, those declarations are in [link beast.ref.boost__beast__http__fields `fields`].
47455A message can be a request or response, depending on the `isRequest` template argument value. Requests and responses have different types; functions may be overloaded based on the type if desired.
47456The `Body` template argument type determines the model used to read or write the content body of the message.
47457Newly constructed messages objects have version set to HTTP/1.1. Newly constructed response objects also have result code set to [link beast.ref.boost__beast__http__status `status::ok`].
47458
47459[heading Template Parameters]
47460[table [[Type][Description]]
47461  [
47462    [`isRequest`
47463    ]
47464    [
47465`true` if this represents a request, or `false` if this represents a response. Some class data members are conditionally present depending on this value.
47466    ]
47467  ]
47468  [
47469    [`Body`
47470    ]
47471    [
47472A type meeting the requirements of Body.
47473    ]
47474  ]
47475  [
47476    [`Fields`
47477    ]
47478    [
47479The type of container used to hold the field value pairs.
47480    ]
47481  ]
47482]
47483[heading Description]
47484
47485
47486[endsect]
47487
47488[section:boost__beast__http__request_parser http::request_parser]
47489[indexterm1 http::request_parser]
47490
47491
47492An HTTP/1 parser for producing a request message.
47493[heading Synopsis]
47494Defined in header [include_file boost/beast/http/parser.hpp]
47495
47496```
47497template<
47498    class __Body__,
47499    class __Allocator__ = std::allocator<char>>
47500using request_parser = parser< true, Body, Allocator >;
47501```
47502
47503[heading Types]
47504[table [[Name][Description]]
47505  [
47506    [[*[link beast.ref.boost__beast__http__parser.is_request is_request]]
47507    ]
47508    [
47509
47510`true` if this parser parses requests, `false` for responses.
47511    ]
47512  ]
47513  [
47514    [[*[link beast.ref.boost__beast__http__parser.value_type value_type]]
47515    ]
47516    [
47517
47518The type of message returned by the parser.
47519    ]
47520  ]
47521]
47522[heading Member Functions]
47523[table [[Name][Description]]
47524  [
47525    [[*[link beast.ref.boost__beast__http__parser.body_limit body_limit]]
47526    ]
47527    [
47528
47529Set the limit on the payload body.
47530    ]
47531  ]
47532  [
47533    [[*[link beast.ref.boost__beast__http__parser.chunked chunked]]
47534    ]
47535    [
47536
47537Returns `true` if the last value for Transfer-Encoding is "chunked".
47538    ]
47539  ]
47540  [
47541    [[*[link beast.ref.boost__beast__http__parser.content_length content_length]]
47542    ]
47543    [
47544
47545Returns the optional value of Content-Length if known.
47546    ]
47547  ]
47548  [
47549    [[*[link beast.ref.boost__beast__http__parser.content_length_remaining content_length_remaining]]
47550    ]
47551    [
47552
47553Returns the remaining content length if known.
47554    ]
47555  ]
47556  [
47557    [[*[link beast.ref.boost__beast__http__parser.eager eager]]
47558    ]
47559    [
47560
47561Returns `true` if the eager parse option is set.
47562
47563Set the eager parse option.
47564    ]
47565  ]
47566  [
47567    [[*[link beast.ref.boost__beast__http__parser.get get]]
47568    ]
47569    [
47570
47571Returns the parsed message.
47572    ]
47573  ]
47574  [
47575    [[*[link beast.ref.boost__beast__http__parser.got_some got_some]]
47576    ]
47577    [
47578
47579Returns `true` if the parser has received at least one byte of input.
47580    ]
47581  ]
47582  [
47583    [[*[link beast.ref.boost__beast__http__parser.header_limit header_limit]]
47584    ]
47585    [
47586
47587Set a limit on the total size of the header.
47588    ]
47589  ]
47590  [
47591    [[*[link beast.ref.boost__beast__http__parser.is_done is_done]]
47592    ]
47593    [
47594
47595Returns `true` if the message is complete.
47596    ]
47597  ]
47598  [
47599    [[*[link beast.ref.boost__beast__http__parser.is_header_done is_header_done]]
47600    ]
47601    [
47602
47603Returns `true` if a the parser has produced the full header.
47604    ]
47605  ]
47606  [
47607    [[*[link beast.ref.boost__beast__http__parser.keep_alive keep_alive]]
47608    ]
47609    [
47610
47611Returns `true` if the message has keep-alive connection semantics.
47612    ]
47613  ]
47614  [
47615    [[*[link beast.ref.boost__beast__http__parser.need_eof need_eof]]
47616    ]
47617    [
47618
47619Returns `true` if the message semantics require an end of file.
47620    ]
47621  ]
47622  [
47623    [[*[link beast.ref.boost__beast__http__parser.on_chunk_body on_chunk_body]]
47624    ]
47625    [
47626
47627Set a callback to be invoked on chunk body data.
47628    ]
47629  ]
47630  [
47631    [[*[link beast.ref.boost__beast__http__parser.on_chunk_header on_chunk_header]]
47632    ]
47633    [
47634
47635Set a callback to be invoked on each chunk header.
47636    ]
47637  ]
47638  [
47639    [[*[link beast.ref.boost__beast__http__parser.operator_eq_ operator=]]
47640    ]
47641    [
47642
47643Assignment (disallowed)
47644    ]
47645  ]
47646  [
47647    [[*[link beast.ref.boost__beast__http__parser.parser parser]]
47648    ]
47649    [
47650
47651Constructor (disallowed)
47652
47653Constructor.
47654
47655Construct a parser from another parser, changing the Body type.
47656    ]
47657  ]
47658  [
47659    [[*[link beast.ref.boost__beast__http__parser.put put]]
47660    ]
47661    [
47662
47663Write a buffer sequence to the parser.
47664    ]
47665  ]
47666  [
47667    [[*[link beast.ref.boost__beast__http__parser.put_eof put_eof]]
47668    ]
47669    [
47670
47671Inform the parser that the end of stream was reached.
47672    ]
47673  ]
47674  [
47675    [[*[link beast.ref.boost__beast__http__parser.release release]]
47676    ]
47677    [
47678
47679Returns ownership of the parsed message.
47680    ]
47681  ]
47682  [
47683    [[*[link beast.ref.boost__beast__http__parser.skip skip]]
47684    ]
47685    [
47686
47687Returns `true` if the skip parse option is set.
47688
47689Set the skip parse option.
47690    ]
47691  ]
47692  [
47693    [[*[link beast.ref.boost__beast__http__parser.upgrade upgrade]]
47694    ]
47695    [
47696
47697Returns `true` if the message is an upgrade message.
47698    ]
47699  ]
47700  [
47701    [[*[link beast.ref.boost__beast__http__parser._parser ~parser]]
47702    ]
47703    [
47704
47705Destructor.
47706    ]
47707  ]
47708]
47709This class uses the basic HTTP/1 wire format parser to convert a series of octets into a [link beast.ref.boost__beast__http__message `message`] using the [link beast.ref.boost__beast__http__basic_fields `basic_fields`] container to represent the fields.
47710
47711[heading Template Parameters]
47712[table [[Type][Description]]
47713  [
47714    [`isRequest`
47715    ]
47716    [
47717Indicates whether a request or response will be parsed.
47718    ]
47719  ]
47720  [
47721    [`Body`
47722    ]
47723    [
47724The type used to represent the body. This must meet the requirements of ['Body].
47725    ]
47726  ]
47727  [
47728    [`Allocator`
47729    ]
47730    [
47731The type of allocator used with the [link beast.ref.boost__beast__http__basic_fields `basic_fields`] container.
47732    ]
47733  ]
47734]
47735[heading Remarks]
47736A new instance of the parser is required for each message.
47737[heading Description]
47738
47739
47740[endsect]
47741
47742[section:boost__beast__http__response_parser http::response_parser]
47743[indexterm1 http::response_parser]
47744
47745
47746An HTTP/1 parser for producing a response message.
47747[heading Synopsis]
47748Defined in header [include_file boost/beast/http/parser.hpp]
47749
47750```
47751template<
47752    class __Body__,
47753    class __Allocator__ = std::allocator<char>>
47754using response_parser = parser< false, Body, Allocator >;
47755```
47756
47757[heading Types]
47758[table [[Name][Description]]
47759  [
47760    [[*[link beast.ref.boost__beast__http__parser.is_request is_request]]
47761    ]
47762    [
47763
47764`true` if this parser parses requests, `false` for responses.
47765    ]
47766  ]
47767  [
47768    [[*[link beast.ref.boost__beast__http__parser.value_type value_type]]
47769    ]
47770    [
47771
47772The type of message returned by the parser.
47773    ]
47774  ]
47775]
47776[heading Member Functions]
47777[table [[Name][Description]]
47778  [
47779    [[*[link beast.ref.boost__beast__http__parser.body_limit body_limit]]
47780    ]
47781    [
47782
47783Set the limit on the payload body.
47784    ]
47785  ]
47786  [
47787    [[*[link beast.ref.boost__beast__http__parser.chunked chunked]]
47788    ]
47789    [
47790
47791Returns `true` if the last value for Transfer-Encoding is "chunked".
47792    ]
47793  ]
47794  [
47795    [[*[link beast.ref.boost__beast__http__parser.content_length content_length]]
47796    ]
47797    [
47798
47799Returns the optional value of Content-Length if known.
47800    ]
47801  ]
47802  [
47803    [[*[link beast.ref.boost__beast__http__parser.content_length_remaining content_length_remaining]]
47804    ]
47805    [
47806
47807Returns the remaining content length if known.
47808    ]
47809  ]
47810  [
47811    [[*[link beast.ref.boost__beast__http__parser.eager eager]]
47812    ]
47813    [
47814
47815Returns `true` if the eager parse option is set.
47816
47817Set the eager parse option.
47818    ]
47819  ]
47820  [
47821    [[*[link beast.ref.boost__beast__http__parser.get get]]
47822    ]
47823    [
47824
47825Returns the parsed message.
47826    ]
47827  ]
47828  [
47829    [[*[link beast.ref.boost__beast__http__parser.got_some got_some]]
47830    ]
47831    [
47832
47833Returns `true` if the parser has received at least one byte of input.
47834    ]
47835  ]
47836  [
47837    [[*[link beast.ref.boost__beast__http__parser.header_limit header_limit]]
47838    ]
47839    [
47840
47841Set a limit on the total size of the header.
47842    ]
47843  ]
47844  [
47845    [[*[link beast.ref.boost__beast__http__parser.is_done is_done]]
47846    ]
47847    [
47848
47849Returns `true` if the message is complete.
47850    ]
47851  ]
47852  [
47853    [[*[link beast.ref.boost__beast__http__parser.is_header_done is_header_done]]
47854    ]
47855    [
47856
47857Returns `true` if a the parser has produced the full header.
47858    ]
47859  ]
47860  [
47861    [[*[link beast.ref.boost__beast__http__parser.keep_alive keep_alive]]
47862    ]
47863    [
47864
47865Returns `true` if the message has keep-alive connection semantics.
47866    ]
47867  ]
47868  [
47869    [[*[link beast.ref.boost__beast__http__parser.need_eof need_eof]]
47870    ]
47871    [
47872
47873Returns `true` if the message semantics require an end of file.
47874    ]
47875  ]
47876  [
47877    [[*[link beast.ref.boost__beast__http__parser.on_chunk_body on_chunk_body]]
47878    ]
47879    [
47880
47881Set a callback to be invoked on chunk body data.
47882    ]
47883  ]
47884  [
47885    [[*[link beast.ref.boost__beast__http__parser.on_chunk_header on_chunk_header]]
47886    ]
47887    [
47888
47889Set a callback to be invoked on each chunk header.
47890    ]
47891  ]
47892  [
47893    [[*[link beast.ref.boost__beast__http__parser.operator_eq_ operator=]]
47894    ]
47895    [
47896
47897Assignment (disallowed)
47898    ]
47899  ]
47900  [
47901    [[*[link beast.ref.boost__beast__http__parser.parser parser]]
47902    ]
47903    [
47904
47905Constructor (disallowed)
47906
47907Constructor.
47908
47909Construct a parser from another parser, changing the Body type.
47910    ]
47911  ]
47912  [
47913    [[*[link beast.ref.boost__beast__http__parser.put put]]
47914    ]
47915    [
47916
47917Write a buffer sequence to the parser.
47918    ]
47919  ]
47920  [
47921    [[*[link beast.ref.boost__beast__http__parser.put_eof put_eof]]
47922    ]
47923    [
47924
47925Inform the parser that the end of stream was reached.
47926    ]
47927  ]
47928  [
47929    [[*[link beast.ref.boost__beast__http__parser.release release]]
47930    ]
47931    [
47932
47933Returns ownership of the parsed message.
47934    ]
47935  ]
47936  [
47937    [[*[link beast.ref.boost__beast__http__parser.skip skip]]
47938    ]
47939    [
47940
47941Returns `true` if the skip parse option is set.
47942
47943Set the skip parse option.
47944    ]
47945  ]
47946  [
47947    [[*[link beast.ref.boost__beast__http__parser.upgrade upgrade]]
47948    ]
47949    [
47950
47951Returns `true` if the message is an upgrade message.
47952    ]
47953  ]
47954  [
47955    [[*[link beast.ref.boost__beast__http__parser._parser ~parser]]
47956    ]
47957    [
47958
47959Destructor.
47960    ]
47961  ]
47962]
47963This class uses the basic HTTP/1 wire format parser to convert a series of octets into a [link beast.ref.boost__beast__http__message `message`] using the [link beast.ref.boost__beast__http__basic_fields `basic_fields`] container to represent the fields.
47964
47965[heading Template Parameters]
47966[table [[Type][Description]]
47967  [
47968    [`isRequest`
47969    ]
47970    [
47971Indicates whether a request or response will be parsed.
47972    ]
47973  ]
47974  [
47975    [`Body`
47976    ]
47977    [
47978The type used to represent the body. This must meet the requirements of ['Body].
47979    ]
47980  ]
47981  [
47982    [`Allocator`
47983    ]
47984    [
47985The type of allocator used with the [link beast.ref.boost__beast__http__basic_fields `basic_fields`] container.
47986    ]
47987  ]
47988]
47989[heading Remarks]
47990A new instance of the parser is required for each message.
47991[heading Description]
47992
47993
47994[endsect]
47995
47996[section:boost__beast__http__opt_token_list http::opt_token_list]
47997[indexterm1 http::opt_token_list]
47998
47999
48000A list of tokens in a comma separated HTTP field value.
48001[heading Synopsis]
48002Defined in header [include_file boost/beast/http/rfc7230.hpp]
48003
48004```
48005using opt_token_list = detail::basic_parsed_list< detail::opt_token_list_policy >;
48006```
48007
48008[heading Description]
48009This container allows iteration of a list of items in a header field value. The input is a comma separated list of tokens.
48010If a parsing error is encountered while iterating the string, the behavior of the container will be as if a string containing only characters up to but excluding the first invalid character was used to construct the list.
48011
48012[heading BNF]
48013
48014```
48015token-list  = *( "," OWS ) token *( OWS "," [ OWS token ] )
48016```
48017
48018To use this class, construct with the string to be parsed and then use `begin` and `end`, or range-for to iterate each item:
48019
48020[heading Example]
48021
48022```
48023for(auto const& token : token_list{"apple, pear, banana"})
48024    std::cout << token << "\n";
48025```
48026
48027
48028
48029[endsect]
48030
48031[section:boost__beast__http__request_serializer http::request_serializer]
48032[indexterm1 http::request_serializer]
48033
48034
48035A serializer for HTTP/1 requests.
48036[heading Synopsis]
48037Defined in header [include_file boost/beast/http/serializer.hpp]
48038
48039```
48040template<
48041    class __Body__,
48042    class __Fields__ = fields>
48043using request_serializer = serializer< true, Body, Fields >;
48044```
48045
48046[heading Types]
48047[table [[Name][Description]]
48048  [
48049    [[*[link beast.ref.boost__beast__http__serializer.value_type value_type]]
48050    ]
48051    [
48052
48053The type of message this serializer uses.
48054    ]
48055  ]
48056]
48057[heading Member Functions]
48058[table [[Name][Description]]
48059  [
48060    [[*[link beast.ref.boost__beast__http__serializer.consume consume]]
48061    ]
48062    [
48063
48064Consume buffer octets in the serialization.
48065    ]
48066  ]
48067  [
48068    [[*[link beast.ref.boost__beast__http__serializer.get get]]
48069    ]
48070    [
48071
48072Returns the message being serialized.
48073    ]
48074  ]
48075  [
48076    [[*[link beast.ref.boost__beast__http__serializer.is_done is_done]]
48077    ]
48078    [
48079
48080Return `true` if serialization is complete.
48081    ]
48082  ]
48083  [
48084    [[*[link beast.ref.boost__beast__http__serializer.is_header_done is_header_done]]
48085    ]
48086    [
48087
48088Return `true` if serialization of the header is complete.
48089    ]
48090  ]
48091  [
48092    [[*[link beast.ref.boost__beast__http__serializer.limit limit]]
48093    ]
48094    [
48095
48096Returns the serialized buffer size limit.
48097
48098Set the serialized buffer size limit.
48099    ]
48100  ]
48101  [
48102    [[*[link beast.ref.boost__beast__http__serializer.next next]]
48103    ]
48104    [
48105
48106Returns the next set of buffers in the serialization.
48107    ]
48108  ]
48109  [
48110    [[*[link beast.ref.boost__beast__http__serializer.operator_eq_ operator=]]
48111    ]
48112    [
48113
48114Assignment.
48115    ]
48116  ]
48117  [
48118    [[*[link beast.ref.boost__beast__http__serializer.serializer serializer]]
48119    ]
48120    [
48121
48122Constructor.
48123    ]
48124  ]
48125  [
48126    [[*[link beast.ref.boost__beast__http__serializer.split split]]
48127    ]
48128    [
48129
48130Returns `true` if we will pause after writing the complete header.
48131
48132Set whether the header and body are written separately.
48133    ]
48134  ]
48135  [
48136    [[*[link beast.ref.boost__beast__http__serializer.writer_impl writer_impl]]
48137    ]
48138    [
48139
48140Provides low-level access to the associated ['BodyWriter]
48141    ]
48142  ]
48143]
48144An object of this type is used to serialize a complete HTTP message into a sequence of octets. To use this class, construct an instance with the message to be serialized. The implementation will automatically perform chunk encoding if the contents of the message indicate that chunk encoding is required.
48145Chunked output produced by the serializer never contains chunk extensions or trailers, and the location of chunk boundaries is not specified. If callers require chunk extensions, trailers, or control over the exact contents of each chunk they should use the serializer to write just the message header, and then assume control over serializing the chunked payload by using the chunk buffer sequence types [link beast.ref.boost__beast__http__chunk_body `chunk_body`], [link beast.ref.boost__beast__http__chunk_crlf `chunk_crlf`], [link beast.ref.boost__beast__http__chunk_header `chunk_header`], and [link beast.ref.boost__beast__http__chunk_last `chunk_last`].
48146
48147[heading Template Parameters]
48148[table [[Type][Description]]
48149  [
48150    [`isRequest`
48151    ]
48152    [
48153`true` if the message is a request.
48154    ]
48155  ]
48156  [
48157    [`Body`
48158    ]
48159    [
48160The body type of the message.
48161    ]
48162  ]
48163  [
48164    [`Fields`
48165    ]
48166    [
48167The type of fields in the message.
48168    ]
48169  ]
48170]
48171[heading Description]
48172
48173
48174[endsect]
48175
48176[section:boost__beast__http__response_serializer http::response_serializer]
48177[indexterm1 http::response_serializer]
48178
48179
48180A serializer for HTTP/1 responses.
48181[heading Synopsis]
48182Defined in header [include_file boost/beast/http/serializer.hpp]
48183
48184```
48185template<
48186    class __Body__,
48187    class __Fields__ = fields>
48188using response_serializer = serializer< false, Body, Fields >;
48189```
48190
48191[heading Types]
48192[table [[Name][Description]]
48193  [
48194    [[*[link beast.ref.boost__beast__http__serializer.value_type value_type]]
48195    ]
48196    [
48197
48198The type of message this serializer uses.
48199    ]
48200  ]
48201]
48202[heading Member Functions]
48203[table [[Name][Description]]
48204  [
48205    [[*[link beast.ref.boost__beast__http__serializer.consume consume]]
48206    ]
48207    [
48208
48209Consume buffer octets in the serialization.
48210    ]
48211  ]
48212  [
48213    [[*[link beast.ref.boost__beast__http__serializer.get get]]
48214    ]
48215    [
48216
48217Returns the message being serialized.
48218    ]
48219  ]
48220  [
48221    [[*[link beast.ref.boost__beast__http__serializer.is_done is_done]]
48222    ]
48223    [
48224
48225Return `true` if serialization is complete.
48226    ]
48227  ]
48228  [
48229    [[*[link beast.ref.boost__beast__http__serializer.is_header_done is_header_done]]
48230    ]
48231    [
48232
48233Return `true` if serialization of the header is complete.
48234    ]
48235  ]
48236  [
48237    [[*[link beast.ref.boost__beast__http__serializer.limit limit]]
48238    ]
48239    [
48240
48241Returns the serialized buffer size limit.
48242
48243Set the serialized buffer size limit.
48244    ]
48245  ]
48246  [
48247    [[*[link beast.ref.boost__beast__http__serializer.next next]]
48248    ]
48249    [
48250
48251Returns the next set of buffers in the serialization.
48252    ]
48253  ]
48254  [
48255    [[*[link beast.ref.boost__beast__http__serializer.operator_eq_ operator=]]
48256    ]
48257    [
48258
48259Assignment.
48260    ]
48261  ]
48262  [
48263    [[*[link beast.ref.boost__beast__http__serializer.serializer serializer]]
48264    ]
48265    [
48266
48267Constructor.
48268    ]
48269  ]
48270  [
48271    [[*[link beast.ref.boost__beast__http__serializer.split split]]
48272    ]
48273    [
48274
48275Returns `true` if we will pause after writing the complete header.
48276
48277Set whether the header and body are written separately.
48278    ]
48279  ]
48280  [
48281    [[*[link beast.ref.boost__beast__http__serializer.writer_impl writer_impl]]
48282    ]
48283    [
48284
48285Provides low-level access to the associated ['BodyWriter]
48286    ]
48287  ]
48288]
48289An object of this type is used to serialize a complete HTTP message into a sequence of octets. To use this class, construct an instance with the message to be serialized. The implementation will automatically perform chunk encoding if the contents of the message indicate that chunk encoding is required.
48290Chunked output produced by the serializer never contains chunk extensions or trailers, and the location of chunk boundaries is not specified. If callers require chunk extensions, trailers, or control over the exact contents of each chunk they should use the serializer to write just the message header, and then assume control over serializing the chunked payload by using the chunk buffer sequence types [link beast.ref.boost__beast__http__chunk_body `chunk_body`], [link beast.ref.boost__beast__http__chunk_crlf `chunk_crlf`], [link beast.ref.boost__beast__http__chunk_header `chunk_header`], and [link beast.ref.boost__beast__http__chunk_last `chunk_last`].
48291
48292[heading Template Parameters]
48293[table [[Type][Description]]
48294  [
48295    [`isRequest`
48296    ]
48297    [
48298`true` if the message is a request.
48299    ]
48300  ]
48301  [
48302    [`Body`
48303    ]
48304    [
48305The body type of the message.
48306    ]
48307  ]
48308  [
48309    [`Fields`
48310    ]
48311    [
48312The type of fields in the message.
48313    ]
48314  ]
48315]
48316[heading Description]
48317
48318
48319[endsect]
48320
48321[section:boost__beast__http__string_body http::string_body]
48322[indexterm1 http::string_body]
48323
48324
48325A ['Body] using `std::string`
48326[heading Synopsis]
48327Defined in header [include_file boost/beast/http/string_body.hpp]
48328
48329```
48330using string_body = basic_string_body< char >;
48331```
48332
48333[heading Types]
48334[table [[Name][Description]]
48335  [
48336    [[*[link beast.ref.boost__beast__http__basic_string_body.reader reader]]
48337    ]
48338    [
48339
48340The algorithm for parsing the body.
48341    ]
48342  ]
48343  [
48344    [[*[link beast.ref.boost__beast__http__basic_string_body.value_type value_type]]
48345    ]
48346    [
48347
48348The type of container used for the body.
48349    ]
48350  ]
48351  [
48352    [[*[link beast.ref.boost__beast__http__basic_string_body.writer writer]]
48353    ]
48354    [
48355
48356The algorithm for serializing the body.
48357    ]
48358  ]
48359]
48360[heading Static Members]
48361[table [[Name][Description]]
48362  [
48363    [[*[link beast.ref.boost__beast__http__basic_string_body.size size]]
48364    ]
48365    [
48366
48367Returns the payload size of the body.
48368    ]
48369  ]
48370]
48371This body uses `std::basic_string` as a memory-based container for holding message payloads. Messages using this body type may be serialized and parsed.
48372[heading Description]
48373
48374
48375[endsect]
48376
48377[section:boost__beast__http__is_body http::is_body]
48378[indexterm1 http::is_body]
48379
48380
48381Determine if a type meets the ['Body] named requirements.
48382[heading Synopsis]
48383Defined in header [include_file boost/beast/http/type_traits.hpp]
48384
48385```
48386template<
48387    class T>
48388using is_body = ``['see-below]``;
48389```
48390
48391[heading Description]
48392This alias template is `std::true_type` if `T` meets the requirements, otherwise it is `std::false_type`.
48393
48394[heading Template Parameters]
48395[table [[Type][Description]]
48396  [
48397    [`T`
48398    ]
48399    [
48400The type to test.
48401    ]
48402  ]
48403]
48404[heading Example]
48405
48406```
48407template<bool isRequest, class Body, class Fields>
48408void check_body(message<isRequest, Body, Fields> const&)
48409{
48410    static_assert(is_body<Body>::value,
48411        "Body type requirements not met");
48412}
48413```
48414
48415
48416
48417[endsect]
48418
48419[section:boost__beast__http__is_body_writer http::is_body_writer]
48420[indexterm1 http::is_body_writer]
48421
48422
48423Determine if a type has a nested ['BodyWriter].
48424[heading Synopsis]
48425Defined in header [include_file boost/beast/http/type_traits.hpp]
48426
48427```
48428template<
48429    class T>
48430using is_body_writer = ``['see-below]``;
48431```
48432
48433[heading Description]
48434This alias template is `std::true_type` when:
48435
48436* `T` has a nested type named `writer`
48437
48438* `writer` meets the requirements of ['BodyWriter].
48439
48440[heading Template Parameters]
48441[table [[Type][Description]]
48442  [
48443    [`T`
48444    ]
48445    [
48446The body type to test.
48447    ]
48448  ]
48449]
48450[heading Example]
48451
48452```
48453template<bool isRequest, class Body, class Fields>
48454void check_can_serialize(message<isRequest, Body, Fields> const&)
48455{
48456    static_assert(is_body_writer<Body>::value,
48457        "Cannot serialize Body, no reader");
48458}
48459```
48460
48461
48462
48463[endsect]
48464
48465[section:boost__beast__http__is_mutable_body_writer http::is_mutable_body_writer]
48466[indexterm1 http::is_mutable_body_writer]
48467
48468
48469Determine if a type has a nested ['BodyWriter].
48470[heading Synopsis]
48471Defined in header [include_file boost/beast/http/type_traits.hpp]
48472
48473```
48474template<
48475    class T>
48476using is_mutable_body_writer = ``['see-below]``;
48477```
48478
48479[heading Description]
48480This alias template is `std::true_type` when:
48481
48482* `T` has a nested type named `writer`
48483
48484* `writer` meets the requirements of ['BodyWriter].
48485
48486[heading Template Parameters]
48487[table [[Type][Description]]
48488  [
48489    [`T`
48490    ]
48491    [
48492The body type to test.
48493    ]
48494  ]
48495]
48496
48497
48498[endsect]
48499
48500[section:boost__beast__http__is_body_reader http::is_body_reader]
48501[indexterm1 http::is_body_reader]
48502
48503
48504Determine if a type has a nested ['BodyReader].
48505[heading Synopsis]
48506Defined in header [include_file boost/beast/http/type_traits.hpp]
48507
48508```
48509template<
48510    class T>
48511using is_body_reader = ``['see-below]``;
48512```
48513
48514[heading Description]
48515This alias template is `std::true_type` when:
48516
48517* `T` has a nested type named `reader`
48518
48519* `reader` meets the requirements of ['BodyReader].
48520
48521[heading Template Parameters]
48522[table [[Type][Description]]
48523  [
48524    [`T`
48525    ]
48526    [
48527The body type to test.
48528    ]
48529  ]
48530]
48531[heading Example]
48532
48533```
48534template<bool isRequest, class Body, class Fields>
48535void check_can_parse(message<isRequest, Body, Fields>&)
48536{
48537    static_assert(is_body_reader<Body>::value,
48538        "Cannot parse Body, no reader");
48539}
48540```
48541
48542
48543
48544[endsect]
48545
48546[section:boost__beast__http__is_fields http::is_fields]
48547[indexterm1 http::is_fields]
48548
48549
48550Determine if a type meets the ['Fields] named requirements.
48551[heading Synopsis]
48552Defined in header [include_file boost/beast/http/type_traits.hpp]
48553
48554```
48555template<
48556    class T>
48557using is_fields = ``['see-below]``;
48558```
48559
48560[heading Description]
48561This alias template is `std::true_type` if `T` meets the requirements, otherwise it is `std::false_type`.
48562
48563[heading Template Parameters]
48564[table [[Type][Description]]
48565  [
48566    [`T`
48567    ]
48568    [
48569The type to test.
48570    ]
48571  ]
48572]
48573[heading Example]
48574
48575Use with `static_assert`:
48576```
48577template<bool isRequest, class Body, class Fields>
48578void f(message<isRequest, Body, Fields> const&)
48579{
48580    static_assert(is_fields<Fields>::value,
48581        "Fields type requirements not met");
48582...
48583```
48584
48585Use with `std::enable_if` (SFINAE):
48586```
48587template<bool isRequest, class Body, class Fields>
48588typename std::enable_if<is_fields<Fields>::value>::type
48589f(message<isRequest, Body, Fields> const&);
48590```
48591
48592
48593
48594[endsect]
48595
48596[section:boost__beast__http__make_chunk http::make_chunk]
48597[indexterm1 http::make_chunk]
48598
48599
48600Returns a [link beast.ref.boost__beast__http__chunk_body `chunk_body`].
48601[heading Synopsis]
48602Defined in header [include_file boost/beast/http/chunk_encode.hpp]
48603
48604```
48605template<
48606    class __ConstBufferSequence__,
48607    class... Args>
48608auto
48609make_chunk(
48610    ConstBufferSequence const& buffers,
48611    Args&&... args);
48612```
48613
48614[heading Description]
48615This functions constructs and returns a complete [link beast.ref.boost__beast__http__chunk_body `chunk_body`] for a chunk body represented by the specified buffer sequence.
48616
48617[heading Parameters]
48618[table [[Name][Description]]
48619  [
48620    [`buffers`
48621    ]
48622    [
48623The buffers representing the chunk body.
48624    ]
48625  ]
48626  [
48627    [`args`
48628    ]
48629    [
48630Optional arguments passed to the [link beast.ref.boost__beast__http__chunk_body `chunk_body`] constructor.
48631    ]
48632  ]
48633]
48634[heading Remarks]
48635This function is provided as a notational convenience to omit specification of the class template arguments.
48636
48637
48638[endsect]
48639
48640[section:boost__beast__http__make_chunk_last http::make_chunk_last]
48641[indexterm1 http::make_chunk_last]
48642
48643
48644Returns a [link beast.ref.boost__beast__http__chunk_last `chunk_last`].
48645```
48646chunk_last< chunk_crlf >
48647``[link beast.ref.boost__beast__http__make_chunk_last.overload1 make_chunk_last]``();
48648  ``[''''&raquo;''' [link beast.ref.boost__beast__http__make_chunk_last.overload1 `more...`]]``
48649
48650template<
48651    class Trailer,
48652    class... Args>
48653chunk_last< Trailer >
48654``[link beast.ref.boost__beast__http__make_chunk_last.overload2 make_chunk_last]``(
48655    Trailer const& trailer,
48656    Args&&... args);
48657  ``[''''&raquo;''' [link beast.ref.boost__beast__http__make_chunk_last.overload2 `more...`]]``
48658```
48659
48660[section:overload1 http::make_chunk_last (1 of 2 overloads)]
48661
48662Returns a [link beast.ref.boost__beast__http__chunk_last `chunk_last`].
48663[heading Synopsis]
48664Defined in header [include_file boost/beast/http/chunk_encode.hpp]
48665
48666```
48667chunk_last< chunk_crlf >
48668make_chunk_last();
48669```
48670
48671[heading Description]
48672
48673[heading Remarks]
48674This function is provided as a notational convenience to omit specification of the class template arguments.
48675
48676
48677[endsect]
48678
48679[section:overload2 http::make_chunk_last (2 of 2 overloads)]
48680
48681Returns a [link beast.ref.boost__beast__http__chunk_last `chunk_last`].
48682[heading Synopsis]
48683Defined in header [include_file boost/beast/http/chunk_encode.hpp]
48684
48685```
48686template<
48687    class Trailer,
48688    class... Args>
48689chunk_last< Trailer >
48690make_chunk_last(
48691    Trailer const& trailer,
48692    Args&&... args);
48693```
48694
48695[heading Description]
48696This function construct and returns a complete [link beast.ref.boost__beast__http__chunk_last `chunk_last`] for a last chunk containing the specified trailers.
48697
48698[heading Parameters]
48699[table [[Name][Description]]
48700  [
48701    [`trailer`
48702    ]
48703    [
48704A ConstBufferSequence or
48705    ]
48706  ]
48707]
48708[heading Remarks]
48709This function is provided as a notational convenience to omit specification of the class template arguments.
48710[heading Parameters]
48711[table [[Name][Description]]
48712  [
48713    [`args`
48714    ]
48715    [
48716Optional arguments passed to the [link beast.ref.boost__beast__http__chunk_last `chunk_last`] constructor.
48717    ]
48718  ]
48719]
48720
48721
48722[endsect]
48723
48724
48725[endsect]
48726
48727[section:boost__beast__http__to_string http::to_string]
48728[indexterm1 http::to_string]
48729
48730
48731Convert a field enum to a string.
48732```
48733string_view
48734``[link beast.ref.boost__beast__http__to_string.overload1 to_string]``(
48735    field f);
48736  ``[''''&raquo;''' [link beast.ref.boost__beast__http__to_string.overload1 `more...`]]``
48737```
48738
48739
48740Returns the text representation of a request method verb.
48741```
48742string_view
48743``[link beast.ref.boost__beast__http__to_string.overload2 to_string]``(
48744    verb v);
48745  ``[''''&raquo;''' [link beast.ref.boost__beast__http__to_string.overload2 `more...`]]``
48746```
48747
48748[section:overload1 http::to_string (1 of 2 overloads)]
48749
48750Convert a field enum to a string.
48751[heading Synopsis]
48752Defined in header [include_file boost/beast/http/field.hpp]
48753
48754```
48755string_view
48756to_string(
48757    field f);
48758```
48759
48760[heading Description]
48761
48762[heading Parameters]
48763[table [[Name][Description]]
48764  [
48765    [`f`
48766    ]
48767    [
48768The field to convert
48769    ]
48770  ]
48771]
48772
48773
48774[endsect]
48775
48776[section:overload2 http::to_string (2 of 2 overloads)]
48777
48778Returns the text representation of a request method verb.
48779[heading Synopsis]
48780Defined in header [include_file boost/beast/http/verb.hpp]
48781
48782```
48783string_view
48784to_string(
48785    verb v);
48786```
48787
48788[heading Description]
48789
48790
48791[endsect]
48792
48793
48794[endsect]
48795
48796[section:boost__beast__http__string_to_field http::string_to_field]
48797[indexterm1 http::string_to_field]
48798
48799
48800Attempt to convert a string to a field enum.
48801[heading Synopsis]
48802Defined in header [include_file boost/beast/http/field.hpp]
48803
48804```
48805field
48806string_to_field(
48807    string_view s);
48808```
48809
48810[heading Description]
48811The string comparison is case-insensitive.
48812
48813[heading Return Value]
48814The corresponding field, or [link beast.ref.boost__beast__http__field `field::unknown`] if no known field matches.
48815
48816
48817[endsect]
48818
48819[section:boost__beast__http__operator_lt__lt_ http::operator<<]
48820[indexterm1 http::operator<<]
48821
48822
48823Write the text for a field name to an output stream.
48824```
48825std::ostream&
48826``[link beast.ref.boost__beast__http__operator_lt__lt_.overload1 operator<<]``(
48827    std::ostream& os,
48828    field f);
48829  ``[''''&raquo;''' [link beast.ref.boost__beast__http__operator_lt__lt_.overload1 `more...`]]``
48830```
48831
48832
48833Outputs the standard reason phrase of a status code to a stream.
48834```
48835std::ostream&
48836``[link beast.ref.boost__beast__http__operator_lt__lt_.overload2 operator<<]``(
48837    std::ostream&,
48838    status);
48839  ``[''''&raquo;''' [link beast.ref.boost__beast__http__operator_lt__lt_.overload2 `more...`]]``
48840```
48841
48842
48843Write the text for a request method verb to an output stream.
48844```
48845std::ostream&
48846``[link beast.ref.boost__beast__http__operator_lt__lt_.overload3 operator<<]``(
48847    std::ostream& os,
48848    verb v);
48849  ``[''''&raquo;''' [link beast.ref.boost__beast__http__operator_lt__lt_.overload3 `more...`]]``
48850```
48851
48852
48853Serialize an HTTP/1 header to a `std::ostream`.
48854```
48855template<
48856    bool isRequest,
48857    class __Fields__>
48858std::ostream&
48859``[link beast.ref.boost__beast__http__operator_lt__lt_.overload4 operator<<]``(
48860    std::ostream& os,
48861    header< isRequest, Fields > const& msg);
48862  ``[''''&raquo;''' [link beast.ref.boost__beast__http__operator_lt__lt_.overload4 `more...`]]``
48863```
48864
48865
48866Serialize an HTTP/1 message to a `std::ostream`.
48867```
48868template<
48869    bool isRequest,
48870    class __Body__,
48871    class __Fields__>
48872std::ostream&
48873``[link beast.ref.boost__beast__http__operator_lt__lt_.overload5 operator<<]``(
48874    std::ostream& os,
48875    message< isRequest, Body, Fields > const& msg);
48876  ``[''''&raquo;''' [link beast.ref.boost__beast__http__operator_lt__lt_.overload5 `more...`]]``
48877```
48878
48879[section:overload1 http::operator<< (1 of 5 overloads)]
48880
48881Write the text for a field name to an output stream.
48882[heading Synopsis]
48883Defined in header [include_file boost/beast/http/field.hpp]
48884
48885```
48886std::ostream&
48887operator<<(
48888    std::ostream& os,
48889    field f);
48890```
48891
48892[heading Description]
48893
48894
48895[endsect]
48896
48897[section:overload2 http::operator<< (2 of 5 overloads)]
48898
48899Outputs the standard reason phrase of a status code to a stream.
48900[heading Synopsis]
48901Defined in header [include_file boost/beast/http/status.hpp]
48902
48903```
48904std::ostream&
48905operator<<(
48906    std::ostream&,
48907    status);
48908```
48909
48910[heading Description]
48911
48912
48913[endsect]
48914
48915[section:overload3 http::operator<< (3 of 5 overloads)]
48916
48917Write the text for a request method verb to an output stream.
48918[heading Synopsis]
48919Defined in header [include_file boost/beast/http/verb.hpp]
48920
48921```
48922std::ostream&
48923operator<<(
48924    std::ostream& os,
48925    verb v);
48926```
48927
48928[heading Description]
48929
48930
48931[endsect]
48932
48933[section:overload4 http::operator<< (4 of 5 overloads)]
48934
48935Serialize an HTTP/1 header to a `std::ostream`.
48936[heading Synopsis]
48937Defined in header [include_file boost/beast/http/write.hpp]
48938
48939```
48940template<
48941    bool isRequest,
48942    class __Fields__>
48943std::ostream&
48944operator<<(
48945    std::ostream& os,
48946    header< isRequest, Fields > const& msg);
48947```
48948
48949[heading Description]
48950The function converts the header to its HTTP/1 serialized representation and stores the result in the output stream.
48951
48952[heading Parameters]
48953[table [[Name][Description]]
48954  [
48955    [`os`
48956    ]
48957    [
48958The output stream to write to.
48959    ]
48960  ]
48961  [
48962    [`msg`
48963    ]
48964    [
48965The message fields to write.
48966    ]
48967  ]
48968]
48969
48970
48971[endsect]
48972
48973[section:overload5 http::operator<< (5 of 5 overloads)]
48974
48975Serialize an HTTP/1 message to a `std::ostream`.
48976[heading Synopsis]
48977Defined in header [include_file boost/beast/http/write.hpp]
48978
48979```
48980template<
48981    bool isRequest,
48982    class __Body__,
48983    class __Fields__>
48984std::ostream&
48985operator<<(
48986    std::ostream& os,
48987    message< isRequest, Body, Fields > const& msg);
48988```
48989
48990[heading Description]
48991The function converts the message to its HTTP/1 serialized representation and stores the result in the output stream.
48992The implementation will automatically perform chunk encoding if the contents of the message indicate that chunk encoding is required.
48993
48994[heading Parameters]
48995[table [[Name][Description]]
48996  [
48997    [`os`
48998    ]
48999    [
49000The output stream to write to.
49001    ]
49002  ]
49003  [
49004    [`msg`
49005    ]
49006    [
49007The message to write.
49008    ]
49009  ]
49010]
49011
49012
49013[endsect]
49014
49015
49016[endsect]
49017
49018[section:boost__beast__http__swap http::swap]
49019[indexterm1 http::swap]
49020
49021
49022Swap two header objects.
49023```
49024template<
49025    bool isRequest,
49026    class __Fields__>
49027void
49028``[link beast.ref.boost__beast__http__swap.overload1 swap]``(
49029    header< isRequest, Fields >& m1,
49030    header< isRequest, Fields >& m2);
49031  ``[''''&raquo;''' [link beast.ref.boost__beast__http__swap.overload1 `more...`]]``
49032```
49033
49034
49035Swap two message objects.
49036```
49037template<
49038    bool isRequest,
49039    class __Body__,
49040    class __Fields__>
49041void
49042``[link beast.ref.boost__beast__http__swap.overload2 swap]``(
49043    message< isRequest, Body, Fields >& m1,
49044    message< isRequest, Body, Fields >& m2);
49045  ``[''''&raquo;''' [link beast.ref.boost__beast__http__swap.overload2 `more...`]]``
49046```
49047
49048[section:overload1 http::swap (1 of 2 overloads)]
49049
49050Swap two header objects.
49051[heading Synopsis]
49052Defined in header [include_file boost/beast/http/message.hpp]
49053
49054```
49055template<
49056    bool isRequest,
49057    class __Fields__>
49058void
49059swap(
49060    header< isRequest, Fields >& m1,
49061    header< isRequest, Fields >& m2);
49062```
49063
49064[heading Description]
49065
49066[heading Requirements]
49067`Fields` is [*Swappable].
49068
49069
49070[endsect]
49071
49072[section:overload2 http::swap (2 of 2 overloads)]
49073
49074Swap two message objects.
49075[heading Synopsis]
49076Defined in header [include_file boost/beast/http/message.hpp]
49077
49078```
49079template<
49080    bool isRequest,
49081    class __Body__,
49082    class __Fields__>
49083void
49084swap(
49085    message< isRequest, Body, Fields >& m1,
49086    message< isRequest, Body, Fields >& m2);
49087```
49088
49089[heading Description]
49090
49091[heading Requirements:]
49092`Body::value_type` and `Fields` are [*Swappable].
49093
49094
49095[endsect]
49096
49097
49098[endsect]
49099
49100[section:boost__beast__http__read_some http::read_some]
49101[indexterm1 http::read_some]
49102
49103
49104Read part of a message from a stream using a parser.
49105```
49106template<
49107    class __SyncReadStream__,
49108    class __DynamicBuffer__,
49109    bool isRequest>
49110std::size_t
49111``[link beast.ref.boost__beast__http__read_some.overload1 read_some]``(
49112    SyncReadStream& stream,
49113    DynamicBuffer& buffer,
49114    basic_parser< isRequest >& parser);
49115  ``[''''&raquo;''' [link beast.ref.boost__beast__http__read_some.overload1 `more...`]]``
49116
49117template<
49118    class __SyncReadStream__,
49119    class __DynamicBuffer__,
49120    bool isRequest>
49121std::size_t
49122``[link beast.ref.boost__beast__http__read_some.overload2 read_some]``(
49123    SyncReadStream& stream,
49124    DynamicBuffer& buffer,
49125    basic_parser< isRequest >& parser,
49126    error_code& ec);
49127  ``[''''&raquo;''' [link beast.ref.boost__beast__http__read_some.overload2 `more...`]]``
49128```
49129
49130[section:overload1 http::read_some (1 of 2 overloads)]
49131
49132Read part of a message from a stream using a parser.
49133[heading Synopsis]
49134Defined in header [include_file boost/beast/http/read.hpp]
49135
49136```
49137template<
49138    class __SyncReadStream__,
49139    class __DynamicBuffer__,
49140    bool isRequest>
49141std::size_t
49142read_some(
49143    SyncReadStream& stream,
49144    DynamicBuffer& buffer,
49145    basic_parser< isRequest >& parser);
49146```
49147
49148[heading Description]
49149This function is used to read part of a message from a stream into an instance of [link beast.ref.boost__beast__http__basic_parser `basic_parser`]. The call will block until one of the following conditions is true:
49150
49151* A call to [link beast.ref.boost__beast__http__basic_parser.put `basic_parser::put`] with a non-empty buffer sequence is successful.
49152
49153* An error occurs.
49154
49155This operation is implemented in terms of one or more calls to the stream's `read_some` function. The implementation may read additional bytes from the stream that lie past the end of the message being read. These additional bytes are stored in the dynamic buffer, which must be preserved for subsequent reads.
49156If the end of file error is received while reading from the stream, then the error returned from this function will be:
49157
49158* [link beast.ref.boost__beast__http__error `error::end_of_stream`] if no bytes were parsed, or
49159
49160* [link beast.ref.boost__beast__http__error `error::partial_message`] if any bytes were parsed but the message was incomplete, otherwise:
49161
49162* A successful result. The next attempt to read will return [link beast.ref.boost__beast__http__error `error::end_of_stream`]
49163
49164[heading Parameters]
49165[table [[Name][Description]]
49166  [
49167    [`stream`
49168    ]
49169    [
49170The stream from which the data is to be read. The type must meet the ['SyncReadStream] requirements.
49171    ]
49172  ]
49173  [
49174    [`buffer`
49175    ]
49176    [
49177Storage for additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, the parser will be presented with any remaining data in the dynamic buffer's readable bytes sequence first. The type must meet the ['DynamicBuffer] requirements.
49178    ]
49179  ]
49180  [
49181    [`parser`
49182    ]
49183    [
49184The parser to use.
49185    ]
49186  ]
49187]
49188[heading Return Value]
49189The number of bytes transferred from the stream.
49190[heading Exceptions]
49191[table [[Type][Thrown On]]
49192  [
49193    [`system_error`
49194    ]
49195    [
49196Thrown on failure.
49197    ]
49198  ]
49199]
49200[heading Remarks]
49201The function returns the total number of bytes transferred from the stream. This may be zero for the case where there is sufficient pre-existing message data in the dynamic buffer.
49202
49203
49204[endsect]
49205
49206[section:overload2 http::read_some (2 of 2 overloads)]
49207
49208Read part of a message from a stream using a parser.
49209[heading Synopsis]
49210Defined in header [include_file boost/beast/http/read.hpp]
49211
49212```
49213template<
49214    class __SyncReadStream__,
49215    class __DynamicBuffer__,
49216    bool isRequest>
49217std::size_t
49218read_some(
49219    SyncReadStream& stream,
49220    DynamicBuffer& buffer,
49221    basic_parser< isRequest >& parser,
49222    error_code& ec);
49223```
49224
49225[heading Description]
49226This function is used to read part of a message from a stream into an instance of [link beast.ref.boost__beast__http__basic_parser `basic_parser`]. The call will block until one of the following conditions is true:
49227
49228* A call to [link beast.ref.boost__beast__http__basic_parser.put `basic_parser::put`] with a non-empty buffer sequence is successful.
49229
49230* An error occurs.
49231
49232This operation is implemented in terms of one or more calls to the stream's `read_some` function. The implementation may read additional bytes from the stream that lie past the end of the message being read. These additional bytes are stored in the dynamic buffer, which must be preserved for subsequent reads.
49233If the end of file error is received while reading from the stream, then the error returned from this function will be:
49234
49235* [link beast.ref.boost__beast__http__error `error::end_of_stream`] if no bytes were parsed, or
49236
49237* [link beast.ref.boost__beast__http__error `error::partial_message`] if any bytes were parsed but the message was incomplete, otherwise:
49238
49239* A successful result. The next attempt to read will return [link beast.ref.boost__beast__http__error `error::end_of_stream`]
49240
49241[heading Parameters]
49242[table [[Name][Description]]
49243  [
49244    [`stream`
49245    ]
49246    [
49247The stream from which the data is to be read. The type must support the ['SyncReadStream] requirements.
49248    ]
49249  ]
49250  [
49251    [`buffer`
49252    ]
49253    [
49254Storage for additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, the parser will be presented with any remaining data in the dynamic buffer's readable bytes sequence first. The type must meet the ['DynamicBuffer] requirements.
49255    ]
49256  ]
49257  [
49258    [`parser`
49259    ]
49260    [
49261The parser to use.
49262    ]
49263  ]
49264  [
49265    [`ec`
49266    ]
49267    [
49268Set to the error, if any occurred.
49269    ]
49270  ]
49271]
49272[heading Return Value]
49273The number of bytes transferred from the stream.
49274[heading Remarks]
49275The function returns the total number of bytes transferred from the stream. This may be zero for the case where there is sufficient pre-existing message data in the dynamic buffer.
49276
49277
49278[endsect]
49279
49280
49281[endsect]
49282
49283[section:boost__beast__http__async_read_some http::async_read_some]
49284[indexterm1 http::async_read_some]
49285
49286
49287Read part of a message asynchronously from a stream using a parser.
49288[heading Synopsis]
49289Defined in header [include_file boost/beast/http/read.hpp]
49290
49291```
49292template<
49293    class __AsyncReadStream__,
49294    class __DynamicBuffer__,
49295    bool isRequest,
49296    class __ReadHandler__ = net::default_completion_token_t<            executor_type<AsyncReadStream>>>
49297``__deduced__``
49298async_read_some(
49299    AsyncReadStream& stream,
49300    DynamicBuffer& buffer,
49301    basic_parser< isRequest >& parser,
49302    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncReadStream >>{});
49303```
49304
49305[heading Description]
49306This function is used to asynchronously read part of a message from a stream into an instance of [link beast.ref.boost__beast__http__basic_parser `basic_parser`]. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
49307
49308* A call to [link beast.ref.boost__beast__http__basic_parser.put `basic_parser::put`] with a non-empty buffer sequence is successful.
49309
49310* An error occurs.
49311
49312This operation is implemented in terms of zero or more calls to the next layer's `async_read_some` function, and is known as a ['composed operation]. The program must ensure that the stream performs no other reads until this operation completes. The implementation may read additional bytes from the stream that lie past the end of the message being read. These additional bytes are stored in the dynamic buffer, which must be preserved for subsequent reads.
49313If the end of file error is received while reading from the stream, then the error returned from this function will be:
49314
49315* [link beast.ref.boost__beast__http__error `error::end_of_stream`] if no bytes were parsed, or
49316
49317* [link beast.ref.boost__beast__http__error `error::partial_message`] if any bytes were parsed but the message was incomplete, otherwise:
49318
49319* A successful result. The next attempt to read will return [link beast.ref.boost__beast__http__error `error::end_of_stream`]
49320
49321[heading Parameters]
49322[table [[Name][Description]]
49323  [
49324    [`stream`
49325    ]
49326    [
49327The stream from which the data is to be read. The type must meet the ['AsyncReadStream] requirements.
49328    ]
49329  ]
49330  [
49331    [`buffer`
49332    ]
49333    [
49334Storage for additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, the parser will be presented with any remaining data in the dynamic buffer's readable bytes sequence first. The type must meet the ['DynamicBuffer] requirements. The object must remain valid at least until the handler is called; ownership is not transferred.
49335    ]
49336  ]
49337  [
49338    [`parser`
49339    ]
49340    [
49341The parser to use. The object must remain valid at least until the handler is called; ownership is not transferred.
49342    ]
49343  ]
49344  [
49345    [`handler`
49346    ]
49347    [
49348
49349The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
49350```
49351void handler(
49352    error_code const& error,        // result of operation
49353    std::size_t bytes_transferred   // the total number of bytes transferred from the stream
49354);
49355```
49356
49357Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using [link beast.ref.boost__beast__http__verb `net::post`].
49358    ]
49359  ]
49360]
49361[heading Remarks]
49362The completion handler will receive as a parameter the total number of bytes transferred from the stream. This may be zero for the case where there is sufficient pre-existing message data in the dynamic buffer.
49363
49364
49365[endsect]
49366
49367[section:boost__beast__http__read_header http::read_header]
49368[indexterm1 http::read_header]
49369
49370
49371Read a complete message header from a stream using a parser.
49372```
49373template<
49374    class __SyncReadStream__,
49375    class __DynamicBuffer__,
49376    bool isRequest>
49377std::size_t
49378``[link beast.ref.boost__beast__http__read_header.overload1 read_header]``(
49379    SyncReadStream& stream,
49380    DynamicBuffer& buffer,
49381    basic_parser< isRequest >& parser);
49382  ``[''''&raquo;''' [link beast.ref.boost__beast__http__read_header.overload1 `more...`]]``
49383
49384template<
49385    class __SyncReadStream__,
49386    class __DynamicBuffer__,
49387    bool isRequest>
49388std::size_t
49389``[link beast.ref.boost__beast__http__read_header.overload2 read_header]``(
49390    SyncReadStream& stream,
49391    DynamicBuffer& buffer,
49392    basic_parser< isRequest >& parser,
49393    error_code& ec);
49394  ``[''''&raquo;''' [link beast.ref.boost__beast__http__read_header.overload2 `more...`]]``
49395```
49396
49397[section:overload1 http::read_header (1 of 2 overloads)]
49398
49399Read a complete message header from a stream using a parser.
49400[heading Synopsis]
49401Defined in header [include_file boost/beast/http/read.hpp]
49402
49403```
49404template<
49405    class __SyncReadStream__,
49406    class __DynamicBuffer__,
49407    bool isRequest>
49408std::size_t
49409read_header(
49410    SyncReadStream& stream,
49411    DynamicBuffer& buffer,
49412    basic_parser< isRequest >& parser);
49413```
49414
49415[heading Description]
49416This function is used to read a complete message header from a stream into an instance of [link beast.ref.boost__beast__http__basic_parser `basic_parser`]. The call will block until one of the following conditions is true:
49417
49418* [link beast.ref.boost__beast__http__basic_parser.is_header_done `basic_parser::is_header_done`] returns `true`
49419
49420* An error occurs.
49421
49422This operation is implemented in terms of one or more calls to the stream's `read_some` function. The implementation may read additional bytes from the stream that lie past the end of the message being read. These additional bytes are stored in the dynamic buffer, which must be preserved for subsequent reads.
49423If the end of file error is received while reading from the stream, then the error returned from this function will be:
49424
49425* [link beast.ref.boost__beast__http__error `error::end_of_stream`] if no bytes were parsed, or
49426
49427* [link beast.ref.boost__beast__http__error `error::partial_message`] if any bytes were parsed but the message was incomplete, otherwise:
49428
49429* A successful result. The next attempt to read will return [link beast.ref.boost__beast__http__error `error::end_of_stream`]
49430
49431[heading Parameters]
49432[table [[Name][Description]]
49433  [
49434    [`stream`
49435    ]
49436    [
49437The stream from which the data is to be read. The type must meet the ['SyncReadStream] requirements.
49438    ]
49439  ]
49440  [
49441    [`buffer`
49442    ]
49443    [
49444Storage for additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, the parser will be presented with any remaining data in the dynamic buffer's readable bytes sequence first. The type must meet the ['DynamicBuffer] requirements.
49445    ]
49446  ]
49447  [
49448    [`parser`
49449    ]
49450    [
49451The parser to use.
49452    ]
49453  ]
49454]
49455[heading Return Value]
49456The number of bytes transferred from the stream.
49457[heading Exceptions]
49458[table [[Type][Thrown On]]
49459  [
49460    [`system_error`
49461    ]
49462    [
49463Thrown on failure.
49464    ]
49465  ]
49466]
49467[heading Remarks]
49468The function returns the total number of bytes transferred from the stream. This may be zero for the case where there is sufficient pre-existing message data in the dynamic buffer. The implementation will call [link beast.ref.boost__beast__http__basic_parser.eager `basic_parser::eager`] with the value `false` on the parser passed in.
49469
49470
49471[endsect]
49472
49473[section:overload2 http::read_header (2 of 2 overloads)]
49474
49475Read a complete message header from a stream using a parser.
49476[heading Synopsis]
49477Defined in header [include_file boost/beast/http/read.hpp]
49478
49479```
49480template<
49481    class __SyncReadStream__,
49482    class __DynamicBuffer__,
49483    bool isRequest>
49484std::size_t
49485read_header(
49486    SyncReadStream& stream,
49487    DynamicBuffer& buffer,
49488    basic_parser< isRequest >& parser,
49489    error_code& ec);
49490```
49491
49492[heading Description]
49493This function is used to read a complete message header from a stream into an instance of [link beast.ref.boost__beast__http__basic_parser `basic_parser`]. The call will block until one of the following conditions is true:
49494
49495* [link beast.ref.boost__beast__http__basic_parser.is_header_done `basic_parser::is_header_done`] returns `true`
49496
49497* An error occurs.
49498
49499This operation is implemented in terms of one or more calls to the stream's `read_some` function. The implementation may read additional bytes from the stream that lie past the end of the message being read. These additional bytes are stored in the dynamic buffer, which must be preserved for subsequent reads.
49500If the end of file error is received while reading from the stream, then the error returned from this function will be:
49501
49502* [link beast.ref.boost__beast__http__error `error::end_of_stream`] if no bytes were parsed, or
49503
49504* [link beast.ref.boost__beast__http__error `error::partial_message`] if any bytes were parsed but the message was incomplete, otherwise:
49505
49506* A successful result. The next attempt to read will return [link beast.ref.boost__beast__http__error `error::end_of_stream`]
49507
49508[heading Parameters]
49509[table [[Name][Description]]
49510  [
49511    [`stream`
49512    ]
49513    [
49514The stream from which the data is to be read. The type must meet the ['SyncReadStream] requirements.
49515    ]
49516  ]
49517  [
49518    [`buffer`
49519    ]
49520    [
49521Storage for additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, the parser will be presented with any remaining data in the dynamic buffer's readable bytes sequence first. The type must meet the ['DynamicBuffer] requirements.
49522    ]
49523  ]
49524  [
49525    [`parser`
49526    ]
49527    [
49528The parser to use.
49529    ]
49530  ]
49531  [
49532    [`ec`
49533    ]
49534    [
49535Set to the error, if any occurred.
49536    ]
49537  ]
49538]
49539[heading Return Value]
49540The number of bytes transferred from the stream.
49541[heading Remarks]
49542The function returns the total number of bytes transferred from the stream. This may be zero for the case where there is sufficient pre-existing message data in the dynamic buffer. The implementation will call [link beast.ref.boost__beast__http__basic_parser.eager `basic_parser::eager`] with the value `false` on the parser passed in.
49543
49544
49545[endsect]
49546
49547
49548[endsect]
49549
49550[section:boost__beast__http__async_read_header http::async_read_header]
49551[indexterm1 http::async_read_header]
49552
49553
49554Read a complete message header asynchronously from a stream using a parser.
49555[heading Synopsis]
49556Defined in header [include_file boost/beast/http/read.hpp]
49557
49558```
49559template<
49560    class __AsyncReadStream__,
49561    class __DynamicBuffer__,
49562    bool isRequest,
49563    class __ReadHandler__ = net::default_completion_token_t<            executor_type<AsyncReadStream>>>
49564``__deduced__``
49565async_read_header(
49566    AsyncReadStream& stream,
49567    DynamicBuffer& buffer,
49568    basic_parser< isRequest >& parser,
49569    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncReadStream >>{});
49570```
49571
49572[heading Description]
49573This function is used to asynchronously read a complete message header from a stream into an instance of [link beast.ref.boost__beast__http__basic_parser `basic_parser`]. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
49574
49575* [link beast.ref.boost__beast__http__basic_parser.is_header_done `basic_parser::is_header_done`] returns `true`
49576
49577* An error occurs.
49578
49579This operation is implemented in terms of zero or more calls to the next layer's `async_read_some` function, and is known as a ['composed operation]. The program must ensure that the stream performs no other reads until this operation completes. The implementation may read additional bytes from the stream that lie past the end of the message being read. These additional bytes are stored in the dynamic buffer, which must be preserved for subsequent reads.
49580If the end of file error is received while reading from the stream, then the error returned from this function will be:
49581
49582* [link beast.ref.boost__beast__http__error `error::end_of_stream`] if no bytes were parsed, or
49583
49584* [link beast.ref.boost__beast__http__error `error::partial_message`] if any bytes were parsed but the message was incomplete, otherwise:
49585
49586* A successful result. The next attempt to read will return [link beast.ref.boost__beast__http__error `error::end_of_stream`]
49587
49588[heading Parameters]
49589[table [[Name][Description]]
49590  [
49591    [`stream`
49592    ]
49593    [
49594The stream from which the data is to be read. The type must meet the ['AsyncReadStream] requirements.
49595    ]
49596  ]
49597  [
49598    [`buffer`
49599    ]
49600    [
49601Storage for additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, the parser will be presented with any remaining data in the dynamic buffer's readable bytes sequence first. The type must meet the ['DynamicBuffer] requirements. The object must remain valid at least until the handler is called; ownership is not transferred.
49602    ]
49603  ]
49604  [
49605    [`parser`
49606    ]
49607    [
49608The parser to use. The object must remain valid at least until the handler is called; ownership is not transferred.
49609    ]
49610  ]
49611  [
49612    [`handler`
49613    ]
49614    [
49615
49616The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
49617```
49618void handler(
49619    error_code const& error,        // result of operation
49620    std::size_t bytes_transferred   // the total number of bytes transferred from the stream
49621);
49622```
49623
49624Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using [link beast.ref.boost__beast__http__verb `net::post`].
49625    ]
49626  ]
49627]
49628[heading Remarks]
49629The completion handler will receive as a parameter the total number of bytes transferred from the stream. This may be zero for the case where there is sufficient pre-existing message data in the dynamic buffer. The implementation will call [link beast.ref.boost__beast__http__basic_parser.eager `basic_parser::eager`] with the value `false` on the parser passed in.
49630
49631
49632[endsect]
49633
49634[section:boost__beast__http__read http::read]
49635[indexterm1 http::read]
49636
49637
49638Read a complete message from a stream using a parser.
49639```
49640template<
49641    class __SyncReadStream__,
49642    class __DynamicBuffer__,
49643    bool isRequest>
49644std::size_t
49645``[link beast.ref.boost__beast__http__read.overload1 read]``(
49646    SyncReadStream& stream,
49647    DynamicBuffer& buffer,
49648    basic_parser< isRequest >& parser);
49649  ``[''''&raquo;''' [link beast.ref.boost__beast__http__read.overload1 `more...`]]``
49650
49651template<
49652    class __SyncReadStream__,
49653    class __DynamicBuffer__,
49654    bool isRequest>
49655std::size_t
49656``[link beast.ref.boost__beast__http__read.overload2 read]``(
49657    SyncReadStream& stream,
49658    DynamicBuffer& buffer,
49659    basic_parser< isRequest >& parser,
49660    error_code& ec);
49661  ``[''''&raquo;''' [link beast.ref.boost__beast__http__read.overload2 `more...`]]``
49662```
49663
49664
49665Read a complete message from a stream.
49666```
49667template<
49668    class __SyncReadStream__,
49669    class __DynamicBuffer__,
49670    bool isRequest,
49671    class __Body__,
49672    class __Allocator__>
49673std::size_t
49674``[link beast.ref.boost__beast__http__read.overload3 read]``(
49675    SyncReadStream& stream,
49676    DynamicBuffer& buffer,
49677    message< isRequest, Body, basic_fields< Allocator >>& msg);
49678  ``[''''&raquo;''' [link beast.ref.boost__beast__http__read.overload3 `more...`]]``
49679
49680template<
49681    class __SyncReadStream__,
49682    class __DynamicBuffer__,
49683    bool isRequest,
49684    class __Body__,
49685    class __Allocator__>
49686std::size_t
49687``[link beast.ref.boost__beast__http__read.overload4 read]``(
49688    SyncReadStream& stream,
49689    DynamicBuffer& buffer,
49690    message< isRequest, Body, basic_fields< Allocator >>& msg,
49691    error_code& ec);
49692  ``[''''&raquo;''' [link beast.ref.boost__beast__http__read.overload4 `more...`]]``
49693```
49694
49695[section:overload1 http::read (1 of 4 overloads)]
49696
49697Read a complete message from a stream using a parser.
49698[heading Synopsis]
49699Defined in header [include_file boost/beast/http/read.hpp]
49700
49701```
49702template<
49703    class __SyncReadStream__,
49704    class __DynamicBuffer__,
49705    bool isRequest>
49706std::size_t
49707read(
49708    SyncReadStream& stream,
49709    DynamicBuffer& buffer,
49710    basic_parser< isRequest >& parser);
49711```
49712
49713[heading Description]
49714This function is used to read a complete message from a stream into an instance of [link beast.ref.boost__beast__http__basic_parser `basic_parser`]. The call will block until one of the following conditions is true:
49715
49716* [link beast.ref.boost__beast__http__basic_parser.is_done `basic_parser::is_done`] returns `true`
49717
49718* An error occurs.
49719
49720This operation is implemented in terms of one or more calls to the stream's `read_some` function. The implementation may read additional bytes from the stream that lie past the end of the message being read. These additional bytes are stored in the dynamic buffer, which must be preserved for subsequent reads.
49721If the end of file error is received while reading from the stream, then the error returned from this function will be:
49722
49723* [link beast.ref.boost__beast__http__error `error::end_of_stream`] if no bytes were parsed, or
49724
49725* [link beast.ref.boost__beast__http__error `error::partial_message`] if any bytes were parsed but the message was incomplete, otherwise:
49726
49727* A successful result. The next attempt to read will return [link beast.ref.boost__beast__http__error `error::end_of_stream`]
49728
49729[heading Parameters]
49730[table [[Name][Description]]
49731  [
49732    [`stream`
49733    ]
49734    [
49735The stream from which the data is to be read. The type must meet the ['SyncReadStream] requirements.
49736    ]
49737  ]
49738  [
49739    [`buffer`
49740    ]
49741    [
49742Storage for additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, the parser will be presented with any remaining data in the dynamic buffer's readable bytes sequence first. The type must meet the ['DynamicBuffer] requirements.
49743    ]
49744  ]
49745  [
49746    [`parser`
49747    ]
49748    [
49749The parser to use.
49750    ]
49751  ]
49752]
49753[heading Return Value]
49754The number of bytes transferred from the stream.
49755[heading Exceptions]
49756[table [[Type][Thrown On]]
49757  [
49758    [`system_error`
49759    ]
49760    [
49761Thrown on failure.
49762    ]
49763  ]
49764]
49765[heading Remarks]
49766The function returns the total number of bytes transferred from the stream. This may be zero for the case where there is sufficient pre-existing message data in the dynamic buffer. The implementation will call [link beast.ref.boost__beast__http__basic_parser.eager `basic_parser::eager`] with the value `true` on the parser passed in.
49767
49768
49769[endsect]
49770
49771[section:overload2 http::read (2 of 4 overloads)]
49772
49773Read a complete message from a stream using a parser.
49774[heading Synopsis]
49775Defined in header [include_file boost/beast/http/read.hpp]
49776
49777```
49778template<
49779    class __SyncReadStream__,
49780    class __DynamicBuffer__,
49781    bool isRequest>
49782std::size_t
49783read(
49784    SyncReadStream& stream,
49785    DynamicBuffer& buffer,
49786    basic_parser< isRequest >& parser,
49787    error_code& ec);
49788```
49789
49790[heading Description]
49791This function is used to read a complete message from a stream into an instance of [link beast.ref.boost__beast__http__basic_parser `basic_parser`]. The call will block until one of the following conditions is true:
49792
49793* [link beast.ref.boost__beast__http__basic_parser.is_done `basic_parser::is_done`] returns `true`
49794
49795* An error occurs.
49796
49797This operation is implemented in terms of one or more calls to the stream's `read_some` function. The implementation may read additional bytes from the stream that lie past the end of the message being read. These additional bytes are stored in the dynamic buffer, which must be preserved for subsequent reads.
49798If the end of file error is received while reading from the stream, then the error returned from this function will be:
49799
49800* [link beast.ref.boost__beast__http__error `error::end_of_stream`] if no bytes were parsed, or
49801
49802* [link beast.ref.boost__beast__http__error `error::partial_message`] if any bytes were parsed but the message was incomplete, otherwise:
49803
49804* A successful result. The next attempt to read will return [link beast.ref.boost__beast__http__error `error::end_of_stream`]
49805
49806[heading Parameters]
49807[table [[Name][Description]]
49808  [
49809    [`stream`
49810    ]
49811    [
49812The stream from which the data is to be read. The type must meet the ['SyncReadStream] requirements.
49813    ]
49814  ]
49815  [
49816    [`buffer`
49817    ]
49818    [
49819Storage for additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, the parser will be presented with any remaining data in the dynamic buffer's readable bytes sequence first. The type must meet the ['DynamicBuffer] requirements.
49820    ]
49821  ]
49822  [
49823    [`parser`
49824    ]
49825    [
49826The parser to use.
49827    ]
49828  ]
49829  [
49830    [`ec`
49831    ]
49832    [
49833Set to the error, if any occurred.
49834    ]
49835  ]
49836]
49837[heading Return Value]
49838The number of bytes transferred from the stream.
49839[heading Remarks]
49840The function returns the total number of bytes transferred from the stream. This may be zero for the case where there is sufficient pre-existing message data in the dynamic buffer. The implementation will call [link beast.ref.boost__beast__http__basic_parser.eager `basic_parser::eager`] with the value `true` on the parser passed in.
49841
49842
49843[endsect]
49844
49845[section:overload3 http::read (3 of 4 overloads)]
49846
49847Read a complete message from a stream.
49848[heading Synopsis]
49849Defined in header [include_file boost/beast/http/read.hpp]
49850
49851```
49852template<
49853    class __SyncReadStream__,
49854    class __DynamicBuffer__,
49855    bool isRequest,
49856    class __Body__,
49857    class __Allocator__>
49858std::size_t
49859read(
49860    SyncReadStream& stream,
49861    DynamicBuffer& buffer,
49862    message< isRequest, Body, basic_fields< Allocator >>& msg);
49863```
49864
49865[heading Description]
49866This function is used to read a complete message from a stream into an instance of [link beast.ref.boost__beast__http__message `message`]. The call will block until one of the following conditions is true:
49867
49868* The entire message is read in.
49869
49870* An error occurs.
49871
49872This operation is implemented in terms of one or more calls to the stream's `read_some` function. The implementation may read additional bytes from the stream that lie past the end of the message being read. These additional bytes are stored in the dynamic buffer, which must be preserved for subsequent reads.
49873If the end of file error is received while reading from the stream, then the error returned from this function will be:
49874
49875* [link beast.ref.boost__beast__http__error `error::end_of_stream`] if no bytes were parsed, or
49876
49877* [link beast.ref.boost__beast__http__error `error::partial_message`] if any bytes were parsed but the message was incomplete, otherwise:
49878
49879* A successful result. The next attempt to read will return [link beast.ref.boost__beast__http__error `error::end_of_stream`]
49880
49881[heading Parameters]
49882[table [[Name][Description]]
49883  [
49884    [`stream`
49885    ]
49886    [
49887The stream from which the data is to be read. The type must meet the ['SyncReadStream] requirements.
49888    ]
49889  ]
49890  [
49891    [`buffer`
49892    ]
49893    [
49894Storage for additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, the parser will be presented with any remaining data in the dynamic buffer's readable bytes sequence first. The type must meet the ['DynamicBuffer] requirements.
49895    ]
49896  ]
49897  [
49898    [`msg`
49899    ]
49900    [
49901The container in which to store the message contents. This message container should not have previous contents, otherwise the behavior is undefined. The type must be meet the ['MoveAssignable] and ['MoveConstructible] requirements.
49902    ]
49903  ]
49904]
49905[heading Return Value]
49906The number of bytes transferred from the stream.
49907[heading Exceptions]
49908[table [[Type][Thrown On]]
49909  [
49910    [`system_error`
49911    ]
49912    [
49913Thrown on failure.
49914    ]
49915  ]
49916]
49917[heading Remarks]
49918The function returns the total number of bytes transferred from the stream. This may be zero for the case where there is sufficient pre-existing message data in the dynamic buffer. The implementation will call [link beast.ref.boost__beast__http__basic_parser.eager `basic_parser::eager`] with the value `true` on the parser passed in.
49919
49920
49921[endsect]
49922
49923[section:overload4 http::read (4 of 4 overloads)]
49924
49925Read a complete message from a stream.
49926[heading Synopsis]
49927Defined in header [include_file boost/beast/http/read.hpp]
49928
49929```
49930template<
49931    class __SyncReadStream__,
49932    class __DynamicBuffer__,
49933    bool isRequest,
49934    class __Body__,
49935    class __Allocator__>
49936std::size_t
49937read(
49938    SyncReadStream& stream,
49939    DynamicBuffer& buffer,
49940    message< isRequest, Body, basic_fields< Allocator >>& msg,
49941    error_code& ec);
49942```
49943
49944[heading Description]
49945This function is used to read a complete message from a stream into an instance of [link beast.ref.boost__beast__http__message `message`]. The call will block until one of the following conditions is true:
49946
49947* The entire message is read in.
49948
49949* An error occurs.
49950
49951This operation is implemented in terms of one or more calls to the stream's `read_some` function. The implementation may read additional bytes from the stream that lie past the end of the message being read. These additional bytes are stored in the dynamic buffer, which must be preserved for subsequent reads.
49952If the end of file error is received while reading from the stream, then the error returned from this function will be:
49953
49954* [link beast.ref.boost__beast__http__error `error::end_of_stream`] if no bytes were parsed, or
49955
49956* [link beast.ref.boost__beast__http__error `error::partial_message`] if any bytes were parsed but the message was incomplete, otherwise:
49957
49958* A successful result. The next attempt to read will return [link beast.ref.boost__beast__http__error `error::end_of_stream`]
49959
49960[heading Parameters]
49961[table [[Name][Description]]
49962  [
49963    [`stream`
49964    ]
49965    [
49966The stream from which the data is to be read. The type must meet the ['SyncReadStream] requirements.
49967    ]
49968  ]
49969  [
49970    [`buffer`
49971    ]
49972    [
49973Storage for additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, the parser will be presented with any remaining data in the dynamic buffer's readable bytes sequence first. The type must meet the ['DynamicBuffer] requirements.
49974    ]
49975  ]
49976  [
49977    [`msg`
49978    ]
49979    [
49980The container in which to store the message contents. This message container should not have previous contents, otherwise the behavior is undefined. The type must be meet the ['MoveAssignable] and ['MoveConstructible] requirements.
49981    ]
49982  ]
49983  [
49984    [`ec`
49985    ]
49986    [
49987Set to the error, if any occurred.
49988    ]
49989  ]
49990]
49991[heading Return Value]
49992The number of bytes transferred from the stream.
49993[heading Remarks]
49994The function returns the total number of bytes transferred from the stream. This may be zero for the case where there is sufficient pre-existing message data in the dynamic buffer. The implementation will call [link beast.ref.boost__beast__http__basic_parser.eager `basic_parser::eager`] with the value `true` on the parser passed in.
49995
49996
49997[endsect]
49998
49999
50000[endsect]
50001
50002[section:boost__beast__http__async_read http::async_read]
50003[indexterm1 http::async_read]
50004
50005
50006Read a complete message asynchronously from a stream using a parser.
50007```
50008template<
50009    class __AsyncReadStream__,
50010    class __DynamicBuffer__,
50011    bool isRequest,
50012    class __ReadHandler__ = net::default_completion_token_t<            executor_type<AsyncReadStream>>>
50013``__deduced__``
50014``[link beast.ref.boost__beast__http__async_read.overload1 async_read]``(
50015    AsyncReadStream& stream,
50016    DynamicBuffer& buffer,
50017    basic_parser< isRequest >& parser,
50018    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncReadStream >>{});
50019  ``[''''&raquo;''' [link beast.ref.boost__beast__http__async_read.overload1 `more...`]]``
50020```
50021
50022
50023Read a complete message asynchronously from a stream.
50024```
50025template<
50026    class __AsyncReadStream__,
50027    class __DynamicBuffer__,
50028    bool isRequest,
50029    class __Body__,
50030    class __Allocator__,
50031    class __ReadHandler__ = net::default_completion_token_t<            executor_type<AsyncReadStream>>>
50032``__deduced__``
50033``[link beast.ref.boost__beast__http__async_read.overload2 async_read]``(
50034    AsyncReadStream& stream,
50035    DynamicBuffer& buffer,
50036    message< isRequest, Body, basic_fields< Allocator >>& msg,
50037    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncReadStream >>{});
50038  ``[''''&raquo;''' [link beast.ref.boost__beast__http__async_read.overload2 `more...`]]``
50039```
50040
50041[section:overload1 http::async_read (1 of 2 overloads)]
50042
50043Read a complete message asynchronously from a stream using a parser.
50044[heading Synopsis]
50045Defined in header [include_file boost/beast/http/read.hpp]
50046
50047```
50048template<
50049    class __AsyncReadStream__,
50050    class __DynamicBuffer__,
50051    bool isRequest,
50052    class __ReadHandler__ = net::default_completion_token_t<            executor_type<AsyncReadStream>>>
50053``__deduced__``
50054async_read(
50055    AsyncReadStream& stream,
50056    DynamicBuffer& buffer,
50057    basic_parser< isRequest >& parser,
50058    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncReadStream >>{});
50059```
50060
50061[heading Description]
50062This function is used to asynchronously read a complete message from a stream into an instance of [link beast.ref.boost__beast__http__basic_parser `basic_parser`]. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
50063
50064* [link beast.ref.boost__beast__http__basic_parser.is_done `basic_parser::is_done`] returns `true`
50065
50066* An error occurs.
50067
50068This operation is implemented in terms of zero or more calls to the next layer's `async_read_some` function, and is known as a ['composed operation]. The program must ensure that the stream performs no other reads until this operation completes. The implementation may read additional bytes from the stream that lie past the end of the message being read. These additional bytes are stored in the dynamic buffer, which must be preserved for subsequent reads.
50069If the end of file error is received while reading from the stream, then the error returned from this function will be:
50070
50071* [link beast.ref.boost__beast__http__error `error::end_of_stream`] if no bytes were parsed, or
50072
50073* [link beast.ref.boost__beast__http__error `error::partial_message`] if any bytes were parsed but the message was incomplete, otherwise:
50074
50075* A successful result. The next attempt to read will return [link beast.ref.boost__beast__http__error `error::end_of_stream`]
50076
50077[heading Parameters]
50078[table [[Name][Description]]
50079  [
50080    [`stream`
50081    ]
50082    [
50083The stream from which the data is to be read. The type must meet the ['AsyncReadStream] requirements.
50084    ]
50085  ]
50086  [
50087    [`buffer`
50088    ]
50089    [
50090Storage for additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, the parser will be presented with any remaining data in the dynamic buffer's readable bytes sequence first. The type must meet the ['DynamicBuffer] requirements. The object must remain valid at least until the handler is called; ownership is not transferred.
50091    ]
50092  ]
50093  [
50094    [`parser`
50095    ]
50096    [
50097The parser to use. The object must remain valid at least until the handler is called; ownership is not transferred.
50098    ]
50099  ]
50100  [
50101    [`handler`
50102    ]
50103    [
50104
50105The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
50106```
50107void handler(
50108    error_code const& error,        // result of operation
50109    std::size_t bytes_transferred   // the total number of bytes transferred from the stream
50110);
50111```
50112
50113Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using [link beast.ref.boost__beast__http__verb `net::post`].
50114    ]
50115  ]
50116]
50117[heading Remarks]
50118The completion handler will receive as a parameter the total number of bytes transferred from the stream. This may be zero for the case where there is sufficient pre-existing message data in the dynamic buffer. The implementation will call [link beast.ref.boost__beast__http__basic_parser.eager `basic_parser::eager`] with the value `true` on the parser passed in.
50119
50120
50121[endsect]
50122
50123[section:overload2 http::async_read (2 of 2 overloads)]
50124
50125Read a complete message asynchronously from a stream.
50126[heading Synopsis]
50127Defined in header [include_file boost/beast/http/read.hpp]
50128
50129```
50130template<
50131    class __AsyncReadStream__,
50132    class __DynamicBuffer__,
50133    bool isRequest,
50134    class __Body__,
50135    class __Allocator__,
50136    class __ReadHandler__ = net::default_completion_token_t<            executor_type<AsyncReadStream>>>
50137``__deduced__``
50138async_read(
50139    AsyncReadStream& stream,
50140    DynamicBuffer& buffer,
50141    message< isRequest, Body, basic_fields< Allocator >>& msg,
50142    ReadHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncReadStream >>{});
50143```
50144
50145[heading Description]
50146This function is used to asynchronously read a complete message from a stream into an instance of [link beast.ref.boost__beast__http__message `message`]. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
50147
50148* The entire message is read in.
50149
50150* An error occurs.
50151
50152This operation is implemented in terms of zero or more calls to the next layer's `async_read_some` function, and is known as a ['composed operation]. The program must ensure that the stream performs no other reads until this operation completes. The implementation may read additional bytes from the stream that lie past the end of the message being read. These additional bytes are stored in the dynamic buffer, which must be preserved for subsequent reads.
50153If the end of file error is received while reading from the stream, then the error returned from this function will be:
50154
50155* [link beast.ref.boost__beast__http__error `error::end_of_stream`] if no bytes were parsed, or
50156
50157* [link beast.ref.boost__beast__http__error `error::partial_message`] if any bytes were parsed but the message was incomplete, otherwise:
50158
50159* A successful result. The next attempt to read will return [link beast.ref.boost__beast__http__error `error::end_of_stream`]
50160
50161[heading Parameters]
50162[table [[Name][Description]]
50163  [
50164    [`stream`
50165    ]
50166    [
50167The stream from which the data is to be read. The type must meet the ['AsyncReadStream] requirements.
50168    ]
50169  ]
50170  [
50171    [`buffer`
50172    ]
50173    [
50174Storage for additional bytes read by the implementation from the stream. This is both an input and an output parameter; on entry, the parser will be presented with any remaining data in the dynamic buffer's readable bytes sequence first. The type must meet the ['DynamicBuffer] requirements. The object must remain valid at least until the handler is called; ownership is not transferred.
50175    ]
50176  ]
50177  [
50178    [`msg`
50179    ]
50180    [
50181The container in which to store the message contents. This message container should not have previous contents, otherwise the behavior is undefined. The type must be meet the ['MoveAssignable] and ['MoveConstructible] requirements. The object must remain valid at least until the handler is called; ownership is not transferred.
50182    ]
50183  ]
50184  [
50185    [`handler`
50186    ]
50187    [
50188
50189The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
50190```
50191void handler(
50192    error_code const& error,        // result of operation
50193    std::size_t bytes_transferred   // the total number of bytes transferred from the stream
50194);
50195```
50196
50197Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using [link beast.ref.boost__beast__http__verb `net::post`].
50198    ]
50199  ]
50200]
50201[heading Remarks]
50202The completion handler will receive as a parameter the total number of bytes transferred from the stream. This may be zero for the case where there is sufficient pre-existing message data in the dynamic buffer. The implementation will call [link beast.ref.boost__beast__http__basic_parser.eager `basic_parser::eager`] with the value `true` on the parser passed in.
50203
50204
50205[endsect]
50206
50207
50208[endsect]
50209
50210[section:boost__beast__http__validate_list http::validate_list]
50211[indexterm1 http::validate_list]
50212
50213
50214Returns `true` if a parsed list is parsed without errors.
50215[heading Synopsis]
50216Defined in header [include_file boost/beast/http/rfc7230.hpp]
50217
50218```
50219template<
50220    class Policy>
50221bool
50222validate_list(
50223    detail::basic_parsed_list< Policy > const& list);
50224```
50225
50226[heading Description]
50227This function iterates a single pass through a parsed list and returns `true` if there were no parsing errors, else returns `false`.
50228
50229
50230[endsect]
50231
50232[section:boost__beast__http__int_to_status http::int_to_status]
50233[indexterm1 http::int_to_status]
50234
50235
50236Converts the integer to a known status-code.
50237[heading Synopsis]
50238Defined in header [include_file boost/beast/http/status.hpp]
50239
50240```
50241status
50242int_to_status(
50243    unsigned v);
50244```
50245
50246[heading Description]
50247If the integer does not match a known status code, [link beast.ref.boost__beast__http__field `status::unknown`] is returned.
50248
50249
50250[endsect]
50251
50252[section:boost__beast__http__to_status_class http::to_status_class]
50253[indexterm1 http::to_status_class]
50254
50255
50256Convert an integer to a status_class.
50257```
50258status_class
50259``[link beast.ref.boost__beast__http__to_status_class.overload1 to_status_class]``(
50260    unsigned v);
50261  ``[''''&raquo;''' [link beast.ref.boost__beast__http__to_status_class.overload1 `more...`]]``
50262```
50263
50264
50265Convert a status_code to a status_class.
50266```
50267status_class
50268``[link beast.ref.boost__beast__http__to_status_class.overload2 to_status_class]``(
50269    status v);
50270  ``[''''&raquo;''' [link beast.ref.boost__beast__http__to_status_class.overload2 `more...`]]``
50271```
50272
50273[section:overload1 http::to_status_class (1 of 2 overloads)]
50274
50275Convert an integer to a status_class.
50276[heading Synopsis]
50277Defined in header [include_file boost/beast/http/status.hpp]
50278
50279```
50280status_class
50281to_status_class(
50282    unsigned v);
50283```
50284
50285[heading Description]
50286
50287[heading Parameters]
50288[table [[Name][Description]]
50289  [
50290    [`v`
50291    ]
50292    [
50293The integer representing a status code.
50294    ]
50295  ]
50296]
50297[heading Return Value]
50298The status class. If the integer does not match a known status class, [link beast.ref.boost__beast__http__field `status_class::unknown`] is returned.
50299
50300
50301[endsect]
50302
50303[section:overload2 http::to_status_class (2 of 2 overloads)]
50304
50305Convert a status_code to a status_class.
50306[heading Synopsis]
50307Defined in header [include_file boost/beast/http/status.hpp]
50308
50309```
50310status_class
50311to_status_class(
50312    status v);
50313```
50314
50315[heading Description]
50316
50317[heading Parameters]
50318[table [[Name][Description]]
50319  [
50320    [`v`
50321    ]
50322    [
50323The status code to convert.
50324    ]
50325  ]
50326]
50327[heading Return Value]
50328The status class.
50329
50330
50331[endsect]
50332
50333
50334[endsect]
50335
50336[section:boost__beast__http__obsolete_reason http::obsolete_reason]
50337[indexterm1 http::obsolete_reason]
50338
50339
50340Returns the obsolete reason-phrase text for a status code.
50341[heading Synopsis]
50342Defined in header [include_file boost/beast/http/status.hpp]
50343
50344```
50345string_view
50346obsolete_reason(
50347    status v);
50348```
50349
50350[heading Description]
50351
50352[heading Parameters]
50353[table [[Name][Description]]
50354  [
50355    [`v`
50356    ]
50357    [
50358The status code to use.
50359    ]
50360  ]
50361]
50362
50363
50364[endsect]
50365
50366[section:boost__beast__http__string_to_verb http::string_to_verb]
50367[indexterm1 http::string_to_verb]
50368
50369
50370Converts a string to the request method verb.
50371[heading Synopsis]
50372Defined in header [include_file boost/beast/http/verb.hpp]
50373
50374```
50375verb
50376string_to_verb(
50377    string_view s);
50378```
50379
50380[heading Description]
50381If the string does not match a known request method, [link beast.ref.boost__beast__http__field `verb::unknown`] is returned.
50382
50383
50384[endsect]
50385
50386[section:boost__beast__http__write_some http::write_some]
50387[indexterm1 http::write_some]
50388
50389
50390Write part of a message to a stream using a serializer.
50391```
50392template<
50393    class __SyncWriteStream__,
50394    bool isRequest,
50395    class __Body__,
50396    class __Fields__>
50397std::size_t
50398``[link beast.ref.boost__beast__http__write_some.overload1 write_some]``(
50399    SyncWriteStream& stream,
50400    serializer< isRequest, Body, Fields >& sr);
50401  ``[''''&raquo;''' [link beast.ref.boost__beast__http__write_some.overload1 `more...`]]``
50402
50403template<
50404    class __SyncWriteStream__,
50405    bool isRequest,
50406    class __Body__,
50407    class __Fields__>
50408std::size_t
50409``[link beast.ref.boost__beast__http__write_some.overload2 write_some]``(
50410    SyncWriteStream& stream,
50411    serializer< isRequest, Body, Fields >& sr,
50412    error_code& ec);
50413  ``[''''&raquo;''' [link beast.ref.boost__beast__http__write_some.overload2 `more...`]]``
50414```
50415
50416[section:overload1 http::write_some (1 of 2 overloads)]
50417
50418Write part of a message to a stream using a serializer.
50419[heading Synopsis]
50420Defined in header [include_file boost/beast/http/write.hpp]
50421
50422```
50423template<
50424    class __SyncWriteStream__,
50425    bool isRequest,
50426    class __Body__,
50427    class __Fields__>
50428std::size_t
50429write_some(
50430    SyncWriteStream& stream,
50431    serializer< isRequest, Body, Fields >& sr);
50432```
50433
50434[heading Description]
50435This function is used to write part of a message to a stream using a caller-provided HTTP/1 serializer. The call will block until one of the following conditions is true:
50436
50437* One or more bytes have been transferred.
50438
50439* The function [link beast.ref.boost__beast__http__serializer.is_done `serializer::is_done`] returns `true`
50440
50441* An error occurs on the stream.
50442
50443This operation is implemented in terms of one or more calls to the stream's `write_some` function.
50444The amount of data actually transferred is controlled by the behavior of the underlying stream, subject to the buffer size limit of the serializer obtained or set through a call to [link beast.ref.boost__beast__http__serializer.limit `serializer::limit`]. Setting a limit and performing bounded work helps applications set reasonable timeouts. It also allows application-level flow control to function correctly. For example when using a TCP/IP based stream.
50445
50446[heading Parameters]
50447[table [[Name][Description]]
50448  [
50449    [`stream`
50450    ]
50451    [
50452The stream to which the data is to be written. The type must support the ['SyncWriteStream] concept.
50453    ]
50454  ]
50455  [
50456    [`sr`
50457    ]
50458    [
50459The serializer to use.
50460    ]
50461  ]
50462]
50463[heading Return Value]
50464The number of bytes written to the stream.
50465[heading Exceptions]
50466[table [[Type][Thrown On]]
50467  [
50468    [`system_error`
50469    ]
50470    [
50471Thrown on failure.
50472    ]
50473  ]
50474]
50475[heading See Also]
50476[link beast.ref.boost__beast__http__serializer `serializer`]
50477
50478
50479[endsect]
50480
50481[section:overload2 http::write_some (2 of 2 overloads)]
50482
50483Write part of a message to a stream using a serializer.
50484[heading Synopsis]
50485Defined in header [include_file boost/beast/http/write.hpp]
50486
50487```
50488template<
50489    class __SyncWriteStream__,
50490    bool isRequest,
50491    class __Body__,
50492    class __Fields__>
50493std::size_t
50494write_some(
50495    SyncWriteStream& stream,
50496    serializer< isRequest, Body, Fields >& sr,
50497    error_code& ec);
50498```
50499
50500[heading Description]
50501This function is used to write part of a message to a stream using a caller-provided HTTP/1 serializer. The call will block until one of the following conditions is true:
50502
50503* One or more bytes have been transferred.
50504
50505* The function [link beast.ref.boost__beast__http__serializer.is_done `serializer::is_done`] returns `true`
50506
50507* An error occurs on the stream.
50508
50509This operation is implemented in terms of one or more calls to the stream's `write_some` function.
50510The amount of data actually transferred is controlled by the behavior of the underlying stream, subject to the buffer size limit of the serializer obtained or set through a call to [link beast.ref.boost__beast__http__serializer.limit `serializer::limit`]. Setting a limit and performing bounded work helps applications set reasonable timeouts. It also allows application-level flow control to function correctly. For example when using a TCP/IP based stream.
50511
50512[heading Parameters]
50513[table [[Name][Description]]
50514  [
50515    [`stream`
50516    ]
50517    [
50518The stream to which the data is to be written. The type must support the ['SyncWriteStream] concept.
50519    ]
50520  ]
50521  [
50522    [`sr`
50523    ]
50524    [
50525The serializer to use.
50526    ]
50527  ]
50528  [
50529    [`ec`
50530    ]
50531    [
50532Set to indicate what error occurred, if any.
50533    ]
50534  ]
50535]
50536[heading Return Value]
50537The number of bytes written to the stream.
50538[heading See Also]
50539[link beast.ref.boost__beast__http__async_write_some `async_write_some`], [link beast.ref.boost__beast__http__serializer `serializer`]
50540
50541
50542[endsect]
50543
50544
50545[endsect]
50546
50547[section:boost__beast__http__async_write_some http::async_write_some]
50548[indexterm1 http::async_write_some]
50549
50550
50551Write part of a message to a stream asynchronously using a serializer.
50552[heading Synopsis]
50553Defined in header [include_file boost/beast/http/write.hpp]
50554
50555```
50556template<
50557    class __AsyncWriteStream__,
50558    bool isRequest,
50559    class __Body__,
50560    class __Fields__,
50561    class __WriteHandler__ = net::default_completion_token_t<            executor_type<AsyncWriteStream>>>
50562``__deduced__``
50563async_write_some(
50564    AsyncWriteStream& stream,
50565    serializer< isRequest, Body, Fields >& sr,
50566    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncWriteStream >>{});
50567```
50568
50569[heading Description]
50570This function is used to write part of a message to a stream asynchronously using a caller-provided HTTP/1 serializer. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
50571
50572* One or more bytes have been transferred.
50573
50574* The function [link beast.ref.boost__beast__http__serializer.is_done `serializer::is_done`] returns `true`
50575
50576* An error occurs on the stream.
50577
50578This operation is implemented in terms of zero or more calls to the stream's `async_write_some` function, and is known as a ['composed operation]. The program must ensure that the stream performs no other writes until this operation completes.
50579The amount of data actually transferred is controlled by the behavior of the underlying stream, subject to the buffer size limit of the serializer obtained or set through a call to [link beast.ref.boost__beast__http__serializer.limit `serializer::limit`]. Setting a limit and performing bounded work helps applications set reasonable timeouts. It also allows application-level flow control to function correctly. For example when using a TCP/IP based stream.
50580
50581[heading Parameters]
50582[table [[Name][Description]]
50583  [
50584    [`stream`
50585    ]
50586    [
50587The stream to which the data is to be written. The type must support the ['AsyncWriteStream] concept.
50588    ]
50589  ]
50590  [
50591    [`sr`
50592    ]
50593    [
50594The serializer to use. The object must remain valid at least until the handler is called; ownership is not transferred.
50595    ]
50596  ]
50597  [
50598    [`handler`
50599    ]
50600    [
50601
50602The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
50603```
50604void handler(
50605    error_code const& error,        // result of operation
50606    std::size_t bytes_transferred   // the number of bytes written to the stream
50607);
50608```
50609
50610Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using [link beast.ref.boost__beast__http__verb `net::post`].
50611    ]
50612  ]
50613]
50614[heading See Also]
50615[link beast.ref.boost__beast__http__serializer `serializer`]
50616
50617
50618[endsect]
50619
50620[section:boost__beast__http__write_header http::write_header]
50621[indexterm1 http::write_header]
50622
50623
50624Write a header to a stream using a serializer.
50625```
50626template<
50627    class __SyncWriteStream__,
50628    bool isRequest,
50629    class __Body__,
50630    class __Fields__>
50631std::size_t
50632``[link beast.ref.boost__beast__http__write_header.overload1 write_header]``(
50633    SyncWriteStream& stream,
50634    serializer< isRequest, Body, Fields >& sr);
50635  ``[''''&raquo;''' [link beast.ref.boost__beast__http__write_header.overload1 `more...`]]``
50636
50637template<
50638    class __SyncWriteStream__,
50639    bool isRequest,
50640    class __Body__,
50641    class __Fields__>
50642std::size_t
50643``[link beast.ref.boost__beast__http__write_header.overload2 write_header]``(
50644    SyncWriteStream& stream,
50645    serializer< isRequest, Body, Fields >& sr,
50646    error_code& ec);
50647  ``[''''&raquo;''' [link beast.ref.boost__beast__http__write_header.overload2 `more...`]]``
50648```
50649
50650[section:overload1 http::write_header (1 of 2 overloads)]
50651
50652Write a header to a stream using a serializer.
50653[heading Synopsis]
50654Defined in header [include_file boost/beast/http/write.hpp]
50655
50656```
50657template<
50658    class __SyncWriteStream__,
50659    bool isRequest,
50660    class __Body__,
50661    class __Fields__>
50662std::size_t
50663write_header(
50664    SyncWriteStream& stream,
50665    serializer< isRequest, Body, Fields >& sr);
50666```
50667
50668[heading Description]
50669This function is used to write a header to a stream using a caller-provided HTTP/1 serializer. The call will block until one of the following conditions is true:
50670
50671* The function [link beast.ref.boost__beast__http__serializer.is_header_done `serializer::is_header_done`] returns `true`
50672
50673* An error occurs.
50674
50675This operation is implemented in terms of one or more calls to the stream's `write_some` function.
50676
50677[heading Parameters]
50678[table [[Name][Description]]
50679  [
50680    [`stream`
50681    ]
50682    [
50683The stream to which the data is to be written. The type must support the ['SyncWriteStream] concept.
50684    ]
50685  ]
50686  [
50687    [`sr`
50688    ]
50689    [
50690The serializer to use.
50691    ]
50692  ]
50693]
50694[heading Return Value]
50695The number of bytes written to the stream.
50696[heading Exceptions]
50697[table [[Type][Thrown On]]
50698  [
50699    [`system_error`
50700    ]
50701    [
50702Thrown on failure.
50703    ]
50704  ]
50705]
50706[heading Remarks]
50707The implementation will call [link beast.ref.boost__beast__http__serializer.split `serializer::split`] with the value `true` on the serializer passed in.
50708[heading See Also]
50709[link beast.ref.boost__beast__http__serializer `serializer`]
50710
50711
50712[endsect]
50713
50714[section:overload2 http::write_header (2 of 2 overloads)]
50715
50716Write a header to a stream using a serializer.
50717[heading Synopsis]
50718Defined in header [include_file boost/beast/http/write.hpp]
50719
50720```
50721template<
50722    class __SyncWriteStream__,
50723    bool isRequest,
50724    class __Body__,
50725    class __Fields__>
50726std::size_t
50727write_header(
50728    SyncWriteStream& stream,
50729    serializer< isRequest, Body, Fields >& sr,
50730    error_code& ec);
50731```
50732
50733[heading Description]
50734This function is used to write a header to a stream using a caller-provided HTTP/1 serializer. The call will block until one of the following conditions is true:
50735
50736* The function [link beast.ref.boost__beast__http__serializer.is_header_done `serializer::is_header_done`] returns `true`
50737
50738* An error occurs.
50739
50740This operation is implemented in terms of one or more calls to the stream's `write_some` function.
50741
50742[heading Parameters]
50743[table [[Name][Description]]
50744  [
50745    [`stream`
50746    ]
50747    [
50748The stream to which the data is to be written. The type must support the ['SyncWriteStream] concept.
50749    ]
50750  ]
50751  [
50752    [`sr`
50753    ]
50754    [
50755The serializer to use.
50756    ]
50757  ]
50758  [
50759    [`ec`
50760    ]
50761    [
50762Set to indicate what error occurred, if any.
50763    ]
50764  ]
50765]
50766[heading Return Value]
50767The number of bytes written to the stream.
50768[heading Remarks]
50769The implementation will call [link beast.ref.boost__beast__http__serializer.split `serializer::split`] with the value `true` on the serializer passed in.
50770[heading See Also]
50771[link beast.ref.boost__beast__http__serializer `serializer`]
50772
50773
50774[endsect]
50775
50776
50777[endsect]
50778
50779[section:boost__beast__http__async_write_header http::async_write_header]
50780[indexterm1 http::async_write_header]
50781
50782
50783Write a header to a stream asynchronously using a serializer.
50784[heading Synopsis]
50785Defined in header [include_file boost/beast/http/write.hpp]
50786
50787```
50788template<
50789    class __AsyncWriteStream__,
50790    bool isRequest,
50791    class __Body__,
50792    class __Fields__,
50793    class __WriteHandler__ = net::default_completion_token_t<            executor_type<AsyncWriteStream>>>
50794``__deduced__``
50795async_write_header(
50796    AsyncWriteStream& stream,
50797    serializer< isRequest, Body, Fields >& sr,
50798    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncWriteStream >>{});
50799```
50800
50801[heading Description]
50802This function is used to write a header to a stream asynchronously using a caller-provided HTTP/1 serializer. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
50803
50804* The function [link beast.ref.boost__beast__http__serializer.is_header_done `serializer::is_header_done`] returns `true`
50805
50806* An error occurs.
50807
50808This operation is implemented in terms of zero or more calls to the stream's `async_write_some` function, and is known as a ['composed operation]. The program must ensure that the stream performs no other writes until this operation completes.
50809
50810[heading Parameters]
50811[table [[Name][Description]]
50812  [
50813    [`stream`
50814    ]
50815    [
50816The stream to which the data is to be written. The type must support the ['AsyncWriteStream] concept.
50817    ]
50818  ]
50819  [
50820    [`sr`
50821    ]
50822    [
50823The serializer to use. The object must remain valid at least until the handler is called; ownership is not transferred.
50824    ]
50825  ]
50826  [
50827    [`handler`
50828    ]
50829    [
50830
50831The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
50832```
50833void handler(
50834    error_code const& error,        // result of operation
50835    std::size_t bytes_transferred   // the number of bytes written to the stream
50836);
50837```
50838
50839Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using [link beast.ref.boost__beast__http__verb `net::post`].
50840    ]
50841  ]
50842]
50843[heading Remarks]
50844The implementation will call [link beast.ref.boost__beast__http__serializer.split `serializer::split`] with the value `true` on the serializer passed in.
50845[heading See Also]
50846[link beast.ref.boost__beast__http__serializer `serializer`]
50847
50848
50849[endsect]
50850
50851[section:boost__beast__http__write http::write]
50852[indexterm1 http::write]
50853
50854
50855Write a complete message to a stream using a serializer.
50856```
50857template<
50858    class __SyncWriteStream__,
50859    bool isRequest,
50860    class __Body__,
50861    class __Fields__>
50862std::size_t
50863``[link beast.ref.boost__beast__http__write.overload1 write]``(
50864    SyncWriteStream& stream,
50865    serializer< isRequest, Body, Fields >& sr);
50866  ``[''''&raquo;''' [link beast.ref.boost__beast__http__write.overload1 `more...`]]``
50867
50868template<
50869    class __SyncWriteStream__,
50870    bool isRequest,
50871    class __Body__,
50872    class __Fields__>
50873std::size_t
50874``[link beast.ref.boost__beast__http__write.overload2 write]``(
50875    SyncWriteStream& stream,
50876    serializer< isRequest, Body, Fields >& sr,
50877    error_code& ec);
50878  ``[''''&raquo;''' [link beast.ref.boost__beast__http__write.overload2 `more...`]]``
50879```
50880
50881
50882Write a complete message to a stream.
50883```
50884template<
50885    class __SyncWriteStream__,
50886    bool isRequest,
50887    class __Body__,
50888    class __Fields__>
50889std::size_t
50890``[link beast.ref.boost__beast__http__write.overload3 write]``(
50891    SyncWriteStream& stream,
50892    message< isRequest, Body, Fields >& msg);
50893  ``[''''&raquo;''' [link beast.ref.boost__beast__http__write.overload3 `more...`]]``
50894
50895template<
50896    class __SyncWriteStream__,
50897    bool isRequest,
50898    class __Body__,
50899    class __Fields__>
50900std::size_t
50901``[link beast.ref.boost__beast__http__write.overload4 write]``(
50902    SyncWriteStream& stream,
50903    message< isRequest, Body, Fields > const& msg);
50904  ``[''''&raquo;''' [link beast.ref.boost__beast__http__write.overload4 `more...`]]``
50905
50906template<
50907    class __SyncWriteStream__,
50908    bool isRequest,
50909    class __Body__,
50910    class __Fields__>
50911std::size_t
50912``[link beast.ref.boost__beast__http__write.overload5 write]``(
50913    SyncWriteStream& stream,
50914    message< isRequest, Body, Fields >& msg,
50915    error_code& ec);
50916  ``[''''&raquo;''' [link beast.ref.boost__beast__http__write.overload5 `more...`]]``
50917
50918template<
50919    class __SyncWriteStream__,
50920    bool isRequest,
50921    class __Body__,
50922    class __Fields__>
50923std::size_t
50924``[link beast.ref.boost__beast__http__write.overload6 write]``(
50925    SyncWriteStream& stream,
50926    message< isRequest, Body, Fields > const& msg,
50927    error_code& ec);
50928  ``[''''&raquo;''' [link beast.ref.boost__beast__http__write.overload6 `more...`]]``
50929```
50930
50931[section:overload1 http::write (1 of 6 overloads)]
50932
50933Write a complete message to a stream using a serializer.
50934[heading Synopsis]
50935Defined in header [include_file boost/beast/http/write.hpp]
50936
50937```
50938template<
50939    class __SyncWriteStream__,
50940    bool isRequest,
50941    class __Body__,
50942    class __Fields__>
50943std::size_t
50944write(
50945    SyncWriteStream& stream,
50946    serializer< isRequest, Body, Fields >& sr);
50947```
50948
50949[heading Description]
50950This function is used to write a complete message to a stream using a caller-provided HTTP/1 serializer. The call will block until one of the following conditions is true:
50951
50952* The function [link beast.ref.boost__beast__http__serializer.is_done `serializer::is_done`] returns `true`
50953
50954* An error occurs.
50955
50956This operation is implemented in terms of one or more calls to the stream's `write_some` function.
50957
50958[heading Parameters]
50959[table [[Name][Description]]
50960  [
50961    [`stream`
50962    ]
50963    [
50964The stream to which the data is to be written. The type must support the ['SyncWriteStream] concept.
50965    ]
50966  ]
50967  [
50968    [`sr`
50969    ]
50970    [
50971The serializer to use.
50972    ]
50973  ]
50974]
50975[heading Return Value]
50976The number of bytes written to the stream.
50977[heading Exceptions]
50978[table [[Type][Thrown On]]
50979  [
50980    [`system_error`
50981    ]
50982    [
50983Thrown on failure.
50984    ]
50985  ]
50986]
50987[heading See Also]
50988[link beast.ref.boost__beast__http__serializer `serializer`]
50989
50990
50991[endsect]
50992
50993[section:overload2 http::write (2 of 6 overloads)]
50994
50995Write a complete message to a stream using a serializer.
50996[heading Synopsis]
50997Defined in header [include_file boost/beast/http/write.hpp]
50998
50999```
51000template<
51001    class __SyncWriteStream__,
51002    bool isRequest,
51003    class __Body__,
51004    class __Fields__>
51005std::size_t
51006write(
51007    SyncWriteStream& stream,
51008    serializer< isRequest, Body, Fields >& sr,
51009    error_code& ec);
51010```
51011
51012[heading Description]
51013This function is used to write a complete message to a stream using a caller-provided HTTP/1 serializer. The call will block until one of the following conditions is true:
51014
51015* The function [link beast.ref.boost__beast__http__serializer.is_done `serializer::is_done`] returns `true`
51016
51017* An error occurs.
51018
51019This operation is implemented in terms of one or more calls to the stream's `write_some` function.
51020
51021[heading Parameters]
51022[table [[Name][Description]]
51023  [
51024    [`stream`
51025    ]
51026    [
51027The stream to which the data is to be written. The type must support the ['SyncWriteStream] concept.
51028    ]
51029  ]
51030  [
51031    [`sr`
51032    ]
51033    [
51034The serializer to use.
51035    ]
51036  ]
51037  [
51038    [`ec`
51039    ]
51040    [
51041Set to the error, if any occurred.
51042    ]
51043  ]
51044]
51045[heading Return Value]
51046The number of bytes written to the stream.
51047[heading See Also]
51048[link beast.ref.boost__beast__http__serializer `serializer`]
51049
51050
51051[endsect]
51052
51053[section:overload3 http::write (3 of 6 overloads)]
51054
51055Write a complete message to a stream.
51056[heading Synopsis]
51057Defined in header [include_file boost/beast/http/write.hpp]
51058
51059```
51060template<
51061    class __SyncWriteStream__,
51062    bool isRequest,
51063    class __Body__,
51064    class __Fields__>
51065std::size_t
51066write(
51067    SyncWriteStream& stream,
51068    message< isRequest, Body, Fields >& msg);
51069```
51070
51071[heading Description]
51072This function is used to write a complete message to a stream using HTTP/1. The call will block until one of the following conditions is true:
51073
51074* The entire message is written.
51075
51076* An error occurs.
51077
51078This operation is implemented in terms of one or more calls to the stream's `write_some` function. The algorithm will use a temporary [link beast.ref.boost__beast__http__serializer `serializer`] with an empty chunk decorator to produce buffers.
51079
51080[heading Remarks]
51081This function only participates in overload resolution if [link beast.ref.boost__beast__http__is_mutable_body_writer `is_mutable_body_writer`] for ['Body] returns `true`.
51082[heading Parameters]
51083[table [[Name][Description]]
51084  [
51085    [`stream`
51086    ]
51087    [
51088The stream to which the data is to be written. The type must support the ['SyncWriteStream] concept.
51089    ]
51090  ]
51091  [
51092    [`msg`
51093    ]
51094    [
51095The message to write.
51096    ]
51097  ]
51098]
51099[heading Return Value]
51100The number of bytes written to the stream.
51101[heading Exceptions]
51102[table [[Type][Thrown On]]
51103  [
51104    [`system_error`
51105    ]
51106    [
51107Thrown on failure.
51108    ]
51109  ]
51110]
51111[heading See Also]
51112[link beast.ref.boost__beast__http__message `message`]
51113
51114
51115[endsect]
51116
51117[section:overload4 http::write (4 of 6 overloads)]
51118
51119Write a complete message to a stream.
51120[heading Synopsis]
51121Defined in header [include_file boost/beast/http/write.hpp]
51122
51123```
51124template<
51125    class __SyncWriteStream__,
51126    bool isRequest,
51127    class __Body__,
51128    class __Fields__>
51129std::size_t
51130write(
51131    SyncWriteStream& stream,
51132    message< isRequest, Body, Fields > const& msg);
51133```
51134
51135[heading Description]
51136This function is used to write a complete message to a stream using HTTP/1. The call will block until one of the following conditions is true:
51137
51138* The entire message is written.
51139
51140* An error occurs.
51141
51142This operation is implemented in terms of one or more calls to the stream's `write_some` function. The algorithm will use a temporary [link beast.ref.boost__beast__http__serializer `serializer`] with an empty chunk decorator to produce buffers.
51143
51144[heading Remarks]
51145This function only participates in overload resolution if [link beast.ref.boost__beast__http__is_mutable_body_writer `is_mutable_body_writer`] for ['Body] returns `false`.
51146[heading Parameters]
51147[table [[Name][Description]]
51148  [
51149    [`stream`
51150    ]
51151    [
51152The stream to which the data is to be written. The type must support the ['SyncWriteStream] concept.
51153    ]
51154  ]
51155  [
51156    [`msg`
51157    ]
51158    [
51159The message to write.
51160    ]
51161  ]
51162]
51163[heading Return Value]
51164The number of bytes written to the stream.
51165[heading Exceptions]
51166[table [[Type][Thrown On]]
51167  [
51168    [`system_error`
51169    ]
51170    [
51171Thrown on failure.
51172    ]
51173  ]
51174]
51175[heading See Also]
51176[link beast.ref.boost__beast__http__message `message`]
51177
51178
51179[endsect]
51180
51181[section:overload5 http::write (5 of 6 overloads)]
51182
51183Write a complete message to a stream.
51184[heading Synopsis]
51185Defined in header [include_file boost/beast/http/write.hpp]
51186
51187```
51188template<
51189    class __SyncWriteStream__,
51190    bool isRequest,
51191    class __Body__,
51192    class __Fields__>
51193std::size_t
51194write(
51195    SyncWriteStream& stream,
51196    message< isRequest, Body, Fields >& msg,
51197    error_code& ec);
51198```
51199
51200[heading Description]
51201This function is used to write a complete message to a stream using HTTP/1. The call will block until one of the following conditions is true:
51202
51203* The entire message is written.
51204
51205* An error occurs.
51206
51207This operation is implemented in terms of one or more calls to the stream's `write_some` function. The algorithm will use a temporary [link beast.ref.boost__beast__http__serializer `serializer`] with an empty chunk decorator to produce buffers.
51208
51209[heading Remarks]
51210This function only participates in overload resolution if [link beast.ref.boost__beast__http__is_mutable_body_writer `is_mutable_body_writer`] for ['Body] returns `true`.
51211[heading Parameters]
51212[table [[Name][Description]]
51213  [
51214    [`stream`
51215    ]
51216    [
51217The stream to which the data is to be written. The type must support the ['SyncWriteStream] concept.
51218    ]
51219  ]
51220  [
51221    [`msg`
51222    ]
51223    [
51224The message to write.
51225    ]
51226  ]
51227  [
51228    [`ec`
51229    ]
51230    [
51231Set to the error, if any occurred.
51232    ]
51233  ]
51234]
51235[heading Return Value]
51236The number of bytes written to the stream.
51237[heading See Also]
51238[link beast.ref.boost__beast__http__message `message`]
51239
51240
51241[endsect]
51242
51243[section:overload6 http::write (6 of 6 overloads)]
51244
51245Write a complete message to a stream.
51246[heading Synopsis]
51247Defined in header [include_file boost/beast/http/write.hpp]
51248
51249```
51250template<
51251    class __SyncWriteStream__,
51252    bool isRequest,
51253    class __Body__,
51254    class __Fields__>
51255std::size_t
51256write(
51257    SyncWriteStream& stream,
51258    message< isRequest, Body, Fields > const& msg,
51259    error_code& ec);
51260```
51261
51262[heading Description]
51263This function is used to write a complete message to a stream using HTTP/1. The call will block until one of the following conditions is true:
51264
51265* The entire message is written.
51266
51267* An error occurs.
51268
51269This operation is implemented in terms of one or more calls to the stream's `write_some` function. The algorithm will use a temporary [link beast.ref.boost__beast__http__serializer `serializer`] with an empty chunk decorator to produce buffers.
51270
51271[heading Remarks]
51272This function only participates in overload resolution if [link beast.ref.boost__beast__http__is_mutable_body_writer `is_mutable_body_writer`] for ['Body] returns `false`.
51273[heading Parameters]
51274[table [[Name][Description]]
51275  [
51276    [`stream`
51277    ]
51278    [
51279The stream to which the data is to be written. The type must support the ['SyncWriteStream] concept.
51280    ]
51281  ]
51282  [
51283    [`msg`
51284    ]
51285    [
51286The message to write.
51287    ]
51288  ]
51289  [
51290    [`ec`
51291    ]
51292    [
51293Set to the error, if any occurred.
51294    ]
51295  ]
51296]
51297[heading Return Value]
51298The number of bytes written to the stream.
51299[heading See Also]
51300[link beast.ref.boost__beast__http__message `message`]
51301
51302
51303[endsect]
51304
51305
51306[endsect]
51307
51308[section:boost__beast__http__async_write http::async_write]
51309[indexterm1 http::async_write]
51310
51311
51312Write a complete message to a stream asynchronously using a serializer.
51313```
51314template<
51315    class __AsyncWriteStream__,
51316    bool isRequest,
51317    class __Body__,
51318    class __Fields__,
51319    class __WriteHandler__ = net::default_completion_token_t<            executor_type<AsyncWriteStream>>>
51320``__deduced__``
51321``[link beast.ref.boost__beast__http__async_write.overload1 async_write]``(
51322    AsyncWriteStream& stream,
51323    serializer< isRequest, Body, Fields >& sr,
51324    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncWriteStream >>{});
51325  ``[''''&raquo;''' [link beast.ref.boost__beast__http__async_write.overload1 `more...`]]``
51326```
51327
51328
51329Write a complete message to a stream asynchronously.
51330```
51331template<
51332    class __AsyncWriteStream__,
51333    bool isRequest,
51334    class __Body__,
51335    class __Fields__,
51336    class __WriteHandler__ = net::default_completion_token_t<            executor_type<AsyncWriteStream>>>
51337``__deduced__``
51338``[link beast.ref.boost__beast__http__async_write.overload2 async_write]``(
51339    AsyncWriteStream& stream,
51340    message< isRequest, Body, Fields >& msg,
51341    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncWriteStream >>{});
51342  ``[''''&raquo;''' [link beast.ref.boost__beast__http__async_write.overload2 `more...`]]``
51343
51344template<
51345    class __AsyncWriteStream__,
51346    bool isRequest,
51347    class __Body__,
51348    class __Fields__,
51349    class __WriteHandler__ = net::default_completion_token_t<            executor_type<AsyncWriteStream>>>
51350``__deduced__``
51351``[link beast.ref.boost__beast__http__async_write.overload3 async_write]``(
51352    AsyncWriteStream& stream,
51353    message< isRequest, Body, Fields > const& msg,
51354    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncWriteStream >>{});
51355  ``[''''&raquo;''' [link beast.ref.boost__beast__http__async_write.overload3 `more...`]]``
51356```
51357
51358[section:overload1 http::async_write (1 of 3 overloads)]
51359
51360Write a complete message to a stream asynchronously using a serializer.
51361[heading Synopsis]
51362Defined in header [include_file boost/beast/http/write.hpp]
51363
51364```
51365template<
51366    class __AsyncWriteStream__,
51367    bool isRequest,
51368    class __Body__,
51369    class __Fields__,
51370    class __WriteHandler__ = net::default_completion_token_t<            executor_type<AsyncWriteStream>>>
51371``__deduced__``
51372async_write(
51373    AsyncWriteStream& stream,
51374    serializer< isRequest, Body, Fields >& sr,
51375    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncWriteStream >>{});
51376```
51377
51378[heading Description]
51379This function is used to write a complete message to a stream asynchronously using a caller-provided HTTP/1 serializer. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
51380
51381* The function [link beast.ref.boost__beast__http__serializer.is_done `serializer::is_done`] returns `true`
51382
51383* An error occurs.
51384
51385This operation is implemented in terms of zero or more calls to the stream's `async_write_some` function, and is known as a ['composed operation]. The program must ensure that the stream performs no other writes until this operation completes.
51386
51387[heading Parameters]
51388[table [[Name][Description]]
51389  [
51390    [`stream`
51391    ]
51392    [
51393The stream to which the data is to be written. The type must support the ['AsyncWriteStream] concept.
51394    ]
51395  ]
51396  [
51397    [`sr`
51398    ]
51399    [
51400The serializer to use. The object must remain valid at least until the handler is called; ownership is not transferred.
51401    ]
51402  ]
51403  [
51404    [`handler`
51405    ]
51406    [
51407
51408The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
51409```
51410void handler(
51411    error_code const& error,        // result of operation
51412    std::size_t bytes_transferred   // the number of bytes written to the stream
51413);
51414```
51415
51416Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using [link beast.ref.boost__beast__http__verb `net::post`].
51417    ]
51418  ]
51419]
51420[heading See Also]
51421[link beast.ref.boost__beast__http__serializer `serializer`]
51422
51423
51424[endsect]
51425
51426[section:overload2 http::async_write (2 of 3 overloads)]
51427
51428Write a complete message to a stream asynchronously.
51429[heading Synopsis]
51430Defined in header [include_file boost/beast/http/write.hpp]
51431
51432```
51433template<
51434    class __AsyncWriteStream__,
51435    bool isRequest,
51436    class __Body__,
51437    class __Fields__,
51438    class __WriteHandler__ = net::default_completion_token_t<            executor_type<AsyncWriteStream>>>
51439``__deduced__``
51440async_write(
51441    AsyncWriteStream& stream,
51442    message< isRequest, Body, Fields >& msg,
51443    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncWriteStream >>{});
51444```
51445
51446[heading Description]
51447This function is used to write a complete message to a stream asynchronously using HTTP/1. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
51448
51449* The entire message is written.
51450
51451* An error occurs.
51452
51453This operation is implemented in terms of zero or more calls to the stream's `async_write_some` function, and is known as a ['composed operation]. The program must ensure that the stream performs no other writes until this operation completes. The algorithm will use a temporary [link beast.ref.boost__beast__http__serializer `serializer`] with an empty chunk decorator to produce buffers.
51454
51455[heading Remarks]
51456This function only participates in overload resolution if [link beast.ref.boost__beast__http__is_mutable_body_writer `is_mutable_body_writer`] for ['Body] returns `true`.
51457[heading Parameters]
51458[table [[Name][Description]]
51459  [
51460    [`stream`
51461    ]
51462    [
51463The stream to which the data is to be written. The type must support the ['AsyncWriteStream] concept.
51464    ]
51465  ]
51466  [
51467    [`msg`
51468    ]
51469    [
51470The message to write. The object must remain valid at least until the handler is called; ownership is not transferred.
51471    ]
51472  ]
51473  [
51474    [`handler`
51475    ]
51476    [
51477
51478The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
51479```
51480void handler(
51481    error_code const& error,        // result of operation
51482    std::size_t bytes_transferred   // the number of bytes written to the stream
51483);
51484```
51485
51486Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using [link beast.ref.boost__beast__http__verb `net::post`].
51487    ]
51488  ]
51489]
51490[heading See Also]
51491[link beast.ref.boost__beast__http__message `message`]
51492
51493
51494[endsect]
51495
51496[section:overload3 http::async_write (3 of 3 overloads)]
51497
51498Write a complete message to a stream asynchronously.
51499[heading Synopsis]
51500Defined in header [include_file boost/beast/http/write.hpp]
51501
51502```
51503template<
51504    class __AsyncWriteStream__,
51505    bool isRequest,
51506    class __Body__,
51507    class __Fields__,
51508    class __WriteHandler__ = net::default_completion_token_t<            executor_type<AsyncWriteStream>>>
51509``__deduced__``
51510async_write(
51511    AsyncWriteStream& stream,
51512    message< isRequest, Body, Fields > const& msg,
51513    WriteHandler&& handler = net::default_completion_token_t< ``[link beast.ref.boost__beast__executor_type executor_type]``< AsyncWriteStream >>{});
51514```
51515
51516[heading Description]
51517This function is used to write a complete message to a stream asynchronously using HTTP/1. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
51518
51519* The entire message is written.
51520
51521* An error occurs.
51522
51523This operation is implemented in terms of zero or more calls to the stream's `async_write_some` function, and is known as a ['composed operation]. The program must ensure that the stream performs no other writes until this operation completes. The algorithm will use a temporary [link beast.ref.boost__beast__http__serializer `serializer`] with an empty chunk decorator to produce buffers.
51524
51525[heading Remarks]
51526This function only participates in overload resolution if [link beast.ref.boost__beast__http__is_mutable_body_writer `is_mutable_body_writer`] for ['Body] returns `false`.
51527[heading Parameters]
51528[table [[Name][Description]]
51529  [
51530    [`stream`
51531    ]
51532    [
51533The stream to which the data is to be written. The type must support the ['AsyncWriteStream] concept.
51534    ]
51535  ]
51536  [
51537    [`msg`
51538    ]
51539    [
51540The message to write. The object must remain valid at least until the handler is called; ownership is not transferred.
51541    ]
51542  ]
51543  [
51544    [`handler`
51545    ]
51546    [
51547
51548The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
51549```
51550void handler(
51551    error_code const& error,        // result of operation
51552    std::size_t bytes_transferred   // the number of bytes written to the stream
51553);
51554```
51555
51556Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using [link beast.ref.boost__beast__http__verb `net::post`].
51557    ]
51558  ]
51559]
51560[heading See Also]
51561[link beast.ref.boost__beast__http__message `message`]
51562
51563
51564[endsect]
51565
51566
51567[endsect]
51568
51569[section:boost__beast__test__error test::error]
51570[indexterm1 test::error]
51571
51572
51573Error codes returned from unit testing algorithms.
51574[heading Synopsis]
51575Defined in header [include_file boost/beast/_experimental/test/error.hpp]
51576
51577```
51578enum error
51579```
51580
51581[heading Values]
51582[table [[Name][Description]]
51583  [
51584    [`test_failure`
51585    ]
51586    [
51587
51588The test stream generated a simulated testing error.
51589
51590This error is returned by a @ref fail_count object
51591when it generates a simulated error.
51592
51593    ]
51594  ]
51595]
51596[heading Description]
51597
51598
51599[endsect]
51600
51601[section:boost__beast__test__success_handler test::success_handler]
51602[indexterm1 test::success_handler]
51603
51604
51605Return a test CompletionHandler which requires success.
51606[heading Synopsis]
51607Defined in header [include_file boost/beast/_experimental/test/handler.hpp]
51608
51609```
51610handler
51611success_handler();
51612```
51613
51614[heading Description]
51615The returned handler can be invoked with any signature whose first parameter is an `error_code`. The handler fails the test if:
51616
51617* The handler is destroyed without being invoked, or
51618
51619* The handler is invoked with a non-successful error code.
51620
51621
51622
51623[endsect]
51624
51625[section:boost__beast__test__any_handler test::any_handler]
51626[indexterm1 test::any_handler]
51627
51628
51629Return a test CompletionHandler which requires invocation.
51630[heading Synopsis]
51631Defined in header [include_file boost/beast/_experimental/test/handler.hpp]
51632
51633```
51634handler
51635any_handler();
51636```
51637
51638[heading Description]
51639The returned handler can be invoked with any signature. The handler fails the test if:
51640
51641* The handler is destroyed without being invoked.
51642
51643
51644
51645[endsect]
51646
51647[section:boost__beast__test__fail_handler test::fail_handler]
51648[indexterm1 test::fail_handler]
51649
51650
51651Return a test CompletionHandler which requires a specific error code.
51652[heading Synopsis]
51653Defined in header [include_file boost/beast/_experimental/test/handler.hpp]
51654
51655```
51656handler
51657fail_handler(
51658    error_code ec);
51659```
51660
51661[heading Description]
51662This handler can be invoked with any signature whose first parameter is an `error_code`. The handler fails the test if:
51663
51664* The handler is destroyed without being invoked.
51665
51666* The handler is invoked with an error code different from what is specified.
51667
51668[heading Parameters]
51669[table [[Name][Description]]
51670  [
51671    [`ec`
51672    ]
51673    [
51674The error code to specify.
51675    ]
51676  ]
51677]
51678
51679
51680[endsect]
51681
51682[section:boost__beast__test__run test::run]
51683[indexterm1 test::run]
51684
51685
51686Run an I/O context.
51687[heading Synopsis]
51688Defined in header [include_file boost/beast/_experimental/test/handler.hpp]
51689
51690```
51691void
51692run(
51693    net::io_context& ioc);
51694```
51695
51696[heading Description]
51697This function runs and dispatches handlers on the specified I/O context, until one of the following conditions is true:
51698
51699* The I/O context runs out of work.
51700
51701[heading Parameters]
51702[table [[Name][Description]]
51703  [
51704    [`ioc`
51705    ]
51706    [
51707The I/O context to run
51708    ]
51709  ]
51710]
51711
51712
51713[endsect]
51714
51715[section:boost__beast__test__run_for test::run_for]
51716[indexterm1 test::run_for]
51717
51718
51719Run an I/O context for a certain amount of time.
51720[heading Synopsis]
51721Defined in header [include_file boost/beast/_experimental/test/handler.hpp]
51722
51723```
51724template<
51725    class Rep,
51726    class Period>
51727void
51728run_for(
51729    net::io_context& ioc,
51730    std::chrono::duration< Rep, Period > elapsed);
51731```
51732
51733[heading Description]
51734This function runs and dispatches handlers on the specified I/O context, until one of the following conditions is true:
51735
51736* The I/O context runs out of work.
51737
51738* No completions occur and the specified amount of time has elapsed.
51739
51740[heading Parameters]
51741[table [[Name][Description]]
51742  [
51743    [`ioc`
51744    ]
51745    [
51746The I/O context to run
51747    ]
51748  ]
51749  [
51750    [`elapsed`
51751    ]
51752    [
51753The maximum amount of time to run for.
51754    ]
51755  ]
51756]
51757
51758
51759[endsect]
51760
51761[section:boost__beast__test__connect test::connect]
51762[indexterm1 test::connect]
51763
51764
51765Return a new stream connected to the given stream.
51766```
51767template<
51768    class... Args>
51769stream
51770``[link beast.ref.boost__beast__test__connect.overload1 connect]``(
51771    stream& to,
51772    Args&&... args);
51773  ``[''''&raquo;''' [link beast.ref.boost__beast__test__connect.overload1 `more...`]]``
51774```
51775
51776
51777Connect two TCP sockets together.
51778```
51779template<
51780    class __Executor__>
51781bool
51782``[link beast.ref.boost__beast__test__connect.overload2 connect]``(
51783    net::basic_stream_socket< net::ip::tcp, Executor >& s1,
51784    net::basic_stream_socket< net::ip::tcp, Executor >& s2);
51785  ``[''''&raquo;''' [link beast.ref.boost__beast__test__connect.overload2 `more...`]]``
51786```
51787
51788[section:overload1 test::connect (1 of 2 overloads)]
51789
51790Return a new stream connected to the given stream.
51791[heading Synopsis]
51792Defined in header [include_file boost/beast/_experimental/test/stream.hpp]
51793
51794```
51795template<
51796    class... Args>
51797stream
51798connect(
51799    stream& to,
51800    Args&&... args);
51801```
51802
51803[heading Description]
51804
51805[heading Parameters]
51806[table [[Name][Description]]
51807  [
51808    [`to`
51809    ]
51810    [
51811The stream to connect to.
51812    ]
51813  ]
51814  [
51815    [`args`
51816    ]
51817    [
51818Optional arguments forwarded to the new stream's constructor.
51819    ]
51820  ]
51821]
51822[heading Return Value]
51823The new, connected stream.
51824
51825
51826[endsect]
51827
51828[section:overload2 test::connect (2 of 2 overloads)]
51829
51830Connect two TCP sockets together.
51831[heading Synopsis]
51832Defined in header [include_file boost/beast/_experimental/test/tcp.hpp]
51833
51834```
51835template<
51836    class __Executor__>
51837bool
51838connect(
51839    net::basic_stream_socket< net::ip::tcp, Executor >& s1,
51840    net::basic_stream_socket< net::ip::tcp, Executor >& s2);
51841```
51842
51843[heading Description]
51844
51845
51846[endsect]
51847
51848
51849[endsect]
51850
51851[section:boost__beast__websocket__error websocket::error]
51852[indexterm1 websocket::error]
51853
51854
51855Error codes returned from [link beast.ref.boost__beast__websocket__stream `beast::websocket::stream`] operations.
51856[heading Synopsis]
51857Defined in header [include_file boost/beast/websocket/error.hpp]
51858
51859```
51860enum error
51861```
51862
51863[heading Values]
51864[table [[Name][Description]]
51865  [
51866    [`closed`
51867    ]
51868    [
51869
51870The WebSocket stream was gracefully closed at both endpoints.
51871
51872    ]
51873  ]
51874  [
51875    [`buffer_overflow`
51876    ]
51877    [
51878
51879The WebSocket operation caused a dynamic buffer overflow.
51880
51881    ]
51882  ]
51883  [
51884    [`partial_deflate_block`
51885    ]
51886    [
51887
51888The WebSocket stream produced an incomplete deflate block.
51889
51890    ]
51891  ]
51892  [
51893    [`message_too_big`
51894    ]
51895    [
51896
51897The WebSocket message exceeded the locally configured limit.
51898
51899    ]
51900  ]
51901  [
51902    [`bad_http_version`
51903    ]
51904    [
51905
51906The WebSocket handshake was not HTTP/1.1.
51907
51908Error codes with this value will compare equal to @ref condition::handshake_failed
51909
51910    ]
51911  ]
51912  [
51913    [`bad_method`
51914    ]
51915    [
51916
51917The WebSocket handshake method was not GET.
51918
51919Error codes with this value will compare equal to @ref condition::handshake_failed
51920
51921    ]
51922  ]
51923  [
51924    [`no_host`
51925    ]
51926    [
51927
51928The WebSocket handshake Host field is missing.
51929
51930Error codes with this value will compare equal to @ref condition::handshake_failed
51931
51932    ]
51933  ]
51934  [
51935    [`no_connection`
51936    ]
51937    [
51938
51939The WebSocket handshake Connection field is missing.
51940
51941Error codes with this value will compare equal to @ref condition::handshake_failed
51942
51943    ]
51944  ]
51945  [
51946    [`no_connection_upgrade`
51947    ]
51948    [
51949
51950The WebSocket handshake Connection field is missing the upgrade token.
51951
51952Error codes with this value will compare equal to @ref condition::handshake_failed
51953
51954    ]
51955  ]
51956  [
51957    [`no_upgrade`
51958    ]
51959    [
51960
51961The WebSocket handshake Upgrade field is missing.
51962
51963Error codes with this value will compare equal to @ref condition::handshake_failed
51964
51965    ]
51966  ]
51967  [
51968    [`no_upgrade_websocket`
51969    ]
51970    [
51971
51972The WebSocket handshake Upgrade field is missing the websocket token.
51973
51974Error codes with this value will compare equal to @ref condition::handshake_failed
51975
51976    ]
51977  ]
51978  [
51979    [`no_sec_key`
51980    ]
51981    [
51982
51983The WebSocket handshake Sec-WebSocket-Key field is missing.
51984
51985Error codes with this value will compare equal to @ref condition::handshake_failed
51986
51987    ]
51988  ]
51989  [
51990    [`bad_sec_key`
51991    ]
51992    [
51993
51994The WebSocket handshake Sec-WebSocket-Key field is invalid.
51995
51996Error codes with this value will compare equal to @ref condition::handshake_failed
51997
51998    ]
51999  ]
52000  [
52001    [`no_sec_version`
52002    ]
52003    [
52004
52005The WebSocket handshake Sec-WebSocket-Version field is missing.
52006
52007Error codes with this value will compare equal to @ref condition::handshake_failed
52008
52009    ]
52010  ]
52011  [
52012    [`bad_sec_version`
52013    ]
52014    [
52015
52016The WebSocket handshake Sec-WebSocket-Version field is invalid.
52017
52018Error codes with this value will compare equal to @ref condition::handshake_failed
52019
52020    ]
52021  ]
52022  [
52023    [`no_sec_accept`
52024    ]
52025    [
52026
52027The WebSocket handshake Sec-WebSocket-Accept field is missing.
52028
52029Error codes with this value will compare equal to @ref condition::handshake_failed
52030
52031    ]
52032  ]
52033  [
52034    [`bad_sec_accept`
52035    ]
52036    [
52037
52038The WebSocket handshake Sec-WebSocket-Accept field is invalid.
52039
52040Error codes with this value will compare equal to @ref condition::handshake_failed
52041
52042    ]
52043  ]
52044  [
52045    [`upgrade_declined`
52046    ]
52047    [
52048
52049The WebSocket handshake was declined by the remote peer.
52050
52051Error codes with this value will compare equal to @ref condition::handshake_failed
52052
52053    ]
52054  ]
52055  [
52056    [`bad_opcode`
52057    ]
52058    [
52059
52060The WebSocket frame contained an illegal opcode.
52061
52062Error codes with this value will compare equal to @ref condition::protocol_violation
52063
52064    ]
52065  ]
52066  [
52067    [`bad_data_frame`
52068    ]
52069    [
52070
52071The WebSocket data frame was unexpected.
52072
52073Error codes with this value will compare equal to @ref condition::protocol_violation
52074
52075    ]
52076  ]
52077  [
52078    [`bad_continuation`
52079    ]
52080    [
52081
52082The WebSocket continuation frame was unexpected.
52083
52084Error codes with this value will compare equal to @ref condition::protocol_violation
52085
52086    ]
52087  ]
52088  [
52089    [`bad_reserved_bits`
52090    ]
52091    [
52092
52093The WebSocket frame contained illegal reserved bits.
52094
52095Error codes with this value will compare equal to @ref condition::protocol_violation
52096
52097    ]
52098  ]
52099  [
52100    [`bad_control_fragment`
52101    ]
52102    [
52103
52104The WebSocket control frame was fragmented.
52105
52106Error codes with this value will compare equal to @ref condition::protocol_violation
52107
52108    ]
52109  ]
52110  [
52111    [`bad_control_size`
52112    ]
52113    [
52114
52115The WebSocket control frame size was invalid.
52116
52117Error codes with this value will compare equal to @ref condition::protocol_violation
52118
52119    ]
52120  ]
52121  [
52122    [`bad_unmasked_frame`
52123    ]
52124    [
52125
52126The WebSocket frame was unmasked.
52127
52128Error codes with this value will compare equal to @ref condition::protocol_violation
52129
52130    ]
52131  ]
52132  [
52133    [`bad_masked_frame`
52134    ]
52135    [
52136
52137The WebSocket frame was masked.
52138
52139Error codes with this value will compare equal to @ref condition::protocol_violation
52140
52141    ]
52142  ]
52143  [
52144    [`bad_size`
52145    ]
52146    [
52147
52148The WebSocket frame size was not canonical.
52149
52150Error codes with this value will compare equal to @ref condition::protocol_violation
52151
52152    ]
52153  ]
52154  [
52155    [`bad_frame_payload`
52156    ]
52157    [
52158
52159The WebSocket frame payload was not valid utf8.
52160
52161Error codes with this value will compare equal to @ref condition::protocol_violation
52162
52163    ]
52164  ]
52165  [
52166    [`bad_close_code`
52167    ]
52168    [
52169
52170The WebSocket close frame reason code was invalid.
52171
52172Error codes with this value will compare equal to @ref condition::protocol_violation
52173
52174    ]
52175  ]
52176  [
52177    [`bad_close_size`
52178    ]
52179    [
52180
52181The WebSocket close frame payload size was invalid.
52182
52183Error codes with this value will compare equal to @ref condition::protocol_violation
52184
52185    ]
52186  ]
52187  [
52188    [`bad_close_payload`
52189    ]
52190    [
52191
52192The WebSocket close frame payload was not valid utf8.
52193
52194Error codes with this value will compare equal to @ref condition::protocol_violation
52195
52196    ]
52197  ]
52198]
52199[heading Description]
52200
52201
52202[endsect]
52203
52204[section:boost__beast__websocket__condition websocket::condition]
52205[indexterm1 websocket::condition]
52206
52207
52208Error conditions corresponding to sets of error codes.
52209[heading Synopsis]
52210Defined in header [include_file boost/beast/websocket/error.hpp]
52211
52212```
52213enum condition
52214```
52215
52216[heading Values]
52217[table [[Name][Description]]
52218  [
52219    [`handshake_failed`
52220    ]
52221    [
52222
52223The WebSocket handshake failed.
52224
52225This condition indicates that the WebSocket handshake failed. If
52226the corresponding HTTP response indicates the keep-alive behavior,
52227then the handshake may be reattempted.
52228
52229    ]
52230  ]
52231  [
52232    [`protocol_violation`
52233    ]
52234    [
52235
52236A WebSocket protocol violation occurred.
52237
52238This condition indicates that the remote peer on the WebSocket
52239connection sent data which violated the protocol.
52240
52241    ]
52242  ]
52243]
52244[heading Description]
52245
52246
52247[endsect]
52248
52249[section:boost__beast__websocket__close_code websocket::close_code]
52250[indexterm1 websocket::close_code]
52251
52252
52253Close status codes.
52254[heading Synopsis]
52255Defined in header [include_file boost/beast/websocket/rfc6455.hpp]
52256
52257```
52258enum close_code
52259```
52260
52261[heading Values]
52262[table [[Name][Description]]
52263  [
52264    [`normal`
52265    ]
52266    [
52267
52268Normal closure; the connection successfully completed whatever purpose for which it was created.
52269
52270    ]
52271  ]
52272  [
52273    [`going_away`
52274    ]
52275    [
52276
52277The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection.
52278
52279    ]
52280  ]
52281  [
52282    [`protocol_error`
52283    ]
52284    [
52285
52286The endpoint is terminating the connection due to a protocol error.
52287
52288    ]
52289  ]
52290  [
52291    [`unknown_data`
52292    ]
52293    [
52294
52295The connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data).
52296
52297    ]
52298  ]
52299  [
52300    [`bad_payload`
52301    ]
52302    [
52303
52304The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message).
52305
52306    ]
52307  ]
52308  [
52309    [`policy_error`
52310    ]
52311    [
52312
52313The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable.
52314
52315    ]
52316  ]
52317  [
52318    [`too_big`
52319    ]
52320    [
52321
52322The endpoint is terminating the connection because a data frame was received that is too large.
52323
52324    ]
52325  ]
52326  [
52327    [`needs_extension`
52328    ]
52329    [
52330
52331The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't.
52332
52333    ]
52334  ]
52335  [
52336    [`internal_error`
52337    ]
52338    [
52339
52340The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.
52341
52342    ]
52343  ]
52344  [
52345    [`service_restart`
52346    ]
52347    [
52348
52349The server is terminating the connection because it is restarting.
52350
52351    ]
52352  ]
52353  [
52354    [`try_again_later`
52355    ]
52356    [
52357
52358The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients.
52359
52360    ]
52361  ]
52362  [
52363    [`none`
52364    ]
52365    [
52366
52367Used internally to mean "no error".
52368
52369This code is reserved and may not be sent.
52370
52371    ]
52372  ]
52373  [
52374    [`reserved1`
52375    ]
52376    [
52377
52378Reserved for future use by the WebSocket standard.
52379
52380This code is reserved and may not be sent.
52381
52382    ]
52383  ]
52384  [
52385    [`no_status`
52386    ]
52387    [
52388
52389No status code was provided even though one was expected.
52390
52391This code is reserved and may not be sent.
52392
52393    ]
52394  ]
52395  [
52396    [`abnormal`
52397    ]
52398    [
52399
52400Connection was closed without receiving a close frame.
52401
52402This code is reserved and may not be sent.
52403
52404    ]
52405  ]
52406  [
52407    [`reserved2`
52408    ]
52409    [
52410
52411Reserved for future use by the WebSocket standard.
52412
52413This code is reserved and may not be sent.
52414
52415    ]
52416  ]
52417  [
52418    [`reserved3`
52419    ]
52420    [
52421
52422Reserved for future use by the WebSocket standard.
52423
52424This code is reserved and may not be sent.
52425
52426    ]
52427  ]
52428]
52429[heading Description]
52430These codes accompany close frames.
52431
52432[heading See Also]
52433[@https://tools.ietf.org/html/rfc6455#section-7.4.1 RFC 6455 7.4.1 Defined Status Codes]
52434
52435
52436[endsect]
52437
52438[section:boost__beast__websocket__frame_type websocket::frame_type]
52439[indexterm1 websocket::frame_type]
52440
52441
52442The type of received control frame.
52443[heading Synopsis]
52444Defined in header [include_file boost/beast/websocket/stream.hpp]
52445
52446```
52447enum frame_type
52448```
52449
52450[heading Values]
52451[table [[Name][Description]]
52452  [
52453    [`close`
52454    ]
52455    [
52456
52457A close frame was received.
52458
52459    ]
52460  ]
52461  [
52462    [`ping`
52463    ]
52464    [
52465
52466A ping frame was received.
52467
52468    ]
52469  ]
52470  [
52471    [`pong`
52472    ]
52473    [
52474
52475A pong frame was received.
52476
52477    ]
52478  ]
52479]
52480[heading Description]
52481Values of this type are passed to the control frame callback set using [link beast.ref.boost__beast__websocket__stream.control_callback `stream::control_callback`].
52482
52483
52484[endsect]
52485
52486[section:boost__beast__websocket__request_type websocket::request_type]
52487[indexterm1 websocket::request_type]
52488
52489
52490The type of object holding HTTP Upgrade requests.
52491[heading Synopsis]
52492Defined in header [include_file boost/beast/websocket/rfc6455.hpp]
52493
52494```
52495using request_type = http::request< http::empty_body >;
52496```
52497
52498[heading Types]
52499[table [[Name][Description]]
52500  [
52501    [[*[link beast.ref.boost__beast__http__empty_body.reader reader]]
52502    ]
52503    [
52504
52505The algorithm for parsing the body.
52506    ]
52507  ]
52508  [
52509    [[*[link beast.ref.boost__beast__http__empty_body__value_type value_type]]
52510    ]
52511    [
52512
52513The type of container used for the body.
52514    ]
52515  ]
52516  [
52517    [[*[link beast.ref.boost__beast__http__empty_body.writer writer]]
52518    ]
52519    [
52520
52521The algorithm for serializing the body.
52522    ]
52523  ]
52524]
52525[heading Static Members]
52526[table [[Name][Description]]
52527  [
52528    [[*[link beast.ref.boost__beast__http__empty_body.size size]]
52529    ]
52530    [
52531
52532Returns the payload size of the body.
52533    ]
52534  ]
52535]
52536This body is used to represent messages which do not have a message body. If this body is used with a parser, and the parser encounters octets corresponding to a message body, the parser will fail with the error [link beast.ref.boost__beast__http__error `
52537            http::unexpected_body
52538         `].
52539The Content-Length of this body is always 0.
52540[heading Description]
52541
52542
52543[endsect]
52544
52545[section:boost__beast__websocket__response_type websocket::response_type]
52546[indexterm1 websocket::response_type]
52547
52548
52549The type of object holding HTTP Upgrade responses.
52550[heading Synopsis]
52551Defined in header [include_file boost/beast/websocket/rfc6455.hpp]
52552
52553```
52554using response_type = http::response< http::string_body >;
52555```
52556
52557[heading Description]
52558
52559
52560[endsect]
52561
52562[section:boost__beast__websocket__reason_string websocket::reason_string]
52563[indexterm1 websocket::reason_string]
52564
52565
52566The type representing the reason string in a close frame.
52567[heading Synopsis]
52568Defined in header [include_file boost/beast/websocket/rfc6455.hpp]
52569
52570```
52571using reason_string = static_string< 123, char >;
52572```
52573
52574[heading Types]
52575[table [[Name][Description]]
52576  [
52577    [[*[link beast.ref.boost__beast__static_string.const_iterator const_iterator]]
52578    ]
52579    [
52580
52581    ]
52582  ]
52583  [
52584    [[*[link beast.ref.boost__beast__static_string.const_pointer const_pointer]]
52585    ]
52586    [
52587
52588    ]
52589  ]
52590  [
52591    [[*[link beast.ref.boost__beast__static_string.const_reference const_reference]]
52592    ]
52593    [
52594
52595    ]
52596  ]
52597  [
52598    [[*[link beast.ref.boost__beast__static_string.const_reverse_iterator const_reverse_iterator]]
52599    ]
52600    [
52601
52602    ]
52603  ]
52604  [
52605    [[*[link beast.ref.boost__beast__static_string.difference_type difference_type]]
52606    ]
52607    [
52608
52609    ]
52610  ]
52611  [
52612    [[*[link beast.ref.boost__beast__static_string.iterator iterator]]
52613    ]
52614    [
52615
52616    ]
52617  ]
52618  [
52619    [[*[link beast.ref.boost__beast__static_string.pointer pointer]]
52620    ]
52621    [
52622
52623    ]
52624  ]
52625  [
52626    [[*[link beast.ref.boost__beast__static_string.reference reference]]
52627    ]
52628    [
52629
52630    ]
52631  ]
52632  [
52633    [[*[link beast.ref.boost__beast__static_string.reverse_iterator reverse_iterator]]
52634    ]
52635    [
52636
52637    ]
52638  ]
52639  [
52640    [[*[link beast.ref.boost__beast__static_string.size_type size_type]]
52641    ]
52642    [
52643
52644    ]
52645  ]
52646  [
52647    [[*[link beast.ref.boost__beast__static_string.string_view_type string_view_type]]
52648    ]
52649    [
52650
52651The type of `string_view` returned by the interface.
52652    ]
52653  ]
52654  [
52655    [[*[link beast.ref.boost__beast__static_string.traits_type traits_type]]
52656    ]
52657    [
52658
52659    ]
52660  ]
52661  [
52662    [[*[link beast.ref.boost__beast__static_string.value_type value_type]]
52663    ]
52664    [
52665
52666    ]
52667  ]
52668]
52669[heading Member Functions]
52670[table [[Name][Description]]
52671  [
52672    [[*[link beast.ref.boost__beast__static_string.append append]]
52673    ]
52674    [
52675
52676    ]
52677  ]
52678  [
52679    [[*[link beast.ref.boost__beast__static_string.assign assign]]
52680    ]
52681    [
52682
52683Assign `count` copies of `ch`.
52684
52685Assign from another [link beast.ref.boost__beast__static_string `static_string`]
52686
52687Assign `count` characterss starting at `npos` from `other`.
52688
52689Assign the first `count` characters of `s`, including nulls.
52690
52691Assign a null terminated string.
52692
52693Assign from an iterator range of characters.
52694
52695Assign from initializer list.
52696
52697Assign from `string_view_type`.
52698
52699Assign from any object convertible to `string_view_type`.
52700    ]
52701  ]
52702  [
52703    [[*[link beast.ref.boost__beast__static_string.at at]]
52704    ]
52705    [
52706
52707Access specified character with bounds checking.
52708    ]
52709  ]
52710  [
52711    [[*[link beast.ref.boost__beast__static_string.back back]]
52712    ]
52713    [
52714
52715Accesses the last character.
52716    ]
52717  ]
52718  [
52719    [[*[link beast.ref.boost__beast__static_string.begin begin]]
52720    ]
52721    [
52722
52723Returns an iterator to the beginning.
52724    ]
52725  ]
52726  [
52727    [[*[link beast.ref.boost__beast__static_string.c_str c_str]]
52728    ]
52729    [
52730
52731Returns a non-modifiable standard C character array version of the string.
52732    ]
52733  ]
52734  [
52735    [[*[link beast.ref.boost__beast__static_string.capacity capacity]]
52736    ]
52737    [
52738
52739Returns the number of characters that can be held in currently allocated storage.
52740    ]
52741  ]
52742  [
52743    [[*[link beast.ref.boost__beast__static_string.cbegin cbegin]]
52744    ]
52745    [
52746
52747Returns an iterator to the beginning.
52748    ]
52749  ]
52750  [
52751    [[*[link beast.ref.boost__beast__static_string.cend cend]]
52752    ]
52753    [
52754
52755Returns an iterator to the end.
52756    ]
52757  ]
52758  [
52759    [[*[link beast.ref.boost__beast__static_string.clear clear]]
52760    ]
52761    [
52762
52763Clears the contents.
52764    ]
52765  ]
52766  [
52767    [[*[link beast.ref.boost__beast__static_string.compare compare]]
52768    ]
52769    [
52770
52771    ]
52772  ]
52773  [
52774    [[*[link beast.ref.boost__beast__static_string.copy copy]]
52775    ]
52776    [
52777
52778Copy a substring (pos, pos+count) to character string pointed to by `dest`.
52779    ]
52780  ]
52781  [
52782    [[*[link beast.ref.boost__beast__static_string.crbegin crbegin]]
52783    ]
52784    [
52785
52786Returns a reverse iterator to the beginning.
52787    ]
52788  ]
52789  [
52790    [[*[link beast.ref.boost__beast__static_string.crend crend]]
52791    ]
52792    [
52793
52794Returns a reverse iterator to the end.
52795    ]
52796  ]
52797  [
52798    [[*[link beast.ref.boost__beast__static_string.data data]]
52799    ]
52800    [
52801
52802Returns a pointer to the first character of a string.
52803    ]
52804  ]
52805  [
52806    [[*[link beast.ref.boost__beast__static_string.empty empty]]
52807    ]
52808    [
52809
52810Returns `true` if the string is empty.
52811    ]
52812  ]
52813  [
52814    [[*[link beast.ref.boost__beast__static_string.end end]]
52815    ]
52816    [
52817
52818Returns an iterator to the end.
52819    ]
52820  ]
52821  [
52822    [[*[link beast.ref.boost__beast__static_string.erase erase]]
52823    ]
52824    [
52825
52826    ]
52827  ]
52828  [
52829    [[*[link beast.ref.boost__beast__static_string.front front]]
52830    ]
52831    [
52832
52833Accesses the first character.
52834    ]
52835  ]
52836  [
52837    [[*[link beast.ref.boost__beast__static_string.insert insert]]
52838    ]
52839    [
52840
52841    ]
52842  ]
52843  [
52844    [[*[link beast.ref.boost__beast__static_string.length length]]
52845    ]
52846    [
52847
52848Returns the number of characters, excluding the null terminator.
52849    ]
52850  ]
52851  [
52852    [[*[link beast.ref.boost__beast__static_string.max_size max_size]]
52853    ]
52854    [
52855
52856Returns the maximum number of characters that can be stored, excluding the null terminator.
52857    ]
52858  ]
52859  [
52860    [[*[link beast.ref.boost__beast__static_string.operator_string_view_type operator string_view_type]]
52861    ]
52862    [
52863
52864Convert a static string to a `string_view_type`
52865    ]
52866  ]
52867  [
52868    [[*[link beast.ref.boost__beast__static_string.operator_plus__eq_ operator+=]]
52869    ]
52870    [
52871
52872    ]
52873  ]
52874  [
52875    [[*[link beast.ref.boost__beast__static_string.operator_eq_ operator=]]
52876    ]
52877    [
52878
52879Copy assignment.
52880
52881Assign from null-terminated string.
52882
52883Assign from single character.
52884
52885Assign from initializer list.
52886
52887Assign from `string_view_type`.
52888    ]
52889  ]
52890  [
52891    [[*[link beast.ref.boost__beast__static_string.operator_lb__rb_ operator\[\]]]
52892    ]
52893    [
52894
52895Access specified character.
52896    ]
52897  ]
52898  [
52899    [[*[link beast.ref.boost__beast__static_string.pop_back pop_back]]
52900    ]
52901    [
52902
52903    ]
52904  ]
52905  [
52906    [[*[link beast.ref.boost__beast__static_string.push_back push_back]]
52907    ]
52908    [
52909
52910    ]
52911  ]
52912  [
52913    [[*[link beast.ref.boost__beast__static_string.rbegin rbegin]]
52914    ]
52915    [
52916
52917Returns a reverse iterator to the beginning.
52918    ]
52919  ]
52920  [
52921    [[*[link beast.ref.boost__beast__static_string.rend rend]]
52922    ]
52923    [
52924
52925Returns a reverse iterator to the end.
52926    ]
52927  ]
52928  [
52929    [[*[link beast.ref.boost__beast__static_string.reserve reserve]]
52930    ]
52931    [
52932
52933Reserves storage.
52934    ]
52935  ]
52936  [
52937    [[*[link beast.ref.boost__beast__static_string.resize resize]]
52938    ]
52939    [
52940
52941Changes the number of characters stored.
52942    ]
52943  ]
52944  [
52945    [[*[link beast.ref.boost__beast__static_string.shrink_to_fit shrink_to_fit]]
52946    ]
52947    [
52948
52949Reduces memory usage by freeing unused memory.
52950    ]
52951  ]
52952  [
52953    [[*[link beast.ref.boost__beast__static_string.size size]]
52954    ]
52955    [
52956
52957Returns the number of characters, excluding the null terminator.
52958    ]
52959  ]
52960  [
52961    [[*[link beast.ref.boost__beast__static_string.static_string static_string]]
52962    ]
52963    [
52964
52965Default constructor (empty string).
52966
52967Construct with count copies of character `ch`.
52968
52969Construct with a substring (pos, other.size()) of `other`.
52970
52971Construct with a substring (pos, count) of `other`.
52972
52973Construct with the first `count` characters of `s`, including nulls.
52974
52975Construct from a null terminated string.
52976
52977Construct from a range of characters.
52978
52979Copy constructor.
52980
52981Construct from an initializer list.
52982
52983Construct from a `string_view`
52984
52985Construct from any object convertible to `string_view_type`.
52986    ]
52987  ]
52988  [
52989    [[*[link beast.ref.boost__beast__static_string.substr substr]]
52990    ]
52991    [
52992
52993    ]
52994  ]
52995  [
52996    [[*[link beast.ref.boost__beast__static_string.swap swap]]
52997    ]
52998    [
52999
53000Exchange the contents of this string with another.
53001    ]
53002  ]
53003]
53004[heading Static Members]
53005[table [[Name][Description]]
53006  [
53007    [[*[link beast.ref.boost__beast__static_string.max_size_n max_size_n]]
53008    ]
53009    [
53010
53011Maximum size of the string excluding the null terminator.
53012    ]
53013  ]
53014  [
53015    [[*[link beast.ref.boost__beast__static_string.npos npos]]
53016    ]
53017    [
53018
53019A special index.
53020    ]
53021  ]
53022]
53023These objects behave like `std::string` except that the storage is not dynamically allocated but rather fixed in size.
53024These strings offer performance advantages when a protocol imposes a natural small upper limit on the size of a value.
53025
53026[heading Remarks]
53027The stored string is always null-terminated.
53028[heading See Also]
53029[link beast.ref.boost__beast__to_static_string `to_static_string`]
53030[heading Description]
53031
53032
53033[endsect]
53034
53035[section:boost__beast__websocket__ping_data websocket::ping_data]
53036[indexterm1 websocket::ping_data]
53037
53038
53039The type representing the payload of ping and pong messages.
53040[heading Synopsis]
53041Defined in header [include_file boost/beast/websocket/rfc6455.hpp]
53042
53043```
53044using ping_data = static_string< 125, char >;
53045```
53046
53047[heading Types]
53048[table [[Name][Description]]
53049  [
53050    [[*[link beast.ref.boost__beast__static_string.const_iterator const_iterator]]
53051    ]
53052    [
53053
53054    ]
53055  ]
53056  [
53057    [[*[link beast.ref.boost__beast__static_string.const_pointer const_pointer]]
53058    ]
53059    [
53060
53061    ]
53062  ]
53063  [
53064    [[*[link beast.ref.boost__beast__static_string.const_reference const_reference]]
53065    ]
53066    [
53067
53068    ]
53069  ]
53070  [
53071    [[*[link beast.ref.boost__beast__static_string.const_reverse_iterator const_reverse_iterator]]
53072    ]
53073    [
53074
53075    ]
53076  ]
53077  [
53078    [[*[link beast.ref.boost__beast__static_string.difference_type difference_type]]
53079    ]
53080    [
53081
53082    ]
53083  ]
53084  [
53085    [[*[link beast.ref.boost__beast__static_string.iterator iterator]]
53086    ]
53087    [
53088
53089    ]
53090  ]
53091  [
53092    [[*[link beast.ref.boost__beast__static_string.pointer pointer]]
53093    ]
53094    [
53095
53096    ]
53097  ]
53098  [
53099    [[*[link beast.ref.boost__beast__static_string.reference reference]]
53100    ]
53101    [
53102
53103    ]
53104  ]
53105  [
53106    [[*[link beast.ref.boost__beast__static_string.reverse_iterator reverse_iterator]]
53107    ]
53108    [
53109
53110    ]
53111  ]
53112  [
53113    [[*[link beast.ref.boost__beast__static_string.size_type size_type]]
53114    ]
53115    [
53116
53117    ]
53118  ]
53119  [
53120    [[*[link beast.ref.boost__beast__static_string.string_view_type string_view_type]]
53121    ]
53122    [
53123
53124The type of `string_view` returned by the interface.
53125    ]
53126  ]
53127  [
53128    [[*[link beast.ref.boost__beast__static_string.traits_type traits_type]]
53129    ]
53130    [
53131
53132    ]
53133  ]
53134  [
53135    [[*[link beast.ref.boost__beast__static_string.value_type value_type]]
53136    ]
53137    [
53138
53139    ]
53140  ]
53141]
53142[heading Member Functions]
53143[table [[Name][Description]]
53144  [
53145    [[*[link beast.ref.boost__beast__static_string.append append]]
53146    ]
53147    [
53148
53149    ]
53150  ]
53151  [
53152    [[*[link beast.ref.boost__beast__static_string.assign assign]]
53153    ]
53154    [
53155
53156Assign `count` copies of `ch`.
53157
53158Assign from another [link beast.ref.boost__beast__static_string `static_string`]
53159
53160Assign `count` characterss starting at `npos` from `other`.
53161
53162Assign the first `count` characters of `s`, including nulls.
53163
53164Assign a null terminated string.
53165
53166Assign from an iterator range of characters.
53167
53168Assign from initializer list.
53169
53170Assign from `string_view_type`.
53171
53172Assign from any object convertible to `string_view_type`.
53173    ]
53174  ]
53175  [
53176    [[*[link beast.ref.boost__beast__static_string.at at]]
53177    ]
53178    [
53179
53180Access specified character with bounds checking.
53181    ]
53182  ]
53183  [
53184    [[*[link beast.ref.boost__beast__static_string.back back]]
53185    ]
53186    [
53187
53188Accesses the last character.
53189    ]
53190  ]
53191  [
53192    [[*[link beast.ref.boost__beast__static_string.begin begin]]
53193    ]
53194    [
53195
53196Returns an iterator to the beginning.
53197    ]
53198  ]
53199  [
53200    [[*[link beast.ref.boost__beast__static_string.c_str c_str]]
53201    ]
53202    [
53203
53204Returns a non-modifiable standard C character array version of the string.
53205    ]
53206  ]
53207  [
53208    [[*[link beast.ref.boost__beast__static_string.capacity capacity]]
53209    ]
53210    [
53211
53212Returns the number of characters that can be held in currently allocated storage.
53213    ]
53214  ]
53215  [
53216    [[*[link beast.ref.boost__beast__static_string.cbegin cbegin]]
53217    ]
53218    [
53219
53220Returns an iterator to the beginning.
53221    ]
53222  ]
53223  [
53224    [[*[link beast.ref.boost__beast__static_string.cend cend]]
53225    ]
53226    [
53227
53228Returns an iterator to the end.
53229    ]
53230  ]
53231  [
53232    [[*[link beast.ref.boost__beast__static_string.clear clear]]
53233    ]
53234    [
53235
53236Clears the contents.
53237    ]
53238  ]
53239  [
53240    [[*[link beast.ref.boost__beast__static_string.compare compare]]
53241    ]
53242    [
53243
53244    ]
53245  ]
53246  [
53247    [[*[link beast.ref.boost__beast__static_string.copy copy]]
53248    ]
53249    [
53250
53251Copy a substring (pos, pos+count) to character string pointed to by `dest`.
53252    ]
53253  ]
53254  [
53255    [[*[link beast.ref.boost__beast__static_string.crbegin crbegin]]
53256    ]
53257    [
53258
53259Returns a reverse iterator to the beginning.
53260    ]
53261  ]
53262  [
53263    [[*[link beast.ref.boost__beast__static_string.crend crend]]
53264    ]
53265    [
53266
53267Returns a reverse iterator to the end.
53268    ]
53269  ]
53270  [
53271    [[*[link beast.ref.boost__beast__static_string.data data]]
53272    ]
53273    [
53274
53275Returns a pointer to the first character of a string.
53276    ]
53277  ]
53278  [
53279    [[*[link beast.ref.boost__beast__static_string.empty empty]]
53280    ]
53281    [
53282
53283Returns `true` if the string is empty.
53284    ]
53285  ]
53286  [
53287    [[*[link beast.ref.boost__beast__static_string.end end]]
53288    ]
53289    [
53290
53291Returns an iterator to the end.
53292    ]
53293  ]
53294  [
53295    [[*[link beast.ref.boost__beast__static_string.erase erase]]
53296    ]
53297    [
53298
53299    ]
53300  ]
53301  [
53302    [[*[link beast.ref.boost__beast__static_string.front front]]
53303    ]
53304    [
53305
53306Accesses the first character.
53307    ]
53308  ]
53309  [
53310    [[*[link beast.ref.boost__beast__static_string.insert insert]]
53311    ]
53312    [
53313
53314    ]
53315  ]
53316  [
53317    [[*[link beast.ref.boost__beast__static_string.length length]]
53318    ]
53319    [
53320
53321Returns the number of characters, excluding the null terminator.
53322    ]
53323  ]
53324  [
53325    [[*[link beast.ref.boost__beast__static_string.max_size max_size]]
53326    ]
53327    [
53328
53329Returns the maximum number of characters that can be stored, excluding the null terminator.
53330    ]
53331  ]
53332  [
53333    [[*[link beast.ref.boost__beast__static_string.operator_string_view_type operator string_view_type]]
53334    ]
53335    [
53336
53337Convert a static string to a `string_view_type`
53338    ]
53339  ]
53340  [
53341    [[*[link beast.ref.boost__beast__static_string.operator_plus__eq_ operator+=]]
53342    ]
53343    [
53344
53345    ]
53346  ]
53347  [
53348    [[*[link beast.ref.boost__beast__static_string.operator_eq_ operator=]]
53349    ]
53350    [
53351
53352Copy assignment.
53353
53354Assign from null-terminated string.
53355
53356Assign from single character.
53357
53358Assign from initializer list.
53359
53360Assign from `string_view_type`.
53361    ]
53362  ]
53363  [
53364    [[*[link beast.ref.boost__beast__static_string.operator_lb__rb_ operator\[\]]]
53365    ]
53366    [
53367
53368Access specified character.
53369    ]
53370  ]
53371  [
53372    [[*[link beast.ref.boost__beast__static_string.pop_back pop_back]]
53373    ]
53374    [
53375
53376    ]
53377  ]
53378  [
53379    [[*[link beast.ref.boost__beast__static_string.push_back push_back]]
53380    ]
53381    [
53382
53383    ]
53384  ]
53385  [
53386    [[*[link beast.ref.boost__beast__static_string.rbegin rbegin]]
53387    ]
53388    [
53389
53390Returns a reverse iterator to the beginning.
53391    ]
53392  ]
53393  [
53394    [[*[link beast.ref.boost__beast__static_string.rend rend]]
53395    ]
53396    [
53397
53398Returns a reverse iterator to the end.
53399    ]
53400  ]
53401  [
53402    [[*[link beast.ref.boost__beast__static_string.reserve reserve]]
53403    ]
53404    [
53405
53406Reserves storage.
53407    ]
53408  ]
53409  [
53410    [[*[link beast.ref.boost__beast__static_string.resize resize]]
53411    ]
53412    [
53413
53414Changes the number of characters stored.
53415    ]
53416  ]
53417  [
53418    [[*[link beast.ref.boost__beast__static_string.shrink_to_fit shrink_to_fit]]
53419    ]
53420    [
53421
53422Reduces memory usage by freeing unused memory.
53423    ]
53424  ]
53425  [
53426    [[*[link beast.ref.boost__beast__static_string.size size]]
53427    ]
53428    [
53429
53430Returns the number of characters, excluding the null terminator.
53431    ]
53432  ]
53433  [
53434    [[*[link beast.ref.boost__beast__static_string.static_string static_string]]
53435    ]
53436    [
53437
53438Default constructor (empty string).
53439
53440Construct with count copies of character `ch`.
53441
53442Construct with a substring (pos, other.size()) of `other`.
53443
53444Construct with a substring (pos, count) of `other`.
53445
53446Construct with the first `count` characters of `s`, including nulls.
53447
53448Construct from a null terminated string.
53449
53450Construct from a range of characters.
53451
53452Copy constructor.
53453
53454Construct from an initializer list.
53455
53456Construct from a `string_view`
53457
53458Construct from any object convertible to `string_view_type`.
53459    ]
53460  ]
53461  [
53462    [[*[link beast.ref.boost__beast__static_string.substr substr]]
53463    ]
53464    [
53465
53466    ]
53467  ]
53468  [
53469    [[*[link beast.ref.boost__beast__static_string.swap swap]]
53470    ]
53471    [
53472
53473Exchange the contents of this string with another.
53474    ]
53475  ]
53476]
53477[heading Static Members]
53478[table [[Name][Description]]
53479  [
53480    [[*[link beast.ref.boost__beast__static_string.max_size_n max_size_n]]
53481    ]
53482    [
53483
53484Maximum size of the string excluding the null terminator.
53485    ]
53486  ]
53487  [
53488    [[*[link beast.ref.boost__beast__static_string.npos npos]]
53489    ]
53490    [
53491
53492A special index.
53493    ]
53494  ]
53495]
53496These objects behave like `std::string` except that the storage is not dynamically allocated but rather fixed in size.
53497These strings offer performance advantages when a protocol imposes a natural small upper limit on the size of a value.
53498
53499[heading Remarks]
53500The stored string is always null-terminated.
53501[heading See Also]
53502[link beast.ref.boost__beast__to_static_string `to_static_string`]
53503[heading Description]
53504
53505
53506[endsect]
53507
53508[section:boost__beast__websocket__is_upgrade websocket::is_upgrade]
53509[indexterm1 websocket::is_upgrade]
53510
53511
53512Returns `true` if the specified HTTP request is a WebSocket Upgrade.
53513[heading Synopsis]
53514Defined in header [include_file boost/beast/websocket/rfc6455.hpp]
53515
53516```
53517template<
53518    class __Allocator__>
53519bool
53520is_upgrade(
53521    beast::http::header< true, http::basic_fields< Allocator >> const& req);
53522```
53523
53524[heading Description]
53525This function returns `true` when the passed HTTP Request indicates a WebSocket Upgrade. It does not validate the contents of the fields: it just trivially accepts requests which could only possibly be a valid or invalid WebSocket Upgrade message.
53526Callers who wish to manually read HTTP requests in their server implementation can use this function to determine if the request should be routed to an instance of [link beast.ref.boost__beast__websocket__stream `websocket::stream`].
53527
53528[heading Example]
53529
53530```
53531void handle_connection(net::ip::tcp::socket& sock)
53532{
53533    boost::beast::flat_buffer buffer;
53534    boost::beast::http::request<boost::beast::http::string_body> req;
53535    boost::beast::http::read(sock, buffer, req);
53536    if(boost::beast::websocket::is_upgrade(req))
53537    {
53538        boost::beast::websocket::stream<decltype(sock)> ws{std::move(sock)};
53539        ws.accept(req);
53540    }
53541}
53542```
53543
53544[heading Parameters]
53545[table [[Name][Description]]
53546  [
53547    [`req`
53548    ]
53549    [
53550The HTTP Request object to check.
53551    ]
53552  ]
53553]
53554[heading Return Value]
53555`true` if the request is a WebSocket Upgrade.
53556
53557
53558[endsect]
53559
53560[section:boost__beast__websocket__seed_prng websocket::seed_prng]
53561[indexterm1 websocket::seed_prng]
53562
53563
53564Manually provide a one-time seed to initialize the PRNG.
53565[heading Synopsis]
53566Defined in header [include_file boost/beast/websocket/stream.hpp]
53567
53568```
53569void
53570seed_prng(
53571    std::seed_seq& ss);
53572```
53573
53574[heading Description]
53575This function invokes the specified seed sequence to produce a seed suitable for use with the pseudo-random number generator used to create masks and perform WebSocket protocol handshakes.
53576If a seed is not manually provided, the implementation will perform a one-time seed generation using `std::random_device`. This function may be used when the application runs in an environment where the random device is unreliable or does not provide sufficient entropy.
53577
53578[heading Preconditions]
53579
53580This function may not be called after any websocket [link beast.ref.boost__beast__websocket__stream `stream`] objects have been constructed.
53581
53582[heading Parameters]
53583[table [[Name][Description]]
53584  [
53585    [`ss`
53586    ]
53587    [
53588A reference to a `std::seed_seq` which will be used to seed the pseudo-random number generator. The seed sequence should have at least 256 bits of entropy.
53589    ]
53590  ]
53591]
53592[heading See Also]
53593[link beast.ref.boost__beast__websocket__stream.secure_prng `stream::secure_prng`]
53594
53595
53596[endsect]
53597
53598[section:boost__beast__websocket__teardown websocket::teardown]
53599[indexterm1 websocket::teardown]
53600
53601
53602Tear down a connection.
53603```
53604template<
53605    class Socket>
53606void
53607``[link beast.ref.boost__beast__websocket__teardown.overload1 teardown]``(
53608    role_type role,
53609    Socket& socket,
53610    error_code& ec);
53611  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__teardown.overload1 `more...`]]``
53612```
53613
53614
53615Tear down a `net::ip::tcp::socket`.
53616```
53617template<
53618    class __Protocol__,
53619    class __Executor__>
53620void
53621``[link beast.ref.boost__beast__websocket__teardown.overload2 teardown]``(
53622    role_type role,
53623    net::basic_stream_socket< Protocol, Executor >& socket,
53624    error_code& ec);
53625  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__teardown.overload2 `more...`]]``
53626```
53627
53628[section:overload1 websocket::teardown (1 of 2 overloads)]
53629
53630Tear down a connection.
53631[heading Synopsis]
53632Defined in header [include_file boost/beast/websocket/teardown.hpp]
53633
53634```
53635template<
53636    class Socket>
53637void
53638teardown(
53639    role_type role,
53640    Socket& socket,
53641    error_code& ec);
53642```
53643
53644[heading Description]
53645This tears down a connection. The implementation will call the overload of this function based on the `Socket` parameter used to consruct the socket. When `Socket` is a user defined type, and not a `net::ip::tcp::socket` or any `net::ssl::stream`, callers are responsible for providing a suitable overload of this function.
53646
53647[heading Parameters]
53648[table [[Name][Description]]
53649  [
53650    [`role`
53651    ]
53652    [
53653The role of the local endpoint
53654    ]
53655  ]
53656  [
53657    [`socket`
53658    ]
53659    [
53660The socket to tear down.
53661    ]
53662  ]
53663  [
53664    [`ec`
53665    ]
53666    [
53667Set to the error if any occurred.
53668    ]
53669  ]
53670]
53671
53672
53673[endsect]
53674
53675[section:overload2 websocket::teardown (2 of 2 overloads)]
53676
53677Tear down a `net::ip::tcp::socket`.
53678[heading Synopsis]
53679Defined in header [include_file boost/beast/websocket/teardown.hpp]
53680
53681```
53682template<
53683    class __Protocol__,
53684    class __Executor__>
53685void
53686teardown(
53687    role_type role,
53688    net::basic_stream_socket< Protocol, Executor >& socket,
53689    error_code& ec);
53690```
53691
53692[heading Description]
53693This tears down a connection. The implementation will call the overload of this function based on the `Stream` parameter used to consruct the socket. When `Stream` is a user defined type, and not a `net::ip::tcp::socket` or any `net::ssl::stream`, callers are responsible for providing a suitable overload of this function.
53694
53695[heading Parameters]
53696[table [[Name][Description]]
53697  [
53698    [`role`
53699    ]
53700    [
53701The role of the local endpoint
53702    ]
53703  ]
53704  [
53705    [`socket`
53706    ]
53707    [
53708The socket to tear down.
53709    ]
53710  ]
53711  [
53712    [`ec`
53713    ]
53714    [
53715Set to the error if any occurred.
53716    ]
53717  ]
53718]
53719
53720
53721[endsect]
53722
53723
53724[endsect]
53725
53726[section:boost__beast__websocket__async_teardown websocket::async_teardown]
53727[indexterm1 websocket::async_teardown]
53728
53729
53730Start tearing down a connection.
53731```
53732template<
53733    class Socket,
53734    class TeardownHandler>
53735void
53736``[link beast.ref.boost__beast__websocket__async_teardown.overload1 async_teardown]``(
53737    role_type role,
53738    Socket& socket,
53739    TeardownHandler&& handler);
53740  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__async_teardown.overload1 `more...`]]``
53741```
53742
53743
53744Start tearing down a `net::ip::tcp::socket`.
53745```
53746template<
53747    class __Protocol__,
53748    class __Executor__,
53749    class TeardownHandler>
53750void
53751``[link beast.ref.boost__beast__websocket__async_teardown.overload2 async_teardown]``(
53752    role_type role,
53753    net::basic_stream_socket< Protocol, Executor >& socket,
53754    TeardownHandler&& handler);
53755  ``[''''&raquo;''' [link beast.ref.boost__beast__websocket__async_teardown.overload2 `more...`]]``
53756```
53757
53758[section:overload1 websocket::async_teardown (1 of 2 overloads)]
53759
53760Start tearing down a connection.
53761[heading Synopsis]
53762Defined in header [include_file boost/beast/websocket/teardown.hpp]
53763
53764```
53765template<
53766    class Socket,
53767    class TeardownHandler>
53768void
53769async_teardown(
53770    role_type role,
53771    Socket& socket,
53772    TeardownHandler&& handler);
53773```
53774
53775[heading Description]
53776This begins tearing down a connection asynchronously. The implementation will call the overload of this function based on the `Socket` parameter used to consruct the socket. When `Stream` is a user defined type, and not a `net::ip::tcp::socket` or any `net::ssl::stream`, callers are responsible for providing a suitable overload of this function.
53777
53778[heading Parameters]
53779[table [[Name][Description]]
53780  [
53781    [`role`
53782    ]
53783    [
53784The role of the local endpoint
53785    ]
53786  ]
53787  [
53788    [`socket`
53789    ]
53790    [
53791The socket to tear down.
53792    ]
53793  ]
53794  [
53795    [`handler`
53796    ]
53797    [
53798
53799The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
53800```
53801void handler(
53802    error_code const& error // result of operation
53803);
53804```
53805
53806Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
53807    ]
53808  ]
53809]
53810
53811
53812[endsect]
53813
53814[section:overload2 websocket::async_teardown (2 of 2 overloads)]
53815
53816Start tearing down a `net::ip::tcp::socket`.
53817[heading Synopsis]
53818Defined in header [include_file boost/beast/websocket/teardown.hpp]
53819
53820```
53821template<
53822    class __Protocol__,
53823    class __Executor__,
53824    class TeardownHandler>
53825void
53826async_teardown(
53827    role_type role,
53828    net::basic_stream_socket< Protocol, Executor >& socket,
53829    TeardownHandler&& handler);
53830```
53831
53832[heading Description]
53833This begins tearing down a connection asynchronously. The implementation will call the overload of this function based on the `Stream` parameter used to consruct the socket. When `Stream` is a user defined type, and not a `net::ip::tcp::socket` or any `net::ssl::stream`, callers are responsible for providing a suitable overload of this function.
53834
53835[heading Parameters]
53836[table [[Name][Description]]
53837  [
53838    [`role`
53839    ]
53840    [
53841The role of the local endpoint
53842    ]
53843  ]
53844  [
53845    [`socket`
53846    ]
53847    [
53848The socket to tear down.
53849    ]
53850  ]
53851  [
53852    [`handler`
53853    ]
53854    [
53855
53856The completion handler to invoke when the operation completes. The implementation takes ownership of the handler by performing a decay-copy. The equivalent function signature of the handler must be:
53857```
53858void handler(
53859    error_code const& error // result of operation
53860);
53861```
53862
53863    ]
53864  ]
53865]
53866Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`.
53867
53868
53869[endsect]
53870
53871
53872[endsect]
53873
53874[section:boost__beast__zlib__error zlib::error]
53875[indexterm1 zlib::error]
53876
53877
53878Error codes returned by the deflate codecs.
53879[heading Synopsis]
53880Defined in header [include_file boost/beast/zlib/error.hpp]
53881
53882```
53883enum error
53884```
53885
53886[heading Values]
53887[table [[Name][Description]]
53888  [
53889    [`need_buffers`
53890    ]
53891    [
53892
53893Additional buffers are required.
53894
53895This error indicates that one or both of the buffers
53896provided buffers do not have sufficient available bytes
53897to make forward progress.
53898
53899This does not always indicate a failure condition.
53900
53901@note This is the same as `Z_BUF_ERROR` returned by ZLib.
53902
53903    ]
53904  ]
53905  [
53906    [`end_of_stream`
53907    ]
53908    [
53909
53910End of stream reached.
53911
53912@note This is the same as `Z_STREAM_END` returned by ZLib.
53913
53914    ]
53915  ]
53916  [
53917    [`need_dict`
53918    ]
53919    [
53920
53921Preset dictionary required.
53922
53923This error indicates that a preset dictionary was not provided and is now
53924needed at this point.
53925
53926This does not always indicate a failure condition.
53927
53928@note This is the same as `Z_NEED_DICT` returned by ZLib.
53929
53930    ]
53931  ]
53932  [
53933    [`stream_error`
53934    ]
53935    [
53936
53937Invalid stream or parameters.
53938
53939This error is returned when invalid parameters are passed,
53940or the operation being performed is not consistent with the
53941state of the stream. For example, attempting to write data
53942when the end of stream is already reached.
53943
53944@note This is the same as `Z_STREAM_ERROR` returned by ZLib.
53945
53946    ]
53947  ]
53948  [
53949    [`invalid_block_type`
53950    ]
53951    [
53952
53953Invalid block type.
53954
53955    ]
53956  ]
53957  [
53958    [`invalid_stored_length`
53959    ]
53960    [
53961
53962Invalid stored block length.
53963
53964    ]
53965  ]
53966  [
53967    [`too_many_symbols`
53968    ]
53969    [
53970
53971Too many length or distance symbols.
53972
53973    ]
53974  ]
53975  [
53976    [`invalid_code_lengths`
53977    ]
53978    [
53979
53980Invalid code lengths.
53981
53982    ]
53983  ]
53984  [
53985    [`invalid_bit_length_repeat`
53986    ]
53987    [
53988
53989Invalid bit length repeat.
53990
53991    ]
53992  ]
53993  [
53994    [`missing_eob`
53995    ]
53996    [
53997
53998Missing end of block code.
53999
54000    ]
54001  ]
54002  [
54003    [`invalid_literal_length`
54004    ]
54005    [
54006
54007Invalid literal/length code.
54008
54009    ]
54010  ]
54011  [
54012    [`invalid_distance_code`
54013    ]
54014    [
54015
54016Invalid distance code.
54017
54018    ]
54019  ]
54020  [
54021    [`invalid_distance`
54022    ]
54023    [
54024
54025Invalid distance too far back.
54026
54027    ]
54028  ]
54029  [
54030    [`over_subscribed_length`
54031    ]
54032    [
54033
54034Over-subscribed length code.
54035
54036    ]
54037  ]
54038  [
54039    [`incomplete_length_set`
54040    ]
54041    [
54042
54043Incomplete length set.
54044
54045    ]
54046  ]
54047  [
54048    [`general`
54049    ]
54050    [
54051
54052general error
54053
54054    ]
54055  ]
54056]
54057[heading Description]
54058
54059
54060[endsect]
54061
54062[section:boost__beast__zlib__kind zlib::kind]
54063[indexterm1 zlib::kind]
54064
54065
54066[heading Synopsis]
54067Defined in header [include_file boost/beast/zlib/zlib.hpp]
54068
54069```
54070enum kind
54071```
54072
54073[heading Values]
54074[table [[Name][Description]]
54075  [
54076    [`binary`
54077    ]
54078    [
54079
54080
54081    ]
54082  ]
54083  [
54084    [`text`
54085    ]
54086    [
54087
54088
54089    ]
54090  ]
54091  [
54092    [`unknown`
54093    ]
54094    [
54095
54096
54097    ]
54098  ]
54099]
54100[heading Description]
54101
54102
54103[endsect]
54104
54105[section:boost__beast__zlib__Flush zlib::Flush]
54106[indexterm1 zlib::Flush]
54107
54108
54109Flush option.
54110[heading Synopsis]
54111Defined in header [include_file boost/beast/zlib/zlib.hpp]
54112
54113```
54114enum Flush
54115```
54116
54117[heading Values]
54118[table [[Name][Description]]
54119  [
54120    [`none`
54121    ]
54122    [
54123
54124
54125    ]
54126  ]
54127  [
54128    [`block`
54129    ]
54130    [
54131
54132
54133    ]
54134  ]
54135  [
54136    [`partial`
54137    ]
54138    [
54139
54140
54141    ]
54142  ]
54143  [
54144    [`sync`
54145    ]
54146    [
54147
54148
54149    ]
54150  ]
54151  [
54152    [`full`
54153    ]
54154    [
54155
54156
54157    ]
54158  ]
54159  [
54160    [`finish`
54161    ]
54162    [
54163
54164
54165    ]
54166  ]
54167  [
54168    [`trees`
54169    ]
54170    [
54171
54172
54173    ]
54174  ]
54175]
54176[heading Description]
54177
54178
54179[endsect]
54180
54181[section:boost__beast__zlib__compression zlib::compression]
54182[indexterm1 zlib::compression]
54183
54184
54185[heading Synopsis]
54186Defined in header [include_file boost/beast/zlib/zlib.hpp]
54187
54188```
54189enum compression
54190```
54191
54192[heading Values]
54193[table [[Name][Description]]
54194  [
54195    [`none`
54196    ]
54197    [
54198
54199
54200    ]
54201  ]
54202  [
54203    [`none`
54204    ]
54205    [
54206
54207
54208    ]
54209  ]
54210  [
54211    [`best_speed`
54212    ]
54213    [
54214
54215
54216    ]
54217  ]
54218  [
54219    [`best_size`
54220    ]
54221    [
54222
54223
54224    ]
54225  ]
54226  [
54227    [`default_size`
54228    ]
54229    [
54230
54231
54232    ]
54233  ]
54234]
54235[heading Description]
54236
54237
54238[endsect]
54239
54240[section:boost__beast__zlib__Strategy zlib::Strategy]
54241[indexterm1 zlib::Strategy]
54242
54243
54244Compression strategy.
54245[heading Synopsis]
54246Defined in header [include_file boost/beast/zlib/zlib.hpp]
54247
54248```
54249enum Strategy
54250```
54251
54252[heading Values]
54253[table [[Name][Description]]
54254  [
54255    [`normal`
54256    ]
54257    [
54258
54259Default strategy.
54260
54261This is suitable for general purpose compression, and works
54262well in the majority of cases.
54263
54264    ]
54265  ]
54266  [
54267    [`filtered`
54268    ]
54269    [
54270
54271Filtered strategy.
54272
54273This strategy should be used when the data be compressed
54274is produced by a filter or predictor.
54275
54276    ]
54277  ]
54278  [
54279    [`huffman`
54280    ]
54281    [
54282
54283Huffman-only strategy.
54284
54285This strategy only performs Huffman encoding, without doing
54286any string matching.
54287
54288    ]
54289  ]
54290  [
54291    [`rle`
54292    ]
54293    [
54294
54295Run Length Encoding strategy.
54296
54297This strategy limits match distances to one, making it
54298equivalent to run length encoding. This can give better
54299performance for things like PNG image data.
54300
54301    ]
54302  ]
54303  [
54304    [`fixed`
54305    ]
54306    [
54307
54308Fixed table strategy.
54309
54310This strategy prevents the use of dynamic Huffman codes,
54311allowing for a simpler decoder for special applications.
54312
54313    ]
54314  ]
54315]
54316[heading Description]
54317These are used when compressing streams.
54318
54319
54320[endsect]
54321
54322[section:boost__beast__zlib__Byte zlib::Byte]
54323[indexterm1 zlib::Byte]
54324
54325
54326[heading Synopsis]
54327Defined in header [include_file boost/beast/zlib/zlib.hpp]
54328
54329```
54330using Byte = unsigned char;
54331```
54332
54333[heading Description]
54334
54335
54336[endsect]
54337
54338[section:boost__beast__zlib__uInt zlib::uInt]
54339[indexterm1 zlib::uInt]
54340
54341
54342[heading Synopsis]
54343Defined in header [include_file boost/beast/zlib/zlib.hpp]
54344
54345```
54346using uInt = unsigned int;
54347```
54348
54349[heading Description]
54350
54351
54352[endsect]
54353
54354[section:boost__beast__zlib__deflate_upper_bound zlib::deflate_upper_bound]
54355[indexterm1 zlib::deflate_upper_bound]
54356
54357
54358Returns the upper limit on the size of a compressed block.
54359[heading Synopsis]
54360Defined in header [include_file boost/beast/zlib/deflate_stream.hpp]
54361
54362```
54363std::size_t
54364deflate_upper_bound(
54365    std::size_t bytes);
54366```
54367
54368[heading Description]
54369This function makes a conservative estimate of the maximum number of bytes needed to store the result of compressing a block of data.
54370
54371[heading Parameters]
54372[table [[Name][Description]]
54373  [
54374    [`bytes`
54375    ]
54376    [
54377The size of the uncompressed data.
54378    ]
54379  ]
54380]
54381[heading Return Value]
54382The maximum number of resulting compressed bytes.
54383
54384
54385[endsect]
54386