roar
|
Utility class to build up read operations. More...
#include <session.hpp>
Public Member Functions | |
ReadIntermediate (ReadIntermediate &&)=default | |
ReadIntermediate & | operator= (ReadIntermediate &&)=default |
ReadIntermediate & | bodyLimit (std::size_t limit) |
Set a body limit. | |
ReadIntermediate & | bodyLimit (boost::beast::string_view limit) |
Set a body limit. | |
ReadIntermediate & | noBodyLimit () |
Accept a body of any length. | |
ReadIntermediate & | onReadSome (std::function< bool(boost::beast::flat_buffer &, std::size_t)> onChunkFunc) |
Set a callback function that is called whenever some data was read. | |
Detail::PromiseTypeBind< Detail::PromiseTypeBindThen< Detail::PromiseReferenceWrap< Session >, Detail::PromiseReferenceWrap< Request< BodyT > const > >, Detail::PromiseTypeBindFail< Error const & > > | commit () |
Start reading here. If you dont call this function, nothing is read. | |
ReadIntermediate & | useFixedTimeout (std::chrono::milliseconds timeout) |
Set a timeout for the whole read operation. | |
Private Member Functions | |
template<typename OriginalBodyT , typename... Forwards> | |
ReadIntermediate (Session &session, Request< OriginalBodyT > req, Forwards &&... forwardArgs) | |
void | readChunk () |
Reads some bytes off of the stream. | |
Private Attributes | |
friend | Session |
std::shared_ptr< Session > | session_ |
boost::beast::http::request_parser< BodyT > | req_ |
Detail::RequestExtensions | originalExtensions_ |
std::function< bool(boost::beast::flat_buffer &, std::size_t)> | onChunk_ |
std::unique_ptr< promise::Promise > | promise_ |
std::optional< std::chrono::milliseconds > | overallTimeout_ |
Utility class to build up read operations.
BodyT | The body type of this read. |
|
inlineprivate |
|
default |
|
inline |
Set a body limit.
The | limit as a string. Must be a number. |
|
inline |
Set a body limit.
The | limit as an std::size_t |
|
inline |
Start reading here. If you dont call this function, nothing is read.
|
inline |
Accept a body of any length.
|
inline |
Set a callback function that is called whenever some data was read.
onChunkFunc | The function to be called. Is called with the buffer and amount of bytes transferred. Return false in this function to stop reading. |
|
default |
|
inlineprivate |
Reads some bytes off of the stream.
|
inline |
Set a timeout for the whole read operation.
timeout | The timeout as a std::chrono::duration. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |