22#include "rpc/common/Concepts.hpp"
23#include "rpc/common/Types.hpp"
24#include "util/UnsupportedType.hpp"
26#include <boost/json/value.hpp>
30template <SomeHandler HandlerType>
34 HandlerType
const& handler,
35 boost::json::value
const& value,
39 using boost::json::value_from;
40 using boost::json::value_to;
44 auto const spec = handler.spec(ctx.apiVersion);
45 auto warnings = spec.check(value);
48 if (
auto const ret = spec.process(input); not ret)
51 auto const inData = value_to<typename HandlerType::Input>(input);
52 auto ret = handler.process(inData, ctx);
57 Error{std::move(ret).error()}, std::move(warnings)
60 return ReturnType{value_from(std::move(ret).value()), std::move(warnings)};
63 auto const ret = handler.process(ctx);
std::unexpected< Status > Error
The type that represents just the error part of MaybeError.
Definition Types.hpp:75
static constexpr bool Unsupported
used for compile time checking of unsupported types
Definition UnsupportedType.hpp:26
Context of an RPC call.
Definition Types.hpp:118
The final return type out of RPC engine.
Definition Types.hpp:86
Definition Processors.hpp:31