File: FieldsWriter.qbk

package info (click to toggle)
boost1.88 1.88.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 576,932 kB
  • sloc: cpp: 4,149,234; xml: 136,789; ansic: 35,092; python: 33,910; asm: 5,698; sh: 4,604; ada: 1,681; makefile: 1,633; pascal: 1,139; perl: 1,124; sql: 640; yacc: 478; ruby: 271; java: 77; lisp: 24; csh: 6
file content (100 lines) | stat: -rw-r--r-- 2,998 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
[/
    Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)

    Distributed under the Boost Software License, Version 1.0. (See accompanying
    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

    Official repository: https://github.com/boostorg/beast
]

[section:FieldsWriter FieldsWriter]

A [*FieldsWriter] provides a algorithm to obtain a sequence of buffers
representing the complete serialized HTTP/1 header for a set of fields.
The implementation constructs an instance of this type when needed, and
calls into it once to retrieve the buffers.

[heading Associated Types]

* __FieldsWriter__

[heading Requirements]

[warning
    These requirements may undergo non-backward compatible
    changes in subsequent versions.
]

In this table:

* `W` denotes a type that meets the requirements of [*FieldsWriter].
* `F` denotes a __Fields__ where
      `std::is_same<W, F::writer>::value == true`.
* `a` is a value of type `W`.
* `f` is a value of type `F`.
* `v` is an `unsigned` value representing the HTTP version.
* `c` is an `unsigned` representing the HTTP status-code.
* `m` is a value of type [link beast.ref.boost__beast__http__verb `verb`].

[table Valid expressions
[[expression][type][semantics, pre/post-conditions]]
[
    [`W::const_buffers_type`]
    []
    [
        A type which meets the requirements of __ConstBufferSequence__.
        This is the type of buffer returned by `W::get`.
    ]
][
    [`W{f,v,m}`]
    []
    [
        The implementation calls this constructor to indicate
        that the fields being serialized form part of an HTTP
        request. The lifetime of `f` is guaranteed
        to end no earlier than after the `W` is destroyed.
    ]
][
    [`W{f,v,c}`]
    []
    [
        The implementation calls this constructor to indicate
        that the fields being serialized form part of an HTTP
        response. The lifetime of `f` is guaranteed
        to end no earlier than after the `W` is destroyed.
    ]
][
    [`W{f}`]
    []
    [
        The implementation calls this constructor to indicate
        that the fields being serialized form part of a chunked
        encoding final-chunk trailer. The lifetime of `f` is
        guaranteed to end no earlier than after the `W` is
        destroyed.
    ]
][
    [`a.get()`]
    [`W::const_buffers_type`]
    [
        Called once after construction, this function returns
        a constant buffer sequence containing the serialized
        representation of the HTTP request or response including
        the final carriage return linefeed sequence (`"\r\n"`).

        Copies may be made of the returned sequence, but the
        underlying memory is still owned by the writer. The
        implementation will destroy all copies of the buffer
        sequence before destroying `a`.
    ]
]]

[heading Exemplar]

[concept_FieldsWriter]

[heading Models]

* [link beast.ref.boost__beast__http__basic_fields.writer `basic_fields::writer`]

[endsect]