Represents a Specification of an entire RPC command.
More...
#include <Specs.hpp>
|
| RpcSpec (std::initializer_list< FieldSpec > fields) |
| Construct a full RPC request specification.
|
|
| RpcSpec (RpcSpec const &other, std::initializer_list< FieldSpec > additionalFields) |
| Construct a full RPC request specification from another spec and additional fields.
|
|
MaybeError | process (boost::json::value &value) const |
| Processes the passed JSON value using the stored field specs.
|
|
boost::json::array | check (boost::json::value const &value) const |
| Checks the passed JSON value using the stored field specs.
|
|
Represents a Specification of an entire RPC command.
Note: this should really be all constexpr and handlers would expose static constexpr RpcSpec spec instead. Maybe some day in the future.
◆ RpcSpec() [1/2]
rpc::RpcSpec::RpcSpec |
( |
std::initializer_list< FieldSpec > | fields | ) |
|
|
inline |
Construct a full RPC request specification.
- Parameters
-
fields | The fields of the RPC specification FieldSpec |
◆ RpcSpec() [2/2]
rpc::RpcSpec::RpcSpec |
( |
RpcSpec const & | other, |
|
|
std::initializer_list< FieldSpec > | additionalFields ) |
|
inline |
Construct a full RPC request specification from another spec and additional fields.
- Parameters
-
other | The other spec to copy fields from |
additionalFields | The additional fields to add to the spec |
◆ check()
boost::json::array rpc::RpcSpec::check |
( |
boost::json::value const & | value | ) |
const |
|
nodiscard |
Checks the passed JSON value using the stored field specs.
- Parameters
-
value | The JSON value to validate |
- Returns
- JSON array of warnings (empty if no warnings)
◆ process()
MaybeError rpc::RpcSpec::process |
( |
boost::json::value & | value | ) |
const |
|
nodiscard |
Processes the passed JSON value using the stored field specs.
- Parameters
-
value | The JSON value to validate and/or modify |
- Returns
- Nothing on success; Status on error
The documentation for this struct was generated from the following files:
- /__w/clio/clio/src/rpc/common/Specs.hpp
- /__w/clio/clio/src/rpc/common/Specs.cpp