userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
http_response_body_stream.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <string>
7
8
#include <
userver/server/http/http_response.hpp
>
9
#include <
userver/utils/fast_pimpl.hpp
>
10
11
USERVER_NAMESPACE_BEGIN
12
13
namespace
server::http
{
14
19
class
ResponseBodyStream
final {
20
public
:
22
explicit
ResponseBodyStream
(
HttpResponse
& http_response);
23
24
ResponseBodyStream
(
ResponseBodyStream
&&) =
default
;
25
~ResponseBodyStream
();
26
29
void
PushBodyChunk
(std::string&& chunk,
engine::Deadline
deadline);
30
32
void
SetBody
(std::string&& body);
33
34
void
SetHeader(
const
std::string&,
const
std::string&);
35
36
void
SetHeader(std::string_view,
const
std::string&);
37
38
void
SetEndOfHeaders();
39
41
void
SetStatusCode
(
int
status_code);
42
44
void
SetStatusCode
(
HttpStatus
status);
45
46
private
:
47
struct
BodyProducer;
48
49
bool
headers_ended_{
false
};
50
bool
headers_end_sent_{
false
};
51
utils::FastPimpl<BodyProducer, 40, 8>
body_producer_;
52
HttpResponse& http_response_;
53
};
54
55
}
// namespace server::http
56
57
USERVER_NAMESPACE_END
userver
server
http
http_response_body_stream.hpp
Generated on
for userver by
Doxygen
1.17.0