A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
Loading...
Searching...
No Matches
a11::net::Http2ResponseWriter Class Reference

Server-side handle for writing an HTTP/2 response to one request. More...

#include <cpp/a11/net/http2.h>

Inheritance diagram for a11::net::Http2ResponseWriter:
[legend]

Classes

struct  State
 

Public Member Functions

absl::Status SendHeaders (int status, HttpHeaders headers={})
 Sends the response status and headers.
 
absl::Status Write (std::string data)
 Writes a chunk of response body data.
 
absl::Status Finish ()
 Signals the end of the response body.
 
absl::Status SendResponse (int status, HttpHeaders headers={}, std::string body={})
 Sends a complete response (status, headers, and body) in one call.
 
absl::Status Abort (absl::Status status)
 Aborts the response with the given status.
 
a11::Task Done () const
 
bool headers_sent () const
 
bool finished () const
 
std::int32_t stream_id () const
 

Friends

class Http2Connection
 

Detailed Description

Server-side handle for writing an HTTP/2 response to one request.

Handed to an Http2RequestHandler. Either stream the response incrementally (SendHeaders() then Write()/Finish()) or emit it in one call with SendResponse().

Member Function Documentation

◆ Abort()

absl::Status a11::net::Http2ResponseWriter::Abort ( absl::Status  status)

Aborts the response with the given status.

◆ Done()

a11::Task a11::net::Http2ResponseWriter::Done ( ) const
Returns
An awaitable that resolves when the response is done.

◆ Finish()

absl::Status a11::net::Http2ResponseWriter::Finish ( )

Signals the end of the response body.

◆ finished()

bool a11::net::Http2ResponseWriter::finished ( ) const
Returns
Whether the response has been finished.

◆ headers_sent()

bool a11::net::Http2ResponseWriter::headers_sent ( ) const
Returns
Whether the response headers have been sent.

◆ SendHeaders()

absl::Status a11::net::Http2ResponseWriter::SendHeaders ( int  status,
HttpHeaders  headers = {} 
)

Sends the response status and headers.

◆ SendResponse()

absl::Status a11::net::Http2ResponseWriter::SendResponse ( int  status,
HttpHeaders  headers = {},
std::string  body = {} 
)

Sends a complete response (status, headers, and body) in one call.

◆ stream_id()

std::int32_t a11::net::Http2ResponseWriter::stream_id ( ) const
inline
Returns
The HTTP/2 stream identifier.

◆ Write()

absl::Status a11::net::Http2ResponseWriter::Write ( std::string  data)

Writes a chunk of response body data.

Friends And Related Symbol Documentation

◆ Http2Connection


The documentation for this class was generated from the following files: