64 explicit grpc_message(std::vector<uint8_t> payload,
bool is_compressed =
false)
82 auto serialize() const -> std::vector<uint8_t>;
103 auto size() const ->
size_t {
return data.size(); }
119 namespace trailer_names
129 namespace header_names
131 constexpr const char*
te =
"te";
142 namespace compression
146 constexpr const char*
gzip =
"gzip";
162 auto parse_timeout(std::string_view timeout_str) -> uint64_t;
constexpr const char * identity
constexpr const char * deflate
constexpr const char * gzip
constexpr const char * grpc_status_details
gRPC protocol implementation
constexpr size_t grpc_header_size
gRPC message header size (5 bytes)
constexpr size_t default_max_message_size
Maximum gRPC message size (default 4MB)
auto format_timeout(uint64_t timeout_ms) -> std::string
Format timeout as gRPC timeout string.
constexpr const char * grpc_content_type
gRPC content-type header value
auto parse_timeout(std::string_view timeout_str) -> uint64_t
Parse timeout string (e.g., "10S", "100m", "1000u")
constexpr const char * grpc_content_type_proto
gRPC content-type with proto encoding
Network-specific error and result type definitions.
gRPC message with compression flag and payload
grpc_message()=default
Default constructor.
static auto parse(std::span< const uint8_t > input) -> Result< grpc_message >
Parse gRPC message from raw bytes.
grpc_message(std::vector< uint8_t > payload, bool is_compressed=false)
Construct with data.
auto serialize() const -> std::vector< uint8_t >
Serialize message to bytes with length prefix.
auto size() const -> size_t
Get message size (payload only)
auto serialized_size() const -> size_t
Get total serialized size including header.
std::vector< uint8_t > data
Message payload.
bool compressed
Whether payload is compressed.
auto empty() const -> bool
Check if message is empty.
gRPC status with code, message, and optional details