#include <userver/ugrpc/server/result.hpp>
Result type for service handlers (non server-streaming).
Provides a way to return one of:
Response
+ grpc::Status::OK
;grpc::Status
.For server-streaming RPCs, see ugrpc::server::StreamingResult.
Definition at line 25 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 |
|
inline |
Construct from Response
, implies OK
status.
Definition at line 28 of file result.hpp.
|
inline |
Construct from grpc::Status
, only error status is allowed.
Definition at line 31 of file result.hpp.
|
inline |
Construct from grpc::Status
, only error status is allowed.
Definition at line 36 of file result.hpp.
|
inline |
IsSuccess() == false
. Definition at line 45 of file result.hpp.
|
inline |
IsSuccess() == true
. Definition at line 59 of file result.hpp.
|
inline |
IsSuccess() == false
. Definition at line 52 of file result.hpp.
|
inline |
IsSuccess() == true
. Definition at line 66 of file result.hpp.
|
inline |
true
iff the Result
contains Response
, as opposed to an error status. Definition at line 41 of file result.hpp.