Files
boost_beast/doc/concept/FieldsReader.qbk
T

103 lines
3.1 KiB
Plaintext
Raw Normal View History

2017-06-06 17:26:11 -07:00
[/
Copyright (c) 2013-2017 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)
]
[section:FieldsReader FieldsReader]
A [*FieldsReader] 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.
In this table:
* `X` denotes a type that meets the requirements of [*FieldsReader].
* `F` denotes a __Fields__ where
2017-06-19 20:03:05 -07:00
`std::is_same<X, F::reader>::value == true`.
2017-06-06 17:26:11 -07:00
* `a` is a value of type `X`.
* `f` is a value of type `F`.
2017-06-17 17:33:44 -07:00
* `v` is an `unsigned` value representing the HTTP version.
2017-06-06 17:26:11 -07:00
2017-06-17 17:33:44 -07:00
* `c` is an `unsigned` representing the HTTP status-code.
2017-06-06 17:26:11 -07:00
2017-06-14 12:03:19 -07:00
* `m` is a value of type [link beast.ref.beast__http__verb `verb`].
2017-06-06 17:26:11 -07:00
[table FieldsReader requirements
[[expression][type][semantics, pre/post-conditions]]
[
[`X::const_buffers_type`]
[]
[
A type which meets the requirements of __ConstBufferSequence__.
This is the type of buffer returned by `X::get`.
]
][
[`X(f,v,m)`]
[]
[
2017-06-15 01:10:50 -07:00
The implementation calls this constructor to indicate
2017-06-06 17:26:11 -07:00
that the fields being serialized form part of an HTTP
request. The lifetime of `f` is guaranteed
to end no earlier than after the `X` is destroyed.
]
][
[`X(f,v,c)`]
[]
[
2017-06-15 01:10:50 -07:00
The implementation calls this constructor to indicate
2017-06-06 17:26:11 -07:00
that the fields being serialized form part of an HTTP
response. The lifetime of `f` is guaranteed
to end no earlier than after the `X` is destroyed.
]
2017-06-19 14:35:32 -07:00
][
[`a.chunked()`]
[`bool`]
[
Called once after construction, this function returns `true`
if the [*Transfer-Encoding] field is present, and the last
2017-06-19 20:03:05 -07:00
token in its value is "chunked".
2017-06-19 14:35:32 -07:00
]
][
[`a.keep_alive()`]
[`bool`]
[
Called once after construction, this function returns `true`
if the semantics of the mesage indicate that the connection
should remain open after processing the message. When the
2017-06-19 20:03:05 -07:00
HTTP version is below 1.1, the function returns `true` only
if the [*Connection] field is present, and its value contains
the "keep-alive" token. For HTTP versions 1.1 and above, the
function returns `true` if the [*Connection] field is absent,
or if the field value does not contain the "close" token.
2017-06-19 14:35:32 -07:00
]
2017-06-06 17:26:11 -07:00
][
[`a.get()`]
2017-06-19 20:03:05 -07:00
[`X::const_buffers_type`]
2017-06-06 17:26:11 -07:00
[
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"`).
]
][
[`is_fields_reader<F>`]
[`std::true_type`]
[
An alias for `std::true_type` for `F`, otherwise an alias
for `std::false_type`.
]
]
]
2017-06-19 14:35:32 -07:00
[heading Exemplar]
2017-06-20 20:10:47 -07:00
[concept_FieldsReader]
2017-06-17 17:33:44 -07:00
2017-06-06 17:26:11 -07:00
[endsect]