3#include "rpc/common/Concepts.hpp"
4#include "rpc/common/Types.hpp"
5#include "util/UnsupportedType.hpp"
7#include <boost/json/value.hpp>
11template <SomeHandler HandlerType>
15 HandlerType
const& handler,
16 boost::json::value
const& value,
20 using boost::json::value_from;
21 using boost::json::value_to;
25 auto const spec = handler.spec(ctx.apiVersion);
26 auto warnings = spec.check(value);
29 if (
auto const ret = spec.process(input); not ret)
32 auto const inData = value_to<typename HandlerType::Input>(input);
33 auto ret = handler.process(inData, ctx);
38 Error{std::move(ret).error()}, std::move(warnings)
41 return ReturnType{value_from(std::move(ret).value()), std::move(warnings)};
44 auto const ret = handler.process(ctx);
std::unexpected< Status > Error
The type that represents just the error part of MaybeError.
Definition Types.hpp:56
static constexpr bool Unsupported
used for compile time checking of unsupported types
Definition UnsupportedType.hpp:7
Context of an RPC call.
Definition Types.hpp:99
The final return type out of RPC engine.
Definition Types.hpp:67
Definition Processors.hpp:12