Class ServiceResponder

Nested Relationships

Nested Types

Class Documentation

class ServiceResponder

A service responder.

This is the means by which a service implementation responds to a request from a client. Each request is paired with a unique responder instance, and must be used exactly once.

Public Functions

void respondOk(const std::byte *data, size_t size) && noexcept

Sends response data to the client.

Parameters:
  • data – Response data pointer.

  • size – Response data length.

inline void respondOk(const std::vector<std::byte> &data) && noexcept

Sends response data to the client.

Parameters:

data – Response data.

void respondError(std::string_view message) && noexcept

Sends an error message to the client.

Parameters:

message – Error message, which must be valid UTF-8.

~ServiceResponder() = default

Default destructor.

ServiceResponder(ServiceResponder&&) noexcept = default

Default move constructor.

ServiceResponder &operator=(ServiceResponder&&) noexcept = default

Default move assignment.

ServiceResponder(const ServiceResponder&) = delete
ServiceResponder &operator=(const ServiceResponder&) = delete