Borrowed streaming consumer of the final response body.
More...
#include <StormByte/network/http/client.hxx>
|
| | Receiver () noexcept=default |
| | Construct a stateless receiver base.
|
| | Receiver (const Receiver &other) noexcept=default |
| | Copy the stateless base.
|
| | Receiver (Receiver &&other) noexcept=default |
| | Move the stateless base.
|
| virtual | ~Receiver () noexcept |
| | Destroy the receiver.
|
| Receiver & | operator= (const Receiver &other) noexcept=default |
| | Copy the stateless base.
|
| Receiver & | operator= (Receiver &&other) noexcept=default |
| | Move the stateless base.
|
| virtual bool | Begin (unsigned short status, const Safe::Vector< Header > &headers)=0 |
| | Accept or decline the final response before its body.
|
| virtual bool | Write (std::span< const std::byte > bytes)=0 |
| | Consume the next nonempty body chunk.
|
Borrowed streaming consumer of the final response body.
When Options::receiver is set, Begin is called once with the final status and fields before any body byte, including for bodyless responses. Every body byte is then passed to Write in order instead of being stored in Response::body, which stays empty; trailers are still returned. body_bytes bounds the total streamed body, so large downloads must raise body_bytes, wire_bytes and timeout explicitly. Returning false or throwing stops the exchange with Error::Rejected and closes the connection; bytes already written are not retracted. Callbacks run synchronously on the Execute thread and must not use the same client.
◆ Receiver() [1/3]
| StormByte::Network::HTTP::Receiver::Receiver |
( |
| ) |
|
|
defaultnoexcept |
Construct a stateless receiver base.
◆ Receiver() [2/3]
| StormByte::Network::HTTP::Receiver::Receiver |
( |
const Receiver & | other | ) |
|
|
defaultnoexcept |
Copy the stateless base.
- Parameters
-
◆ Receiver() [3/3]
| StormByte::Network::HTTP::Receiver::Receiver |
( |
Receiver && | other | ) |
|
|
defaultnoexcept |
Move the stateless base.
- Parameters
-
◆ ~Receiver()
| virtual StormByte::Network::HTTP::Receiver::~Receiver |
( |
| ) |
|
|
virtualnoexcept |
◆ Begin()
| virtual bool StormByte::Network::HTTP::Receiver::Begin |
( |
unsigned short | status, |
|
|
const Safe::Vector< Header > & | headers ) |
|
pure virtual |
Accept or decline the final response before its body.
- Parameters
-
| status | Final three-digit status. |
| headers | Final fields, preserving duplicates; borrowed for this call. |
- Returns
- Whether to continue receiving the body.
◆ operator=() [1/2]
| Receiver & StormByte::Network::HTTP::Receiver::operator= |
( |
const Receiver & | other | ) |
|
|
defaultnoexcept |
Copy the stateless base.
- Parameters
-
- Returns
- This receiver.
◆ operator=() [2/2]
Move the stateless base.
- Parameters
-
- Returns
- This receiver.
◆ Write()
| virtual bool StormByte::Network::HTTP::Receiver::Write |
( |
std::span< const std::byte > | bytes | ) |
|
|
pure virtual |
Consume the next nonempty body chunk.
- Parameters
-
| bytes | Chunk borrowed for this call only. |
- Returns
- Whether to continue receiving.
The documentation for this class was generated from the following file: