45 msgpack::object
object, std::shared_ptr<msgpack::zone>
zone) {
58 msgpack::object
object, std::shared_ptr<msgpack::zone>
zone) {
87 "This result is not an error.");
91 }
catch (
const msgpack::type_error&) {
93 StatusCode::TYPE_ERROR,
"Invalid type of the error.");
103 template <
typename T>
107 StatusCode::PRECONDITION_NOT_MET,
"This result is an error.");
111 }
catch (
const msgpack::type_error&) {
113 StatusCode::TYPE_ERROR,
"Invalid type of the result.");
129 [[nodiscard]] std::shared_ptr<msgpack::zone>
zone() const noexcept {
181 std::shared_ptr<msgpack::zone>
zone_;
Class of exceptions in cpp-msgpack-rpc library.
msgpack::object object_
Object in msgpack library.
std::shared_ptr< msgpack::zone > zone() const noexcept
Get the internal zone in msgpack library.
msgpack::object object() const noexcept
Get the internal object in msgpack library.
static CallResult create_error(msgpack::object object, std::shared_ptr< msgpack::zone > zone)
Create an error result.
CallResult(const CallResult &)=default
Copy constructor.
T result_as() const
Get the result.
CallResult(CallResult &&) noexcept=default
Move constructor.
bool is_error() const noexcept
Check whether this object has an error.
bool is_error_
Whether this is an error.
T error_as() const
Get the error.
std::shared_ptr< msgpack::zone > zone_
Zone in msgpack library.
static CallResult create_result(msgpack::object object, std::shared_ptr< msgpack::zone > zone)
Create an successful result.
bool is_success() const noexcept
Check whether this object has a successful result.
Definition of MsgpackRPCException class.
Definition of StatusCode enumeration.