|
Network System 0.1.1
High-performance modular networking library for scalable client-server applications
|
gRPC status with code, message, and optional details More...
#include <status.h>

Public Member Functions | |
| grpc_status ()=default | |
| Default constructor (OK status) | |
| grpc_status (status_code c) | |
| Construct with status code. | |
| grpc_status (status_code c, std::string msg) | |
| Construct with status code and message. | |
| grpc_status (status_code c, std::string msg, std::string det) | |
| Construct with status code, message, and details. | |
| auto | is_ok () const -> bool |
| Check if status is OK. | |
| auto | is_error () const -> bool |
| Check if status represents an error. | |
| auto | code_string () const -> std::string_view |
| Get status code as string. | |
Static Public Member Functions | |
| static auto | ok_status () -> grpc_status |
| Create OK status. | |
| static auto | error_status (status_code c, std::string msg) -> grpc_status |
| Create error status. | |
Public Attributes | |
| status_code | code = status_code::ok |
| std::string | message |
| std::optional< std::string > | details |
gRPC status with code, message, and optional details
Represents the status of a gRPC operation, including the status code, an optional error message, and optional encoded details (typically google.rpc.Status in binary format).
|
default |
Default constructor (OK status)
|
inlineexplicit |
|
inline |
|
inline |
Construct with status code, message, and details.
| c | Status code |
| msg | Error message |
| det | Encoded details |
Definition at line 126 of file status.h.
|
inline |
Get status code as string.
Definition at line 145 of file status.h.
References code, and kcenon::network::protocols::grpc::status_code_to_string().

|
inlinestatic |
|
inline |
Check if status represents an error.
Definition at line 139 of file status.h.
References code, and kcenon::network::protocols::grpc::ok.
|
inline |
Check if status is OK.
Definition at line 133 of file status.h.
References code, and kcenon::network::protocols::grpc::ok.
|
inlinestatic |
Create OK status.
Definition at line 154 of file status.h.
References kcenon::network::protocols::grpc::ok.
| status_code kcenon::network::protocols::grpc::grpc_status::code = status_code::ok |
Definition at line 96 of file status.h.
Referenced by code_string(), kcenon::network::protocols::grpc::client_stream_writer_impl::finish(), is_error(), is_ok(), kcenon::network::protocols::grpc::bidi_stream_impl::on_complete(), kcenon::network::protocols::grpc::client_stream_writer_impl::on_complete(), kcenon::network::protocols::grpc::server_stream_reader_impl::on_complete(), kcenon::network::protocols::grpc::bidi_stream_impl::on_headers(), kcenon::network::protocols::grpc::client_stream_writer_impl::on_headers(), and kcenon::network::protocols::grpc::server_stream_reader_impl::on_headers().
| std::optional<std::string> kcenon::network::protocols::grpc::grpc_status::details |
| std::string kcenon::network::protocols::grpc::grpc_status::message |
Definition at line 97 of file status.h.
Referenced by kcenon::network::protocols::grpc::client_stream_writer_impl::finish(), kcenon::network::protocols::grpc::bidi_stream_impl::on_complete(), kcenon::network::protocols::grpc::client_stream_writer_impl::on_complete(), kcenon::network::protocols::grpc::server_stream_reader_impl::on_complete(), kcenon::network::protocols::grpc::bidi_stream_impl::on_headers(), kcenon::network::protocols::grpc::client_stream_writer_impl::on_headers(), and kcenon::network::protocols::grpc::server_stream_reader_impl::on_headers().