1[/ 2 Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) 3 4 Distributed under the Boost Software License, Version 1.0. (See accompanying 5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 7 Official repository: https://github.com/boostorg/beast 8] 9 10[section:FieldsWriter FieldsWriter] 11 12A [*FieldsWriter] provides a algorithm to obtain a sequence of buffers 13representing the complete serialized HTTP/1 header for a set of fields. 14The implementation constructs an instance of this type when needed, and 15calls into it once to retrieve the buffers. 16 17[heading Associated Types] 18 19* __FieldsWriter__ 20 21[heading Requirements] 22 23[warning 24 These requirements may undergo non-backward compatible 25 changes in subsequent versions. 26] 27 28In this table: 29 30* `W` denotes a type that meets the requirements of [*FieldsWriter]. 31* `F` denotes a __Fields__ where 32 `std::is_same<W, F::writer>::value == true`. 33* `a` is a value of type `W`. 34* `f` is a value of type `F`. 35* `v` is an `unsigned` value representing the HTTP version. 36* `c` is an `unsigned` representing the HTTP status-code. 37* `m` is a value of type [link beast.ref.boost__beast__http__verb `verb`]. 38 39[table Valid expressions 40[[expression][type][semantics, pre/post-conditions]] 41[ 42 [`W::const_buffers_type`] 43 [] 44 [ 45 A type which meets the requirements of __ConstBufferSequence__. 46 This is the type of buffer returned by `W::get`. 47 ] 48][ 49 [`W{f,v,m}`] 50 [] 51 [ 52 The implementation calls this constructor to indicate 53 that the fields being serialized form part of an HTTP 54 request. The lifetime of `f` is guaranteed 55 to end no earlier than after the `W` is destroyed. 56 ] 57][ 58 [`W{f,v,c}`] 59 [] 60 [ 61 The implementation calls this constructor to indicate 62 that the fields being serialized form part of an HTTP 63 response. The lifetime of `f` is guaranteed 64 to end no earlier than after the `W` is destroyed. 65 ] 66][ 67 [`W{f}`] 68 [] 69 [ 70 The implementation calls this constructor to indicate 71 that the fields being serialized form part of a chunked 72 encoding final-chunk trailer. The lifetime of `f` is 73 guaranteed to end no earlier than after the `W` is 74 destroyed. 75 ] 76][ 77 [`a.get()`] 78 [`W::const_buffers_type`] 79 [ 80 Called once after construction, this function returns 81 a constant buffer sequence containing the serialized 82 representation of the HTTP request or response including 83 the final carriage return linefeed sequence (`"\r\n"`). 84 85 Copies may be made of the returned sequence, but the 86 underlying memory is still owned by the writer. The 87 implementation will destroy all copies of the buffer 88 sequence before destroying `a`. 89 ] 90]] 91 92[heading Exemplar] 93 94[concept_FieldsWriter] 95 96[heading Models] 97 98* [link beast.ref.boost__beast__http__basic_fields.writer `basic_fields::writer`] 99 100[endsect] 101