#include <userver/ugrpc/server/result.hpp>
Result type for service handlers (non server-streaming).
Provides a way to return one of:
For server-streaming RPCs, see ugrpc::server::StreamingResult.
Definition at line 28 of file result.hpp.
Public Member Functions | |
| Result (Response &&response) | |
| Construct from Response, implies OK status. | |
| Result (grpc::Status &&status) | |
| Construct from grpc::Status, only error status is allowed. | |
| Result (const grpc::Status &status) | |
| Construct from grpc::Status, only error status is allowed. | |
| bool | IsSuccess () const |
| grpc::Status && | ExtractErrorStatus () |
| const grpc::Status & | GetErrorStatus () const |
| Response && | ExtractResponse () |
| const Response & | GetResponse () const |
Static Public Member Functions | |
| static Result | BorrowArenaResponse (Response &response) |
| Construct a successful result that borrows an arena-backed protobuf response. | |
|
inline |
Construct from Response, implies OK status.
Definition at line 31 of file result.hpp.
|
inline |
Construct from grpc::Status, only error status is allowed.
Definition at line 46 of file result.hpp.
|
inline |
Construct from grpc::Status, only error status is allowed.
Definition at line 53 of file result.hpp.
|
inlinestatic |
Construct a successful result that borrows an arena-backed protobuf response.
| response | A protobuf message allocated on an arena. |
Definition at line 40 of file result.hpp.
|
inline |
Definition at line 64 of file result.hpp.
|
inline |
Definition at line 81 of file result.hpp.
|
inline |
Definition at line 71 of file result.hpp.
|
inline |
Definition at line 88 of file result.hpp.
|
inline |
Definition at line 60 of file result.hpp.