File: Body.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 (113 lines) | stat: -rw-r--r-- 3,721 bytes parent folder | download | duplicates (9)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
[/
    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:Body Body]

A [*Body] type is supplied as a template argument to the __message__ class. It
controls both the type of the data member of the resulting message object, and
the algorithms used during parsing and serialization.

[heading Associated Types]

* [link beast.ref.boost__beast__http__is_body `is_body`]
* __BodyReader__
* __BodyWriter__

[heading Requirements]

In this table:

* `B` is a type meeting the requirements of [*Body].
* `m` is a value of type `message<b,B,F>` where `b` is a `bool` value
  and `F` is a type meeting the requirements of __Fields__.

[table Valid expressions
[[Expression] [Type] [Semantics, Pre/Post-conditions]]
[
    [`B::value_type`]
    []
    [
        The return type of the `message::body` member function.
        If this is not movable or not copyable, the containing message
        will be not movable or not copyable.
    ]
][
    [`B::reader`]
    []
    [
        If present, indicates that the body can be parsed. The type
        must meet the requirements of __BodyReader__. The implementation
        constructs an object of this type to obtain buffers into which
        parsed body octets are placed.
    ]
][
    [`B::writer`]
    []
    [
        If present, indicates that the body is serializable. The type
        must meet the requirements of __BodyWriter__. The implementation
        constructs an object of this type to obtain buffers representing
        the message body for serialization.
    ]
][
    [
    ```
    B::size(
      B::value_type body)
    ```
    ]
    [`std::uint64_t`]
    [
        This static member function is optional. It returns the payload
        size of `body` in bytes not including any chunked transfer encoding.
        The return value may be zero, to indicate that the message is known
        to have no payload. The function shall not exit via an exception.

        When this function is present:

        * The function shall not fail

        * A call to
        [link beast.ref.boost__beast__http__message.payload_size `message::payload_size`]
        will return the same value as `size`.

        * A call to
        [link beast.ref.boost__beast__http__message.prepare_payload `message::prepare_payload`]
        will remove "chunked" from the Transfer-Encoding field if it appears
        as the last encoding, and will set the Content-Length field to the
        returned value.

        Otherwise, when the function is omitted:

        * A call to
        [link beast.ref.boost__beast__http__message.payload_size `message::payload_size`]
        will return `boost::none`.

        * A call to
        [link beast.ref.boost__beast__http__message.prepare_payload `message::prepare_payload`]
        will erase the Content-Length field, and add "chunked" as the last
        encoding in the Transfer-Encoding field if it is not already present.
    ]
]]

[heading Exemplar]

[concept_Body]

[heading Models]

* [link beast.ref.boost__beast__http__basic_dynamic_body `basic_dynamic_body`]
* [link beast.ref.boost__beast__http__basic_file_body `basic_file_body`]
* [link beast.ref.boost__beast__http__basic_string_body `basic_string_body`]
* [link beast.ref.boost__beast__http__buffer_body `buffer_body`]
* [link beast.ref.boost__beast__http__empty_body `empty_body`]
* [link beast.ref.boost__beast__http__span_body `span_body`]
* [link beast.ref.boost__beast__http__vector_body `vector_body`]

[endsect]